开发者

ASP.NET coding for insert data

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜