Aseem Bhardwaj

Aseem Bhardwaj

  • 1.5k
  • 102
  • 19.1k

multiple statements through single procedure by appcode clas

Sep 7 2016 7:52 AM
ei have single stored procedure in which, i have put poly statements (insert, update and delete) by using if condition [if @mode='insert' (insert into tablename (id,ab,cd,) values(@id,@ab,@cd).
now problem is "i am using connection class from  appcode folder of asp.net. in which i have given connection string and build objects of sqlcommand, sql commandtype, datareader, data set, data adapter. now i am having problem in insert data from textbox to sql server. the problem is i do not know, how to concatenate string and values."
in normal we can use cmd.Parameters.AddWithValue("@mode", "Insert"); but now i do not know how would i use @mode='insert' . please help

Answers (7)