Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The DataAdapter.SelectCommand property needs to be initialized.

What dows this mean?
Posted
Comments
TheRealSteveJudge 9-Feb-15 3:30am    
Can you show us the source code?
Without this it is not possible to see what is wrong.
Tomas Takac 9-Feb-15 3:32am    
Show the relevant code. In short it means you are trying to read data using the data adapter but you didn't specify the respective select command to retrieve the data.

1 solution

This is because the codes below is initialized with a null object actually.
like this one 

C#
SqlDataAdapter yourdataAdapterName = new SqlDataAdapter();

Instead of using that you need to initialize the DataAdapter with a command object like below:


C#
 SqlDataAdapter yourdataAdapterName = new SqlDataAdapter("select * from aTable",Conn);
//Conn is your connection string
//use your select command in the place of "select * from aTable"


If it is not your solution then show some code.And ask again
 
Share this answer
 

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