xxsoulxx
January 28th, 2006, 02:14 PM
hi there , i am having problems getting my data to the db .. there are no errors displaying .. its just that data wont go in ...
Dim a As String
Dim b As String
a = TextBox1.Text
Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\temp\db1.mdb")
Dim strSQL As String = "INSERT INTO Table1 (yo,yoyo) VALUES (a,a) where user = '" + TextBox2.Text + "'"
'Dim strSQL As String = "INSERT INTO Settins (PhotoUpload) VALUES (@img) WHERE UserID = '" + rId + "'"
Dim cmd As New OleDbCommand(strSQL, cnn)
Try
cnn.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
'lb_Msg.Text = ex.Message
Finally
If Not cmd Is Nothing Then
cmd.Dispose()
End If
If Not cnn Is Nothing Then
cnn.Close()
cnn.Dispose()
End If
End Try
End Sub
Dim a As String
Dim b As String
a = TextBox1.Text
Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\temp\db1.mdb")
Dim strSQL As String = "INSERT INTO Table1 (yo,yoyo) VALUES (a,a) where user = '" + TextBox2.Text + "'"
'Dim strSQL As String = "INSERT INTO Settins (PhotoUpload) VALUES (@img) WHERE UserID = '" + rId + "'"
Dim cmd As New OleDbCommand(strSQL, cnn)
Try
cnn.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
'lb_Msg.Text = ex.Message
Finally
If Not cmd Is Nothing Then
cmd.Dispose()
End If
If Not cnn Is Nothing Then
cnn.Close()
cnn.Dispose()
End If
End Try
End Sub