|
-
Oct 24th, 2007, 12:25 AM
#1
Thread Starter
Lively Member
search for match data from a accessdatabase
i have a set of data which have two field (ID and Title).
i have two textbox and 1 button.
after i key in "data of Title field" in textbox1 and click the commandbutton, i want the match "ID data" show in textbox2.
How to do that?
-
Oct 24th, 2007, 03:26 AM
#2
Re: search for match data from a accessdatabase
In brief you'd do
'connect to DB
'issue oledbcommand
because you only want to return 1 value you can use executeScalar with a select statement like (SELECT id FROM yourTable WHERE title = '@title')
'add parameter > commandName.parameter.addwithvalue("@title", textbox1.text)
'execute command
dim theID as string = commandName.executeScalar()
textBox2.text = theID
If you are unsure of the code that accomplishes this I'd suggest studing ADO.NET
-
Oct 25th, 2007, 05:11 AM
#3
Re: search for match data from a accessdatabase
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|