No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
2 Posted Topics
[B][U][COLOR="red"][COLOR="Red"]try this code to acess data from sql server [/COLOR][/COLOR][/U][/B] [CODE]//path of database string connectString = "Data Source=VOSTRO\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True"; SqlConnection con = new SqlConnection(connectString); con.Open(); //selecting data from database string sql = "select max(e_code) from employees "; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) …
[CODE]protected void Button1_Click(object sender, EventArgs e) { string connectString = "Data Source=VOSTRO\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True"; SqlConnection con = new SqlConnection(connectString); con.Open(); string lecd = (string)(Session["v"]); //selecting data from database string sql = "select * from employees WHERE e_code=" + lecd; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader reader = cmd.ExecuteReader(); while …
The End.
ashishkj1989