.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 24th, 2003, 04:09 PM
monkeyspunks monkeyspunks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 monkeyspunks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow Sql With VB.net problem

Hi all im a newbie to programming and i've ran into a problem

i can't get my program to connect to a remote sql server

but it does connect to my local one with "localhost" as the server, it does not work with my ip either and its gettin to me

anyway heres the code

fsConn = "Data Source=mysql;" & _
"Data Source=xx.xx.xxx.xxx;" & _
"Database=test;" & _
"User ID=monkey;" & _
"Password=XXXXXXXX;" & _
"Command Logging=false"
cn = New MySqlConnection(fsConn)
cn.open()

im using the eInfoDesigns DLL

cheers for any replys

monkey

Reply With Quote
  #2  
Old September 25th, 2003, 09:38 AM
Pain Pain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Sheffield, UK
Posts: 94 Pain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Pain
Hiya,

I cant give you a total solution, but I can give you some options to look at:

http://www.able-consulting.com/dotn...TNativeProvider

Imports EID.MySqlClient

Dim oMySqlConn As MySqlConnection = New MySqlConnection()
oMySqlConn.ConnectionString = "Data Source=localhost;" & _
"Database=mySQLDatabase;" & _
"User ID=myUsername;" & _
"Password=myPassword;" & _
"Command Logging=false"
oMySqlConn.Open()


For more information, see: http://www.einfodesigns.com/dbProvider_info.aspx

Im fairly certain you can just replace 'localhost' with your ip address. Another example i've got is:

ODBC .NET Data Provider connection string, connecting to the USERMANPC MySQL Server with IP Address 10.8.1.30:





“DRIVER={MySQL};SERVER=10.8.1.30;UID=UserMan;PWD=userman;DATABASE=UserMan”



or



“DRIVER={MySQL};SERVER=10.8.1.30;UID=UserMan;PWD=userman;Initial Catalog=UserMan”



If the names service is set up OK you should also be able to use:



“DRIVER={MySQL};SERVER=USERMANPC;UID=UserMan;PWD=userman;DATABASE=UserMan”



I wont vouch for the accuracy or correctness, though its another thing to look at.

Chris

Last edited by Pain : September 25th, 2003 at 09:40 AM.

Reply With Quote
  #3  
Old September 25th, 2003, 09:51 AM
monkeyspunks monkeyspunks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 monkeyspunks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
cheers for your reply i will give them a go

Reply With Quote
  #4  
Old September 25th, 2003, 06:04 PM
monkeyspunks monkeyspunks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 monkeyspunks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
right i gave every combi a chance and no look, is there any example programs to do this ?

cheers monks

Reply With Quote
  #5  
Old September 26th, 2003, 05:29 AM
Pain Pain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Sheffield, UK
Posts: 94 Pain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Pain
Unfortunately not.

At present, mySQL is not supported by vs.NET and as a result, any connections you make have to be 'hard coded' into your script.

The standard 'add connection' and then drag-n-drop oledbconnection onto your form will result in messages like "not allowed" or "this version of vs.net doesnt do this" or "haha you think Bill Gates want it that easy for you to use non microsoft products? Get a life you lepper!"

If it helps any, i've got the same problem.

Just make sure, that you've got mysql correctly set up on the host machine (using mysql server), and that the database itself is fully setup within the ODBC Connections (control panel area) under the file/system dsn (cant remember off the top of my head which one you need, but one is local to the machine, the other is to the network), and ensure you have similarly set up the same odbc connection on the client machines to look to the IP address of the host server. Both the client and server machines will need the mySQL drivers (downloadable from mysql.com if needed) and then start praying for miracles.

The code that I gave you should (in theory) work, but then, Microsoft have this habit of not making anything non-MS work too easily.

Reply With Quote
  #6  
Old September 27th, 2003, 03:34 PM
monkeyspunks monkeyspunks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 monkeyspunks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Right i have sorted it

i downloaded this dll

URL

and used

Imports MySQLDriverCS

Dim fsConn As String
Dim cn As MySqlConnection
Dim cmd As New MySqlCommand()





fsConn = "Data Source=test;" & _
"Server=xx.xx.xxx.xxx;" & _
"Database=test;" & _
"User ID=myid;" & _
"Password=mypassword;" & _
"Command Logging=false"
cn = New MySQLConnection(fsConn)
cn.Open()


it appears to be working gr8

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Sql With VB.net problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT