|
我知道可以动态修改存储过程,但不知道如何动态建立一个存储过程?
大家有做过吗?
先把修改存储过程的代码帖出如下:
string cStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + Server.MapPath(DBPath);
string ProcName;
ADODB.Connection cn = new ADODB.Connection();
cn.Open(cStr, null, null, -1);
//激活并修改
ADOX.Catalog catalog = new ADOX.Catalog();
catalog.ActiveConnection = cn;
ADODB.Command cmd = new ADODB.Command();
cmd.CommandText = "PARAMETERS UserID varchar;select * from guestbook where username=UserID;";
ADOX.Procedure pro = catalog.Procedures[ProcName];
pro.Command = cmd;
|
|