DataTable table = new DataTable();
table.Columns.Add(new DataColumn("ID", typeof(int)));
table.Columns.Add(new DataColumn("Value", typeof(int)));
table.Rows.Add(new object[] { ID, value });
SqlDatabase database =
(SqlDatabase)DatabaseFactory.CreateDatabase("DatabaseName");
DbCommand dbCommand = database.GetStoredProcCommand("[StoredProcName]");
database.AddInParameter(dbCommand, "@MyTableValueParameter",
SqlDbType.Structured, table);
using (IDataReader reader = database.ExecuteReader(dbCommand))
...
Thursday, March 7, 2013
Passing Table Value Parameters to a stored procedure Enterprise lIbrary
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment