Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!
I made connect to sql server and now try get all notes of table and after getting send object result direct to datagridview. Thence there is question: what type returns query ADO?
I use the next method:

C#
public static Get()
      {
      SqlCeCommand command = new SqlCeCommand("SELECT * FROM Students");
      return rdr = cmd.ExecuteReader();

      }

But i dont know what return type specify for function Get(). This must return result that be added to Grid (I use N-tires structure).
Sorry for question
Posted

It is easy to find out: look on MSDN for SqlCeCommand.ExecuteReader[^] and it will tell you: SqlCeDataReader[^]
 
Share this answer
 
Comments
[no name] 22-Apr-13 11:17am    
So, what i must specify type?
[no name] 22-Apr-13 11:26am    
ExecuteReader Returns a DataReader object.
StianSandberg 22-Apr-13 17:24pm    
No, a SqlCeDataReader which inherit from DbDataReader
StianSandberg 22-Apr-13 17:25pm    
Correct. 5'd
it will return SqlDataReader object
 
Share this answer
 
Comments
OriginalGriff 22-Apr-13 11:13am    
Um. Are you sure?
An SqlCeCommand.ExecuteReader does not return a SqlDataReader - it returns a SqlCeDataReader instead.
StianSandberg 22-Apr-13 17:25pm    
OriginalGriff is right.

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