6 different type of tables in database .
How to write a query and How to Diplay in .Cs?
Table Is :
Table 1: Price 1$,
Table 2: Price 1$,
Table 3: Price 1$,
Table 4: Price 1$,
Table 5: Price 1$,
Table 6: Price 1$,
How to Write A Query , In SqlServer , Or Label code also
How to Write Code Or Query ...

Sai Prasad AnumoluPosted Mar 1, 2014, 8:26 AM
Sai Prasad AnumoluPosted Mar 1, 2014, 8:25 AM
Sanjay KumarPosted Mar 1, 2014, 8:12 AM
Sai Prasad AnumoluPosted Mar 1, 2014, 7:55 AM
Sai Prasad AnumoluPosted Mar 1, 2014, 7:38 AM
Sanjay KumarPosted Mar 1, 2014, 7:33 AM
try this
// Query1
string sql1 = @"select ID,Name from Person ";
//Query2
string sql2 = @"select FirstName, LastName from Person";
string sql = sql1 + sql2;
// Create connection
SqlConnection conn = new SqlConnection(connString);
try
{
// Open connection
conn.Open();
// Create command
SqlCommand cmd = new SqlCommand(sql, conn);
// Create data reader
SqlDataReader rdr = cmd.ExecuteReader();
// Loop through result sets
do
{
Label.Text(rdr.GetName(0));
while (rdr.Read())
{
// Print one row at a time
Label .text(rdr[0].ToString());
}
}
while (rdr.NextResult());
rdr.Close();
}
catch (SqlException ex)
{
lblMessage.tex(ex.Message + ex.StackTrace,"Exception Details");
}
finally
{ conn.Close();
}