CJSantora
asked on
MySql.Data.MySqlClient.MySqlException: Table 'someTable' doesn't exist - but it does
Hello,
I have a vb.net program that that wants to query a MySql DB to get information. It seems to connect but I get the error in the title
which says the table does not exist. Any suggestions on why this is happening and how to get around it? Below is the code and error.
Thanks in advance. Joe
Dim oString As String
Dim intNumSpecials As Integer
Dim dsConn As New MySql.Data.MySqlClient.MyS qlConnecti on()
Dim myConnectionString As String
myConnectionString = "server=someserver;uid=som euname;pwd =somepassw d;database =someDB"
dsConn.ConnectionString = myConnectionString
dsConn.Open()
oString = "SELECT count(f1) " _
& "FROM t1" _
& "WHERE f2= " & ID
Dim cmd As MySqlCommand = New MySqlCommand()
cmd.CommandText = oString
cmd.Connection = dsConn
intNumSpecials = cmd.ExecuteScalar()
MySql.Data.MySqlClient.MyS qlExceptio n: Table 'DB.T1' doesn't exist at MySql.Data.MySqlClient.Pac ketReader. CheckForEr ror() at MySql.Data.MySqlClient.Pac ketReader. ReadHeader () at MySql.Data.MySqlClient.Pac ketReader. OpenPacket () at MySql.Data.MySqlClient.Nat iveDriver. ReadResult (Int64& affectedRows, Int64& lastInsertId) at MySql.Data.MySqlClient.Com mandResult .ReadNextR esult(Bool ean isFirst) at MySql.Data.MySqlClient.Com mandResult ..ctor(Dri ver d, Boolean isBinary) at MySql.Data.MySqlClient.Nat iveDriver. SendQuery( Byte[] bytes, Int32 length, Boolean consume) at MySql.Data.MySqlClient.MyS qlCommand. GetNextRes ultSet(MyS qlDataRead er reader) at MySql.Data.MySqlClient.MyS qlDataRead er.NextRes ult() at MySql.Data.MySqlClient.MyS qlCommand. ExecuteRea der(Comman dBehavior behavior) at MySql.Data.MySqlClient.MyS qlCommand. ExecuteRea der() at MySql.Data.MySqlClient.MyS qlCommand. ExecuteSca lar() at Namespace.Class.Function(O bject ID) at Namespace.Class.Bindata(St ring strAddSearch, String strOrderby)
I have a vb.net program that that wants to query a MySql DB to get information. It seems to connect but I get the error in the title
which says the table does not exist. Any suggestions on why this is happening and how to get around it? Below is the code and error.
Thanks in advance. Joe
Dim oString As String
Dim intNumSpecials As Integer
Dim dsConn As New MySql.Data.MySqlClient.MyS
Dim myConnectionString As String
myConnectionString = "server=someserver;uid=som
dsConn.ConnectionString = myConnectionString
dsConn.Open()
oString = "SELECT count(f1) " _
& "FROM t1" _
& "WHERE f2= " & ID
Dim cmd As MySqlCommand = New MySqlCommand()
cmd.CommandText = oString
cmd.Connection = dsConn
intNumSpecials = cmd.ExecuteScalar()
MySql.Data.MySqlClient.MyS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
had only the first letter Capitalized. Thanks for the help.
Joe