Ahh, sorry, I gave you a 1.1 example:
Here is 2.0
private Microsoft.Practices.EnterpriseLibrary.Data.Databas e
GetDatabase()
{
// Create the Database object, using the default database
service. The
// default database service is determined through configuration.
Database db = DatabaseFactory.CreateDatabase();
return db;
}
private void UpdateEmployeeData(int empid )
{
Database db = this.GetDatabase();
DbCommand dbc = db.GetStoredProcCommand("dbo.uspSomeProcedure);
db.AddInParameter(dbc , "@EmpID", DbType.Int32, empid);
db.AddOutParameter(dbc , "@numberRowsAffected", DbType.Int32,
0);
db.ExecuteNonQuery(dbc )
}
"sloan" <sl***@ipass.netwrote in message
news:ep**************@TK2MSFTNGP03.phx.gbl...
>
From memory:
Dim dbCommandWrapper As DatabaseCommandWrapper =
db.GetStoredProcCommandWrapper("dbo.uspSomeProcedu re")
dbCommandWrapper.AddInParameter("@EmpID", DbType.Int,
12345 )
' Output parameters specify the size of the return data
'dbCommandWrapper.AddOutParameter("@numberRowsAffe cted",
DbType.Int32, 0)
Dim rowsAffected As Int32
rowsAffected = db.ExecuteNonQuery(dbCommand)
' there are diffferent methods. ExcecuteReader, LoadDataSet.. you have to
match yours to what you want it to do