Displaying a list of Databases in a combo box

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2006
Posts: 17
Reputation: mstester is an unknown quantity at this point 
Solved Threads: 0
mstester mstester is offline Offline
Newbie Poster

Displaying a list of Databases in a combo box

 
0
  #1
Mar 23rd, 2007
Hi all, (First Post...YEEERROOO)

Quick question for ya all, I have an MySQL server with three databases created on it, lets say test, test_1 and test_2. Is there a way that I can display what ever databases are stored on the server in a combo box?

I want to allow the user to be able to choose which database they want to coneect to. Any help would be cool

BTW Im using VB.net on VS2005
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 5
Reputation: molze is an unknown quantity at this point 
Solved Threads: 1
molze molze is offline Offline
Newbie Poster

Re: Displaying a list of Databases in a combo box

 
0
  #2
Mar 23rd, 2007
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
Dim conn As New ADODB.Connection()
Dim rs As New ADODB.Recordset()
Dim connStr, sSQL As String
Dim Results, i As Integer
connStr = "Provider=SQLOLEDB.1;Initial Catalog=xxxx;Data Source=x.x.x.x;User ID=sa;Password=xxXXxx;Application name = New_Businessnew"
conn.Open(connStr)
sSQL = "sp_helpdb"
rs = conn.Execute(sSQL, Results)
rs.MoveNext()
Do While Not rs.EOF And Not rs.BOF
cb.Items.Add(rs.Fields("Name").Value)
rs.MoveNext()
Loop
rs.Close()
End Sub
Last edited by molze; Mar 23rd, 2007 at 9:20 pm. Reason: syntax error
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 17
Reputation: mstester is an unknown quantity at this point 
Solved Threads: 0
mstester mstester is offline Offline
Newbie Poster

Re: Displaying a list of Databases in a combo box

 
0
  #3
Mar 27th, 2007
Cheers, for the help man.

ps: sorry for the late reply :s
Last edited by mstester; Mar 27th, 2007 at 9:31 pm.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 3
Reputation: jayachitra_34 is an unknown quantity at this point 
Solved Threads: 0
jayachitra_34 jayachitra_34 is offline Offline
Newbie Poster

Re: Displaying a list of Databases in a combo box

 
0
  #4
Mar 2nd, 2008
List some difficulties which u feel could be easily soved when working with the oracle
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 3
Reputation: jayachitra_34 is an unknown quantity at this point 
Solved Threads: 0
jayachitra_34 jayachitra_34 is offline Offline
Newbie Poster

Re: Displaying a list of Databases in a combo box

 
0
  #5
Mar 2nd, 2008
If suppose there is no database at all?what would the poeple of IT would have done?
Is there any remedy
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 3
Reputation: jayachitra_34 is an unknown quantity at this point 
Solved Threads: 0
jayachitra_34 jayachitra_34 is offline Offline
Newbie Poster

Re: Displaying a list of Databases in a combo box

 
0
  #6
Mar 2nd, 2008
Do you think that databases are really act as the backbone for all programming languages? your comments please
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1
Reputation: Sem Shah is an unknown quantity at this point 
Solved Threads: 0
Sem Shah Sem Shah is offline Offline
Newbie Poster

Re: Displaying a list of Databases in a combo box

 
0
  #7
Dec 1st, 2008
Ok the solution u provide mighty be true.but can u tell me what should i write insted of **** in connection string?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC