How to insert data into SQL Server

前端 未结 3 1584
闹比i
闹比i 2020-12-01 05:23

What the problem on my coding? I cannot insert data to ms sql.. I\'m using C# as front end and MS SQL as databases...

name = tbName.Text;
userId = tbStaffId.         


        
3条回答
  •  Happy的楠姐
    2020-12-01 06:08

    string saveStaff = "INSERT into student (stud_id,stud_name) " + " VALUES ('" + SI+ "', '" + SN + "');";
    cmd = new SqlCommand(saveStaff,con);
    cmd.ExecuteNonQuery();
    

提交回复
热议问题