I am using vb.net 2008 and I have created a test screen with a Datagridview on it that is displaying some basic login details from the login table. The Datagridview is not bound to anything. The login table is within an sql server express database, and i have a table adapter with an insert query that is a stored procedures within the DB.
This code seems to work fine in that the record will appear within the Datagridview after the insert code runs...but no record is being entered into the login Table.
any help would be great....
This code seems to work fine in that the record will appear within the Datagridview after the insert code runs...but no record is being entered into the login Table.
VB.NET:
Dim TableAdapter As New LoginTableAdapters.LogInTableAdapter
Dim connection As SqlClient.SqlConnection = _
New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True")
connection.Open()
Try
Dim command As SqlClient.SqlCommand = New SqlClient.SqlCommand("InsertQuery", connection)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add("@liID", SqlDbType.BigInt, 8).Value = 6
command.Parameters.Add("@Username", SqlDbType.VarChar, 50).Value = "test@test.com.au"
command.Parameters.Add("@Password", SqlDbType.VarChar, 50).Value = "test"
command.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Source & vbCrLf & ex.Message)
Finally
DataGridView1.DataSource = TableAdapter.GetData
End Try
any help would be great....