i made a windows form application,i want to insert values in to two tables,do i have to use procedure
i wrote a procedure but i dont know how to insert the values (dont know the C# codes to inset values) ,
this is the procedure
Create Procedure AddMark
(
@RegNo int
,@AsNo int
,@Topic varchar(100)
,@Marks float
)
AS
INSERT INTO assignmentMarks
(regno,asno,mark)
values (@RegNo,@AsNO,@Marks)
insert into assignments
(asno,as_topic)
values(@RegNo,@Topic)
GO
C#code which i wrote
int regno = Convert.ToInt16(textBoxRegNOO.Text);
int assignment =Convert.ToInt16(textBoxAssignmentNo.Text);
string ass_topic = textBoxTopic.Text;
float mark = Convert.ToInt16(textBoxMarks.Text);
var ab = db.Adds(regno,assignment,ass_topic,mark);
plz Help me , i m a beginner