Click here to Skip to main content
16,016,580 members

Comments by kid218 (Top 3 by date)

kid218 19-Nov-10 4:48am View    
Thank you for your help :)
kid218 15-Oct-10 6:15am View    
While the app is running, you don't know codeOfClass which I will choose, there are a lot of codeofclass in your table.
kid218 15-Oct-10 5:32am View    
myConnect.open();
string myStringCommand = "SELECT ordinal, codeOfStu, fullName, ST.codeOfClass, CL.nameOfClass FROM Student ST, Class CL WHERE ST.codeOfClass = CL.codeOfClass AND ST.codeOfClass = @SelectedCodeOfClass";
OleDbCommand command = new OleDbCommand(myStringCommand, myConnect);
OleDbParameter myParameter = new OleDbParameter("@SelectedCodeOfClass", OleDbType.Integer);
myParameter.Value = SelectedCodeOfClass; // SelectedCodeOfClass is a parameter which is carried from main function.
myCommand.Parameters.Add(myParameter);
OleDbDataReader myReader = myCommand.ExecuteReader();
.
.
.

Now, I want not use "connect model" to access database anymore. I want use "disconnect model" to do that.
If I do like this:
OleDbDataAdapter adap=new OleDbDataAdapter("select * from tablename",con);
Dataset ds=new Dataset();
adap.fill(ds);

The Thing I receive is a datatable involve in all of the students. I don't want read all of the Student 's Information in database. I only want read students' Information according to class (codeOfClass) that they belong to