Click here to Skip to main content
15,908,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Error Message :The SelectCommand property has not been initialized before calling 'Fill'.
Posted
Updated 30-Jan-12 7:22am
v3

There is some mistakes.
If you are using Adapter, then no need to do like

C#
addEmpinfoCommand.ExecuteNonQuery();

Remove the above line.

Now modify the line
C#
da = new FbDataAdapter();

to
C#
da = new FbDataAdapter(addEmpinfoCommand);
 
Share this answer
 
Comments
2011999 30-Jan-12 6:45am    
thank u my problem is solved
My pleasure, anytime......
add
VB
da.SelectCommand = SQLCommandText 

before da.Fill()
 
Share this answer
 
Hi,

Modify your code in the below way without the executequery command.As Tadit said,this is not used along with adapter in the code.

C#
FbDataAdapter da = new FbDataAdapter(query, connection);
fdt = new DataTable();
da.Fill(fdt);


Hope this helps.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900