| |

VerySource

 Forgot password?
 Register
Search
View: 673|Reply: 4

How to nest DataReader in .net?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-31 16:20:01
| Show all posts |Read mode
while (sdr.Read ())
        {

            storeid = sdr [0] .ToString ();
            Storepi = sdr [1] .ToString ();
            mobileinfoid = sdr [2] .ToString ();
            MobileModel = sdr [3] .ToString ();


            sdrAccessory = AccessoryStoreCmd.ExecuteReader ();
            while (sdrAccessory.Read ())
            {
                AccessoryName + = sdr [0];
                AccessoryName + = "";
                AccessoryName + = sdr [1];
                AccessoryName + = "";
            }

}
Reply

Use magic Report

1

Threads

7

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-10 14:45:01
| Show all posts
This will take two Connections, lz think twice
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-10 18:45:01
| Show all posts
I want to use code to dynamically output a table to the foreground. This line is a cell phone type message. Each phone model contains multiple accessories. I just want to traverse the database and add each accessory as a string and put it into a cell.
Reply

Use magic Report

0

Threads

31

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-3-12 23:15:01
| Show all posts
Can't stored procedures work?
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-7-23 19:15:01
| Show all posts
Use dataset first
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list