All the examples I saw uses the .Fill, I can use it in the components .. true ?
Hope you can help me.
Something like this should work:
public OleDbDataReader GetProductsDetails (int intKatID) {// Build SQL
string sSQL = "";sSQL = "Select *";
sSQL += " from Products";
sSQL += " Where CategoryID = ("+ intKatID +") ";
sSQL += " Order by ModelName";OleDbConnection myConnection = new OleDbConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
OleDbCommand myCommand = new OleDbCommand("sSQL", myConnection);myCommand.Connection = myConnection;
myCommand.CommandText = sSQL;myConnection.Open();
OleDbDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);return result;
}
<code>
public Dataset GetProductsDetails (int intKatID) {
// Build SQL
string sSQL = "";
sSQL = "Select *";
sSQL += " from Products";
sSQL += " Where CategoryID = ("+ intKatID +") ";
sSQL += " Order by ModelName";
OleDbConnection myConnection = new OleDbConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
OleDbCommand myCommand = new OleDbCommand("sSQL", myConnection);
myCommand.Connection = myConnection;
myCommand.CommandText = sSQL;
myConnection.Open();
Dataset myDataset = new Dataset()
OleDbDataAdapter myAdapter = new OleDbDataAdapter(myCommand)
myAdapter.Fill(myDataset)
return myDataset;
}
</code<
0 comments:
Post a Comment