this kind of SqlParameter is useful when you combine it with DataSet update, if you just want to run straight SQL DELETE, trymyCommand.Parameters.Add(new SqlParameter("@Original_SubId", System.Data.SqlDbType.Int));
myCommand.Parameters["@Original_SubId"].Value = TestNo;//assume TestNo is an int
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
myCommand.Parameters["@Original_SubId"].Value = TestNo;//assume TestNo is an int
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
解决方案 »
- gridview 读数据的问题
- 从数据库取出页面的keyword content description如何在写在页面上?
- 一个SQL语句问题
- 为什么没有输入框呢?
- asp.net查询SQL 一连接就提示 SQL不存在或者拒绝访问!!?????
- HyperLink1的问题!!!!!!!!!!!!!!!!!!!!!
- 各位好汉,如何在asp.net动态网页中加入javascript写的菜单?
- 在动态加入控件的时候,如何调用动态加载的控件的方法
- 问一个oracle的连接问题,这是不是microsoft的bug呢?
- COM+ question
- 怎样通过asp获得 [email protected] 格式的变量?
- 怎样在asp.net中调用win32api 请高手帮忙。。。
SqlCommand myCommand = new SqlCommand(myDeleteQuery,myConnection);
myCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SubId", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "SubId", System.Data.DataRowVersion.Original, null));
myCommand.ExecuteNonQuery();
myConnection.Close();