A) Create a web application bind data in a multiline textbox by querying in another textbox. protected void Button1_Click(object sender, EventArgs e) { SqlConnection conn=new SqlConnection(); conn.ConnectionString="Data Source=COMP254;Initial Catalog=TYIT;Integrated Security=True"; //stringconnStr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString; //SqlCommand cmd = new SqlCommand("Select Id,Name,Password from Login", conn); SqlCommand cmd = new SqlCommand(TextBox1.Text, conn); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { TextBox2.Text += reader["Id"].ToString() + " " + reader["Name"].ToString() + " " + reader["Password"].ToString() + "\n"; } reader.Close(); conn.Close(); } B) Create a web application to display records by using database. protected void Button1_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(); conn...
Comments
Post a Comment