我用的是Microsoft Visual Studio 2005
新手,发发代码
新手,发发代码
解决方案 »
- c#串口读数据的问题:如何设置每次只读一个字节?
- VS2005两台机子,报异常程度不同
- VS2005 用户控件失色
- 软件的外观或皮肤之类的问题
- 查询中WHERE条件问题,急啊,赶进度!!!!!在线等,解决了立刻结贴!!!高手帮帮忙
- 菜鸟 求助 怎么取得字符串的某一个值(包括最后一个)
- 如何在C#中把Excel文件导入到数据库中产生新的数据表
- 请教关于索引开发得问题,谁遇到过这个问题?
- 请问C#里的VARCHAR的问题?
- 如何封装一个Soap消息包,为什么没有SoapFormatter???
- 部门来了个新手,在执行SQL数据库的时候经常update,delete,有时候执行错了导致灾难性的后果
- .net的一个方法
or
web
的?
{
profileGridView.PageIndex = e.NewPageIndex;
gvBind();
}
protected void profileGridView_RowEditing(object sender, GridViewEditEventArgs e)
{
profileGridView.EditIndex = e.NewEditIndex;
gvBind();
}
protected void profileGridView_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
profileGridView.EditIndex = -1;
gvBind();
} protected void profileGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string destination = ((TextBox)profileGridView.Rows[e.RowIndex].Cells[0].Controls[0]).Text;
string ship = ((TextBox)profileGridView.Rows[e.RowIndex].Cells[1].Controls[0]).Text;
string myStr = 连接语句
string SqlStr = "update 语句
try
{
OleDbConnection conn = new OleDbConnection(myStr); OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
cmd.CommandText = SqlStr;
cmd.CommandType = CommandType.Text;
cmd.CommandTimeout = 10;
if (conn.State == ConnectionState.Closed)
{
conn.Open();
}
int i = cmd.ExecuteNonQuery();
//if (conn.State == ConnectionState.Open)
conn.Close();
profileGridView.EditIndex = -1;
gvBind();
}
catch (Exception ex)
{
Response.Write("数据库错误,错误原因:" + ex.Message);
Response.End();
}
}
protected void profileGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DeleteAdminInfo(itemId);
gvBind();
}
public void DeleteAdminInfo(string itemId)
{
string myStr = 链接字符
OleDbConnection conn = new OleDbConnection(myStr); OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
cmd.CommandText = delete 语句 cmd.CommandType = CommandType.Text;
//添加参数
OleDbParameter id = new OleDbParameter(":profile_id", OleDbType.Char, 36);
id.Value = itemId;
cmd.Parameters.Add(id);
//执行过程
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}
或者发QQ我加下~