c# - In sending the values to accdb for this form -


I have used this code script but there is no error but DB is not updating please radio BTN1, 2 For a group and radio BTN 4,5 [no_of_candidates (1, 2)] are in another group for 2 3 [year (second, third, fourth]] and 4,4,6,7,8. [Events (Paper Present, Quiz, Debugging, ...)] and this form is for Simmom's registration for my department.
Coding:

Coding:

    

Use the sample below to update your code. Change the dynamically created SQL with the parameter < / P>

  (var connection = new OleDbConnection ("YouConnectionString")) {connection.Open (); (Var command = connection.CreateCommand ()) {// It is not that all parameters are created with a @ in front of the name command.CommentText = @ "Registration (name, branch, college, contact) VALUES (@ THE_NAME, @THE_BRANCH, @THE_COLLEGE, @THE_CONTACT); "; // Insert your parameters, change the OLDub type that matches your field command. Add the parameter (" @ THE_NAME ", OleDbType.VarChar). Valav = textbox1.Text; Command.Add parameter (" @ THE_BRANCH ", OleDbType.VarChar) .Value = textBox2.Text; order. parameters. Add (" @ THE_COLLEGE ", OleDbType.VarChar). Valu = textbox3.Text; Command.Parameters.Add (" @ THE_CONTACT ", OleDbType. VarChar) .Value = textBox4.Text; Var I = command.ExecuteNonQuery (); if (i & lt; = 0) {new exception throw ("Unable to create record.")}}}}   

Comments