oledbadapter fill method RRS feed

  • Question

  • Hi

     I am filling datatable using oledbadapter method, so if fetched data 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 database
                Query = "select IRNO from shipdetails where IRNO='"+IRnum +"'";
                //Assign query to oledb command
                command.CommandText = Query;
                //open the connection to the DB
                //Adapter initialization
                Adapter.SelectCommand = command;
                //Fill the datatable 
    • Moved by Mike Dos Zhang Monday, September 24, 2012 4:53 AM DataAdapter (From:General Windows Desktop Development Issues)
    Friday, September 21, 2012 9:51 AM


  • Can you share your code related ShipDetail.

    Seems ShipDetail which is a Datatable and this instance is not initilized.

    Lingaraj Mishra

    Monday, September 24, 2012 8:58 AM

All replies