i want sample coding to insert data into SQL SEr开发者_StackOverflow中文版ver 2005 using ASP.NET
The most basic using a store procedure, but agree with @TomTom you probably need to get a little info on the subject first.
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnection"].ConnectionString);
SqlCommand cmd = new SqlCommand("Create", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Column", SqlDbType.NVarChar).Value = "foo"
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Head over to http:/www.asp.net/ and read the tutorials there as well as hang around the beginner forum. This gives you a lot more than some code snippet here.
精彩评论