![]() |
| ||
| Error connecting to MySql hello everyone, i need to make a program that will show/load the images stored in mysql database, i've already created the database and my problem is i can't load it in my vb code.... here's my code below Dim conn As MySqlConnection 'connect to database conn = New MySqlConnection() conn.ConnectionString = "server = localhost; id = root; password = mypass; database=face manager" Try conn.Open() Catch myerror As MySqlException MsgBox("Error connecting to database") End Try 'sql query Dim myAdapter As New MySqlDataAdapter Dim sqlquery = "SELECT * FROM eyes" Dim myCommand As New MySqlCommand() myCommand.Connection = conn myCommand.CommandText = sqlquery 'start query myAdapter.SelectCommand = myCommand Dim myData As MySqlDataReader myData = myCommand.ExecuteReader() thanks, i need any response |
| ||
| Re: Error connecting to MySql For some reason I didn't get DataReader to work. But with DataAdapter and DataSet I got images from DB. I used SQL Server but that shouldn't make any difference. 'start queryYou also have to import System.IO namespace to use memory stream. |
| ||
| Re: Error connecting to MySql Hi! Just verify these- Do you have the MySQL Connector installed? Are you sure your connection string is correct? |
| ||
| Re: Error connecting to MySql Quote:
|
| ||
| Re: Error connecting to MySql try this connection string- Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; |
| All times are GMT -4. The time now is 10:00 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC