Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

MySqlAdapter & .Net 3.5 (no replies)

$
0
0
My program DataAdapter & Fill are not working, can MySqlDataAdapter be used with framework 3.5? This worked before in framework 2.0, but I don’t appear to be retrieving any data now. Here is the code used. The sql is working as I have used it in MySql workbench and it pulls the data.

string strSQL;

string strWhereAnd;

MySqlCommand objCmd;

MYSQL_DB objMYSQLDB;

MySqlConnection objMySqlConnection = null;

objMYSQLDB = new MYSQL_DB();

objMySqlConnection = objMYSQLDB.GetMySqlConnection();

objCmd = new MySqlCommand();

objCmd.CommandType = System.Data.CommandType.Text;

objCmd.Connection = objMySqlConnection;


System.Data.DataSet ds;

MySqlDataAdapter da;


ds = new System.Data.DataSet();

da = new MySqlDataAdapter(strSQL, objMySqlConnection); //'### Retrieve Data in to DataAdapter ....

objCmd.CommandText = strSQL;

da.SelectCommand = objCmd;

da.Fill(ds, "TBL1");

//### Fill DataSet from DataAdapter ....

return ds;

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>