Friday 13 January 2012

How to Extract the Data from DataSet Object In C# Lanaguage

 SqlConnection scon = new SqlConnection("database=StudentDB;trusted_connection=yes");
        SqlCommand scmd = new SqlCommand("select* from StudentInfoTable", scon);
        SqlDataAdapter sda = new SqlDataAdapter(scmd);
        DataSet ds = new DataSet();
        sda.Fill(ds);
        TextBox1.Text = ds.Tables[0].Rows[0][0].ToString(); //The Main Line to understand        scon.Close();

No comments:

Post a Comment