![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2004
Posts: 2
Rep Power: 0
![]() |
Good Day everyone.
I am new to C# and i am planning to port my vb.net framework to c#. i have a problem regarding dataadapters. here is the code: public DataSet SelectSet(DataSet data_set, string table_name, string query)
{
OleDbDataAdapter adapter = new OleDbDataAdapter();
try
{
_Command.Connection = _Connection;
_Command.CommandText = query;
adapter.SelectCommand = _Command;
adapter.Fill(data_set,table_name);
}
catch(Exception ex)
{
System.Console.WriteLine(ex.StackTrace);
}
return data_set;
}The code actually works fine however i noticed that an exception is thrown when the result of the query is empty. The line adapter.Fill(data_set,table_name) causes the exception. I actually passed a strongly typed DataSet into this method. I am asking C# experts out there to please help. I'd really appreciate any advice. (I threw you a few CODE tags, SykkN) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|