I wana know how can i use a value from a sql table that i added from another form?
It basically supposed to validate that whatever was the last recorded added in the other form(eg formA) , i must then use those same values from the sql , into another form(eg formB).If i type a value in the textbox( in formB), it basically must validate that, the value i typed in, is not the record that was enterd in the other form(formA) (the last record added in that form)
Here is my coding that i did:
Dim conmid As New SqlClient.SqlConnection("Data Source=CHETS-TOSHIBA\SQLEXPRESS;Initial Catalog=PlanetDiscLibrary;Integrated Security=True")
Dim sqlsmid As String = "SELECT TOP 1 '" + txtMID.Text + "' from request ORDER BY request_id DESC"
Dim cmdmid As New SqlClient.SqlDataAdapter(sqlsmid, conmid)
Dim dsmid As New DataSet
Dim memid As Integer
Dim dtmeid As DataTable
cmdmid.Fill(dsmid, "member")
dtmeid = dsmid.Tables("member")
memid = dtmeid.Rows.Count
If memid = 0 Then
MessageBox.Show("Not request Member ID", "MemberIDError", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtMID.Text = ""
Return False
End If
How else can i do this please hekp. Thanks