Live Chat Icon For mobile
Live Chat Icon

Why do I get the error message ‘The SelectCommand property has not been initialized before calling ‘Fill’. ‘

Platform: ASP.NET| Category: ADO.NET

You have to supply the Sql Statement or Stored Procedure for the DataAdapter as

VB.NET

da.SelectCommand.CommandText  = 'Select * from '

or

da = new SqlDataAdapter ('Select * from ', cn)

C#

da.SelectCommand.CommandText  ='Select * from ';

or

da = new SqlDataAdapter ('Select * from ', cn);

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.