S
sweetness
I'm new to this and desperately need help, I'm trying to
insert into an sql db and i have no idea what to do and
why.
i created an sqladapter, and an sqlconnection by dragging
and dropping.
this is a piece of my code:
Try
Me.SqlInsertCommand1.CommandText = "INSERT INTO
StudentInfo(STUDENTID, SURNAME, FIRST_NAMES, PASSWORD,
GENDER, RESIDENCE) VALUES(' " & sNumber.Text & " ' ,' " &
surname.Text & " ' , ' " & fNames.Text & " ' , ' " &
pass.Text & " ' , ' " & gender.SelectedItem.Text
& " ' , ' " & res.Text & " ' )"
Me.SqlInsertCommand1.Connection =
Me.SqlConnection1
Me.SqlDataAdapter1.SelectCommand =
Me.SqlInsertCommand1
SqlConnection1.Open()
SqlInsertCommand1.ExecuteNonQuery()
Catch d As Exception
Console.WriteLine(d.Message)
End Try
Console.WriteLine("Record Added")
insert into an sql db and i have no idea what to do and
why.
i created an sqladapter, and an sqlconnection by dragging
and dropping.
this is a piece of my code:
Try
Me.SqlInsertCommand1.CommandText = "INSERT INTO
StudentInfo(STUDENTID, SURNAME, FIRST_NAMES, PASSWORD,
GENDER, RESIDENCE) VALUES(' " & sNumber.Text & " ' ,' " &
surname.Text & " ' , ' " & fNames.Text & " ' , ' " &
pass.Text & " ' , ' " & gender.SelectedItem.Text
& " ' , ' " & res.Text & " ' )"
Me.SqlInsertCommand1.Connection =
Me.SqlConnection1
Me.SqlDataAdapter1.SelectCommand =
Me.SqlInsertCommand1
SqlConnection1.Open()
SqlInsertCommand1.ExecuteNonQuery()
Catch d As Exception
Console.WriteLine(d.Message)
End Try
Console.WriteLine("Record Added")