Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-04-2009
Member
 
Join Date: Dec 2008
Posts: 135
Issue with connection database in Visual Basic

Hello friends,

I am not able to retrieve the data from database in text boxes through combo box.Where combo box contains roll no which is when selected shows the related information of that roll no from that database.
Reply With Quote
  #2  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Issue with connection database in Visual Basic

Sure i will help you out with this before that may i know by which Database are you using for your connectivity.
Reply With Quote
  #3  
Old 08-04-2009
Member
 
Join Date: Dec 2008
Posts: 135
Re: Issue with connection database in Visual Basic

I am using adodc as my Connectivity Database
Reply With Quote
  #4  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Issue with connection database in Visual Basic

Try to use the following code and i am sure it will work for you and try to use ADODB

Code:
Option Explicit

Private Sub Command1_Click()
Dim esql As String
esql = "select * from testable where RollNo=" & val(Text1)
Adodc1.RecordSource = esql
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Refresh
label1= Adodc1.Recordset.Fields(0)
label2=adodc1.recordset.fields(1)
'and so  on
'better to use Labels so that user does not change data as in Textbox
End If
End Sub
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Issue with connection database in Visual Basic"
Thread Thread Starter Forum Replies Last Post
Connect Visual Basic with SQL server database samualres Software Development 4 28-11-2009 08:37 AM
Visual Basic express sql server connection shilong Software Development 3 06-08-2009 12:39 PM
Issue with Visual Basic Code Harshini Software Development 1 10-04-2009 04:21 PM
Visual Basic 2005 or Visual Basic 6 Aasha Software Development 5 15-01-2009 06:56 PM
Visual Basic on LAN djbbenn Software Development 2 05-08-2008 02:15 PM


All times are GMT +5.5. The time now is 06:41 AM.