Mario Cuervo

Mario Cuervo

  • NA
  • 26
  • 7k

The Fill method of a TableAdapter is not working properly.

Sep 23 2014 2:41 PM
I'm currently working in a VS 10, c#, SQL Server 2008 environment. I'm getting  an "Object reference not set to an instance of an object" error every time I try to make a second call to a TableAdapter.Fill method. The first call always does the work fine, it is when you try to call  it more than once that you will get that error.
The actual call is: getLoanToValueDetailforTableAdapter.Fill(this.lTVDS.GetLoanToValueDetailfor, MiYearMonth); Where lTVDS is the datasource and  GetLoanToValueDetailfor if a stored procedure that takes one parameter: string  MiYearMonth. The ClearBeforeFill parameter of the TableAdapter is set to true, however it bounces back as if a new instance of the dataTable generated should be created. Any idea why this is happening and how to fix it?