This is because the codes below is initialized with a null object actually.
like this one
SqlDataAdapter yourdataAdapterName = new SqlDataAdapter();
Instead of using that you need to initialize the DataAdapter with a command object like below:
SqlDataAdapter yourdataAdapterName = new SqlDataAdapter("select * from aTable",Conn);
If it is not your solution then show some code.And ask again