textbox 
Author Message
 textbox

hello i need your help im working in vbnet and want to know how can i
validate a textbox vs a table made in sql server 2000?
Thanks


Sun, 22 May 2005 03:28:16 GMT  
 textbox
Emmanuel,
    You need to execute a query (SqlCommand) against the server to find the
value. Algo de este':

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Try ' Trap problems during the open

cn = New SqlConnection("server=demoserver;database=biblio;integrated
security=sspi")



CInt(txtIDToTest.text)

Dim strAuthor As Object

cn.Open()

strAuthor = cmd.ExecuteScalar

If strAuthor Is Nothing Then

MsgBox("No such ID")

Else

MsgBox("ID found")

End If

Catch ex As Exception

MsgBox(ex.ToString)

Finally

cn.Close()

End Try

End Sub

--
________________________________
William (Bill) Vaughn, Author, Trainer, Mentor
Microsoft Pacwest Regional Director, MVP
"ADO.NET and ADO Examples and Best Practices for VB Programmers--2nd
Edition" (ISBN: 1-893115-68-2)
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
________________________________

Quote:
> hello i need your help im working in vbnet and want to know how can i
> validate a textbox vs a table made in sql server 2000?
> Thanks



Sun, 22 May 2005 03:50:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Assigning value to textbox if textbox is a variable name

2. Userform: populate textbox with date from another textbox

3. object is not valid for type textbox and type textbox

4. datagrids and textboxes - rowchanges reflected in textbox

5. Textbox as a rich-textbox?

6. textbox auto tab to next textbox

7. Textbox as a rich-textbox?

8. VB3 textbox scrolldown -> blank textbox

9. Rich Textbox / Textbox Scrolling

10. Changing the textbox's value of a textbox in a frame

11. Uneditable textbox a automatical scrolling in textbox

12. how to use textbox 's scrollbar auto move text in textbox

 

 
Powered by phpBB® Forum Software