I am trying to populate a MS DataGridView with Stored Procedure using SQLHelper. I am connecting to a FireBird database. I'm also using SQLHelper for FireBird. For all intents and purposes the code is the same for SQL Server.
The DataSource property is set to use the SP and I have changed the ObjectType to int to reflect the ParameterType. When I supply the parameter and PreviewData, the SP executes as expected. However, when I run the program the DataGridView displays with the correct column header text but the data is missing.
Sample code follows:
FbParameter[] rsParms = new FbParameter[3];
// @ID Input Parameter
rsParms[0] = new FbParameter("@ID", FbDbType.Integer, 0);
rsParms[0].Direction = ParameterDirection.Input;
rsParms[0].Value = inComingID; //int value supplied by the user via the form
// @NAME Output Parameter
rsParms[1] = new FbParameter("@NAME", FbDbType.Integer);
rsParms[1].Direction = ParameterDirection.Output;
// @ADDRESS Output Parameter
rsParms[2] = new FbParameter("@ADDRESS", FbDbType.Integer);
rsParms[2].Direction = ParameterDirection.Output;
SqlHelper.ExecuteReader(Properties.Settings.Default.dbConnection, CommandType.StoredProcedure, "SP_CONTACTS",rsParms);
I am clueless. All help greatly appreciated.
From http://www.developmentnow.com/g/7_2005_12_22_0_0/dotnet-framework-adonet.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com