I
irabadan
Hello, I'm trying to implement a very easy asp.net page to insert some
data in a database. I'm doing it using as less code as posible so I
used as much data controls as possible. Here is the page schema:
3 Textfields
1 button
1 oleDbConnection
1 oleDbAdapter (link to the connector) with an insert statement.
1 dataSet (generated from the adapter)
Each textbox is bind to the dataset using the DataBindings
properties.
In the button click code behind I have this code:
oleDbConnection1.Open();
dataSet11.AcceptChanges();
oleDbDataAdapter1.Fill(dataSet11,"Usuarios");
oleDbDataAdapter1.Update(dataSet11,"Usuarios");
oleDbConnection1.Close();
I expect the textbox data to be inserted in the database when the code
is executed but there is no item inserted.
If I use: oleDbDataAdapter1.InsertCommand.ExecuteNonQuery(); one row
is inserted in the database but no with the textbox values but with
the default ones.
Any idea what I'm doing wrong?
Thanks
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
data in a database. I'm doing it using as less code as posible so I
used as much data controls as possible. Here is the page schema:
3 Textfields
1 button
1 oleDbConnection
1 oleDbAdapter (link to the connector) with an insert statement.
1 dataSet (generated from the adapter)
Each textbox is bind to the dataset using the DataBindings
properties.
In the button click code behind I have this code:
oleDbConnection1.Open();
dataSet11.AcceptChanges();
oleDbDataAdapter1.Fill(dataSet11,"Usuarios");
oleDbDataAdapter1.Update(dataSet11,"Usuarios");
oleDbConnection1.Close();
I expect the textbox data to be inserted in the database when the code
is executed but there is no item inserted.
If I use: oleDbDataAdapter1.InsertCommand.ExecuteNonQuery(); one row
is inserted in the database but no with the textbox values but with
the default ones.
Any idea what I'm doing wrong?
Thanks
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*