both r same thing SqlConnection con=new SqlConnection (cs); con.ConnectionString =cs;
On 8/10/09, san <[email protected]> wrote: > > oh really sorry man i did something wrong with this. > > > > you can go for this > > > > > string cs = "data source=*;initial catalog=*;user id=*;password=*"; > SqlConnection con=new SqlConnection (cs); > con.ConnectionString =cs; > con.Open (); > > > string sempid; > > > //INSERT THE VALUE TO RETRIEVE IN THIS > sempid=textBox1 .Text ; > string query="select * from xxx where emp...@sempid; > command cmd=new SqlCommand (query,con); > cmd.Parameters.Add (new SqlParameter (query,con); > SqlDataReader dr = cmd.ExecuteReader(); > while (dr.Read()) > { > > // THIS IS FOE DISPLAYING THE VALUE FROM THE dATATABLE > textBox2.Text = dr[1].ToString (); > ; > ; > } > > > > > > > > > > >
