SqlDataAdapter Use this data adapter object to bind SQL data sources. Using SqlDataAdapter Object Using System.Data.OleDb; // do not forget your namespace ------------------------------ Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt ......
SqlDataReader Use this datareader object to bind SQL data sources. Using SqlDataReader Object Using System.Data.SqlClient; // do not forget your namespace ------------------------------ SqlConnection conn = new SqlConnection(connectionStr... conn.Open(); SqlCommand comm = new SqlCommand("select * from [My_Table]",conn); comm.CommandType = CommandType.Text; SqlDataReader dr = comm.ExecuteReader(); while (dr.Read()) { TextBox1.Text = (string)dr["info"].ToString(); //datareader object accepts 2 overloads ......