|
|
|
error ดูโค้ดให้หน่อยนะคับ insert ข้อมูลลง access ไม่ได้ |
|
|
|
|
|
|
|
Code (C#)
private OleDbConnection cn()
{
OleDbConnection con = new OleDbConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["access1"].ConnectionString;
return con;
}
protected void Button1_Click(object sender, EventArgs e)
{
sql = "INSERT INTO register (userid,password,name,age)" + "VALUES" + " ('" +
this.TextBox1.Text + "','" + this.TextBox2.Text + "','" + this.TextBox3.Text + "','" + this.TextBox4.Text + "',')";
OleDbDataAdapter da = new OleDbDataAdapter(sql, cn());
da.Update(ds, "register");
}
Tag : .NET, Ms Access, Web (ASP.NET), VS 2010 (.NET 4.x)
|
|
|
|
|
|
Date :
2012-10-03 22:26:34 |
By :
aaaa_aas |
View :
997 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
พี่วินคับ มันยังไม่ได้คับรบกวนอีกที
|
|
|
|
|
Date :
2012-10-04 14:29:55 |
By :
aaaa_aas |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
da.Update(ds, "register");
เปลี่ยนตรงนี้
da.Update(ds, "sql");
|
|
|
|
|
Date :
2012-10-04 15:42:08 |
By :
SeedNew |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|