access to mysql over csharp

D

Dennis Kuntzemann

Hello,

I am trying to get access to an MySql-Server over CSharp. As I am not sure
whether it is an csharp or sql driver problem, i am posting it here.

I got the following error:

PM Exception: Object reference not set to an instance of an object.
6/27/2006 12:23:25 PM Stack trace:
at MySql.Data.MySqlClient.PacketWriter.WriteStringNoNull(String v)
at MySql.Data.MySqlClient.MySqlCommand.PrepareSqlBuffers(String sql)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior
behavior)
at
MySql.Data.MySqlClient.MySqlCommand.System.Data.IDbCommand.ExecuteReader(Com
mandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
at Fact.TestConnect.connect2DB() in
c:\Inetpub\wwwroot\Fact\TestConnect.cs:line 114
Cycle finished


while I am executing the following code:


DataSet milestones = new DataSet();

foreach(string sl in serviceLevelList) {
Console.WriteLine(sl);
MySqlDataAdapter adapter = new MySqlDataAdapter(
"SELECT From Table ", dest.Connection);
adapter.Fill(milestones, sl); <- here is where the error
occurs!!!
}


Has anybody an idea how to solve the problem?

thank u very much in advance!

best regards,

dennis
 
C

chanmm

I think adapter.Fill method normally is String as the second parameter.
Maybe take a look.

chanmm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top