Click here to Skip to main content
15,909,193 members
Home / Discussions / C#
   

C#

 
QuestionODBC Problem Pin
telconstar996-Nov-05 10:34
telconstar996-Nov-05 10:34 
Hey guys,

I'm using the following code to connect to my remote mysql database. Of
course I changed the server, database name, login/pass info, for my
posting on the web...

string connectString="DRIVER={MySQL ODBC 3.51 Driver};SERVER=xxx.xxx.xxx.xx;PORT=3306;DATABASE=dbName;UID=userName;PASSWORD=xxxxxxxxx;OPTION=3";

OdbcConnection connection = new OdbcConnection(connectString);

try
{
OdbcConnection connection = new
OdbcConnection(connectString);
}
catch (System.Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
Console.WriteLine("ERROR");
}

When I run the program it does NOT go in the catch statement (but goes into the finally). Using a debugger I can see that my connection state is closed the entire time. I installed the ODBC driver and added my database connection (which it succesfully connects to) to the "Data Sources (ODBC)" component of the administrative tools. I named this connection "CSDatabaseServer". So I also tried setting my connectString="DSN=CSDatabaseServer". That did not work either however.

Any help would be appreciated, thanks guys.
AnswerRe: ODBC Problem Pin
Corinna John6-Nov-05 20:34
Corinna John6-Nov-05 20:34 
GeneralRe: ODBC Problem Pin
telconstar997-Nov-05 5:30
telconstar997-Nov-05 5:30 
GeneralRe: ODBC Problem Pin
Corinna John7-Nov-05 5:47
Corinna John7-Nov-05 5:47 
Questionhow to create iso image in c#? Pin
hdv2126-Nov-05 10:34
hdv2126-Nov-05 10:34 
AnswerRe: how to create iso image in c#? Pin
g00fyman6-Nov-05 13:49
g00fyman6-Nov-05 13:49 
GeneralRe: how to create iso image in c#? Pin
lmoelleb6-Nov-05 21:14
lmoelleb6-Nov-05 21:14 
QuestionHelp on file processing Pin
Tugbay Sahin6-Nov-05 9:55
Tugbay Sahin6-Nov-05 9:55 
GeneralRe: Help on file processing Pin
Guffa6-Nov-05 12:34
Guffa6-Nov-05 12:34 
QuestionComboBox - set value Pin
Jens19726-Nov-05 9:31
Jens19726-Nov-05 9:31 
Questionhow to get serial number of cd in c# ? Pin
hdv2126-Nov-05 8:53
hdv2126-Nov-05 8:53 
QuestionProblem in recalling value with array Pin
PearHK6-Nov-05 8:52
PearHK6-Nov-05 8:52 
AnswerRe: Problem in recalling value with array Pin
Christian Graus6-Nov-05 11:58
protectorChristian Graus6-Nov-05 11:58 
QuestionLabel doesn´t show up on form Pin
naglbitur6-Nov-05 8:35
naglbitur6-Nov-05 8:35 
AnswerRe: Label doesn´t show up on form Pin
Christian Graus6-Nov-05 11:59
protectorChristian Graus6-Nov-05 11:59 
QuestionSpeed up? Pin
Lju26-Nov-05 8:05
Lju26-Nov-05 8:05 
QuestionCom+ Problem Pin
webhay6-Nov-05 4:15
webhay6-Nov-05 4:15 
AnswerRe: Com+ Problem Pin
Heath Stewart6-Nov-05 6:21
protectorHeath Stewart6-Nov-05 6:21 
QuestionCom+ Problem Pin
webhay6-Nov-05 4:12
webhay6-Nov-05 4:12 
QuestionCom+ Problem Pin
webhay6-Nov-05 4:12
webhay6-Nov-05 4:12 
QuestionC# TreeView and Outlook Folders Pin
_Goose6-Nov-05 3:57
_Goose6-Nov-05 3:57 
AnswerRe: C# TreeView and Outlook Folders Pin
_Goose6-Nov-05 4:19
_Goose6-Nov-05 4:19 
QuestionTransparent Custom Controls Pin
Johnny Hooyberghs6-Nov-05 2:30
Johnny Hooyberghs6-Nov-05 2:30 
AnswerRe: Transparent Custom Controls Pin
IdUnknown6-Nov-05 3:54
IdUnknown6-Nov-05 3:54 
GeneralRe: Transparent Custom Controls Pin
Johnny Hooyberghs6-Nov-05 4:33
Johnny Hooyberghs6-Nov-05 4:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.