If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ADO.Net connection string

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-03-06, 03:37
divined divined is offline
Registered User
 
Join Date: Apr 2004
Posts: 110
ADO.Net connection string

In an application using good old ADO I used the connection string :

Code:
DRIVER={MySQL ODBC 3.51 Driver}; " & "SERVER = " & strServerIP & "; " & " DATABASE=bio_tech; " & "UID = " & strOnomaXrhsth & "; PWD = " & strKwdikosXrhsth & ";
Can this same connection string be used as a Parameter to the DataAdapter class of ADO.NET? Do I need to make some changes to get the same connection under ADO.NET?

Last edited by divined; 07-06-06 at 05:34.
Reply With Quote
  #2 (permalink)  
Old 07-05-06, 09:57
koncept koncept is offline
Registered User
 
Join Date: Jul 2006
Posts: 26
are you using asp.net? or just ado.net? If it is just ado.net, I think it will work fine the way it is. If it is asp.net i would recomend installing the .net connector for mysql
Reply With Quote
  #3 (permalink)  
Old 07-06-06, 05:22
divined divined is offline
Registered User
 
Join Date: Apr 2004
Posts: 110
ok. I installed the net Connector driver.

Now I want to connect through a DataAdapter class using Visual C# 2005. What is the connection string I need to use?
Reply With Quote
  #4 (permalink)  
Old 07-06-06, 07:54
koncept koncept is offline
Registered User
 
Join Date: Jul 2006
Posts: 26
this is the one i used
server=localhost; user id=username; password=password; database=dbname; pooling=false;

a few snippits from a page (its vb)
Code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<% @Import Namespace="System.Data" %>
<% @Import Namespace="MySQL.Data.MySQLClient" %>

<script runat="server">
	Dim strCon As MySQLConnection = New MySqlConnection("connString")
	sub bindUData()
		dim strSQL as string = "select * from table"
		Dim objCommand as New MySQLCommand(strSQL, strCon)
		strCon.open()

		Dim myAdapter as New MysqlDataAdapter(objCommand)
		Dim ds as New DataSet()
		myAdapter.Fill(ds)
    		
		dgUsers.DataSource = ds
		dgUsers.DataBind()	
		
		strCon.close()
	end sub
that should be able to get you going
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On