Home > database >  In c # connect to the database and show the data
In c # connect to the database and show the data

Time:09-21

Don't know why the database table to have data, but lost out, solving,

CodePudding user response:

while (dataReader. Read ())
{
String orderId=dataReader. Get string (0);
String lie1=dataReader. Get string (1);
String lie2=dataReader. Get string (2);
}
Console. WriteLine (" orderId: {0} column 1: {1} column 2: {2} ", orderId, lie1, lie2);
The dataReader. Close ();

CodePudding user response:

The
reference 2 floor 姎 jacaranda response:
while (dataReader. Read ())
{
String orderId=dataReader. Get string (0);
String lie1=dataReader. Get string (1);
String lie2=dataReader. Get string (2);
}
Console. WriteLine (" orderId: {0} column 1: {1} column 2: {2} ", orderId, lie1, lie2);
The dataReader. Close ();

Understand, thank you
  • Related