1. create command
a. SqlCommand cmd = new SqlCommand()
cmd.Connection = cn; // cn is the instance of SqlConnection
cmd.CommandText = "SQL ... " ;
b. SqlCommand cmd ;
cmd = cn.createCommand() ;
cmd.CommandText = "SQL ..." ;
c. SqlCommand cmd = new SqlCommand( SQL , cn ) ;
2. SqlDataReader reader = cmd.ExecuteReader() ; ( cmd is the instance of SqlCommand class)
reader.read() ;
No comments:
Post a Comment