直接在数据集中写插入语句后,怎么使用?

frandomxu 2012-05-31 08:57:42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using userTableAdapters;

public partial class register : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
string users = TextBox1.Text.Trim();
string p1 = TextBox4.Text.Trim();
string pwd = TextBox2.Text.Trim();
userTableAdapter adapter = new userTableAdapter();
user.userDataTable table = adapter.InsertQuery(users,pwd,p1);
Response.Redirect("login.aspx");

}
}

代码如上,在adapter.InsertQuery这行报错,说是后边int类型不能隐式转化为user.userDataTable
好像是我的用法有错误,各位大虾帮忙指点下~ 插入语句已经写好在数据集中了。
...全文
43 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧