Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Vb.net SQLite query code

Posted on 2009-05-16
2
Medium Priority
?
525 Views
Last Modified: 2013-12-25
I have a form that takes input from a user and enters it into an SQLite table. I have another form with a couple of fields and a button. I want to query the sqlite table based off of the value in textbox1. I am running vb.net 2005 with SQLite ado.net. If I have three text boxes and enter say 1234 in textbox1 and click the button on the form, how can I pass textbox1's value to a query and fill in the other two textboxes with the results?

thank you
0
Comment
Question by:heydude
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
srikanthreddyn143 earned 2000 total points
ID: 24405047
I dnt hav much idea abt SQLite. But I saw it some where. Try it!!

Dim SQLconnect As New SQLite.SQLiteConnection()
        Dim SQLcommand As SQLiteCommand
Dim dr As DataReader
        SQLconnect.ConnectionString = "Data Source=vault.db;"
        SQLconnect.Open()
        SQLcommand = SQLconnect.CreateCommand
        SQLcommand.CommandText = "SELECT Col2,Col3 FROM TABLE1 WHERE Col1='"& TxtBox1.Text&"'"
       dr  = SQLCommand.ExecuteReader()
        SQLcommand.Dispose()
        SQLconnect.Close()
Do While   dr.Read()    
 TxtBox2.Text = dr(0)("Col2")
        TxtBox3.Text = dr(0)("Col3")
Loop
        Me.Hide()
0
 

Author Closing Comment

by:heydude
ID: 31582313
Thank you, got it working!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question