C# .NET - oledbadapter fill method - Asked By dhiraj vernekar on 21-Sep-12 02:12 AM

Hi

 I am fillling datatable using oledbadapter method so if fetched row is empty fill method throws exception:"
Value cannot be null.Parameter name: dataTable"

  below is snippet code:

  
 string Query;

            //Query to select the user from the databasea
            Query = "select IRNO from shipdetails where IRNO='"+IRnum +"'";

            //Assign query to oledb command
            command.CommandText = Query;

            //open the connection to the DB
            connection.Open();

            //Adapter initialization
            Adapter.SelectCommand = command;

            //Fill the datatable 
            Adapter.Fill(ShipDetail);
Hemanth Kumar replied to dhiraj vernekar on 24-Sep-12 06:57 AM
I think you are getting error at this line 
     Adapter.Fill(ShipDetail);

What is ShipDetail?What is the value of "shipdetail" when you put the break point and when you dont have rows I mean No Data ?