and add values into column according to sql result
i created datatable at design time using add new items>dataset
i only need to fetch value from database and insert into datatable
Can any one help
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Apr 14, 2010, 11:12 PM EDT
dataset is the collection of datatable, if you have created dataset form database on design time, you can use dataset1.Tables[0] term as datatable.....and perform your task..
thanks
Please mark as answere if it helps
Sam HobbsRank #107 · 20.5K reputationPosted Apr 15, 2010, 11:15 AM EDT
Sandesh Patil179 reputationPosted Apr 23, 2010, 4:50 AM EDT
DataTable table = new DataTable();
bool ready = false;
try
{
string sql = "select * from table";
con = ConnectionManager.GetDatabaseConnection();
SqlCommand cmd = new SqlCommand(sql, con);
cmd.CommandType = System.Data.CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(table);
if (table.Rows.Count > 0)
{
ready = true;
}
}
I think this will help u....