Hi,
The "half-baked" code sample below is used to simply insert a data point
into a MySQL table using ADO.Net. This code works fine in a small,
standalone test program (implying that connecting to the MySQL database via
the MySQL ODBC Driver is working)... But when the same code is used in a
real-world prototype, I can not execute or step into this code and instead
get the "No source code available for the current location." dialog box...
It of course compiles OK, and I'm importing the Microsoft.Data.ODBC core
classes... Other details: I'm working in a VB.Net "solution" comprised of
four projects... the prototype is multi-threaded... in the prototype this
source code is called from one of the another VB.Net projects, whereas in
the test program, this code is called directly from within the single test
class... So, I've moved this ADO.Net code into the calling class (so the
below source code is local (and only a few lines away! :)) and still I'm
told the source code is not available... I comment out the three ADO.Net
declarations and the two lines of ADO.Net code and it runs fine...
uncomment those lines, and I hit the "No source code available"
showstopper...
I've tried several ADO.Net methods to insert the data... These include
setting up and (ExecuteNonQuery) executing a Command object, reading the
target table into the DataSet, adding a new row to the DataSet and updating
the DataAdapter... All have worked within my test program, but I always
hit the "No source code available" roadblock with the prototype)
Help! Thanks in advance...
=================================================
Dim oDS As New Data.DataSet()
Dim oCB As OdbcCommandBuilder
Dim sSQL as String
sSQL = "INSERT INTO ... " (blah, blah, blah)
Dim oDA As New OdbcDataAdapter(sSQL, s_ConnectionMySQL)
oCB = New OdbcCommandBuilder(oDA)
oDA.Fill(oDS)
==================================================
(oh, and here is my connection string, which of course let me in OK via my
small test program)
Private s_ConnectionMySQL As String = "Driver={MySQL ODBC 3.51 Driver};" & _
"Server=localhost;" & _
"Port=3306;" & _
"Option=16834;" & _
"User ID=root;" & _
"Password=;" & _
"Database=dv3;"
===================================
This list is hosted by DevelopMentor� http://www.develop.com
You may be interested in Guerrilla .NET, 24 March 2003, in London
http://www.develop.com/courses/gdotnet
View archives and manage your subscription(s) at http://discuss.develop.com