asp.net 执行sql插入
stringsql="declare@idint;insertintoTb_FindActivity(Act_Name,Act_Pic,Act_Class,Act_Pos...
string sql = "declare @id int; insert into Tb_FindActivity (Act_Name,Act_Pic,Act_Class,Act_Position,) values ('" + TextBox1.Text.Trim() + "','" + Image1.ImageUrl.ToString() + "','" + RadioButtonList1.SelectedItem.Value + "','" + CheckPosition() + "'); set @id=@@IDENTITY; insert into Tb_FindActivity(Act_ID,Act_Store,Act_Dishes,Act_Detail) values (@id,'" + TextBox2.Text.Trim() + "','" + TextBox3.Text.Trim() + "','" + TextBox4.Text.Trim() + "'); insert into Tb_ActState ( Act_ID,Act_Startdate,Act_Joindl) values (@id,'" + a + "','" + b + "'); insert into Tb_ActNum (Act_ID,Act_Maxnum) values (@id,'" + DropDownList1.SelectedItem.Value + "') insert into Tb_ActUser (Act_ID,User_Name) values(@id,'" + Session["UserLoginName"].ToString() + "')";
请问上面的sql是否有误,其中Act_ID为自增型,应该怎么执行这条SQL 展开
请问上面的sql是否有误,其中Act_ID为自增型,应该怎么执行这条SQL 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询