vb对sql数据库进行修改的代码
2个回答
展开全部
public
bool
Del_delive(int
id)
{
DataSet
ds
=
new
DataSet();
bool
Isadd
=
false;
string
sql
=
"Del_Delivetime";
Conn
con
=
new
Conn();
SqlConnection
conn
=
con.Getcon();
SqlCommand
comm
=
new
SqlCommand(sql,
conn);
comm.CommandType
=
CommandType.StoredProcedure;
comm.Parameters.Add(new
SqlParameter("@id",
SqlDbType.Int,
4));
comm.Parameters["@id"].Value
=
id;
try
{
comm.ExecuteNonQuery();
Isadd
=
true;
}
catch
{
Isadd
=
false;
}
return
Isadd;
}
这个是存储过程。
update
表明
SET
字段名=‘要修改的数值’
where
id=''
bool
Del_delive(int
id)
{
DataSet
ds
=
new
DataSet();
bool
Isadd
=
false;
string
sql
=
"Del_Delivetime";
Conn
con
=
new
Conn();
SqlConnection
conn
=
con.Getcon();
SqlCommand
comm
=
new
SqlCommand(sql,
conn);
comm.CommandType
=
CommandType.StoredProcedure;
comm.Parameters.Add(new
SqlParameter("@id",
SqlDbType.Int,
4));
comm.Parameters["@id"].Value
=
id;
try
{
comm.ExecuteNonQuery();
Isadd
=
true;
}
catch
{
Isadd
=
false;
}
return
Isadd;
}
这个是存储过程。
update
表明
SET
字段名=‘要修改的数值’
where
id=''
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询