Can anyone help me with this. I have looked at tons of videos but they always do simple and basic stuff so I can never learn how to do it. Does anyone here know of any tutorials (documents, videos...etc.....) or anything like that to help me with this.
Saving the contents of textboxes and dropdowns to an Access Database
If your TextBoxes as well as Dropdownlists are all out of a certain presentation control, you can just find them by referring their name and do directly inserting:
using (OleDbCommand cmd = new OleDbCommand(“insert into xxx (field1,field2,……,fieldN) valeus(@field1,@field2,……,@fieldN”,new OleDbConnection("Your Conn Str")))
{
cmd.Parameters.AddWithValue("@field1",TextBox1.Text);
………………
cmd.Parameters.AddWithValue("@fieldN",Dropdownlist1.SelectedValue);
}
But if you use TextBoxes and Dropdownlists inside some presentation controls such as GridView,you should enable CRUD methods successfully and then make the GridView editable,and then do Updating or Inserting——However GridView isn't supporting inserting directly,
I think you can use GridView's FooterRow——
DanteSinger
Member
2 Points
10 Posts
Saving the contents of textboxes and dropdowns to an Access Database
Jun 30, 2012 05:30 AM|LINK
Can anyone help me with this. I have looked at tons of videos but they always do simple and basic stuff so I can never learn how to do it. Does anyone here know of any tutorials (documents, videos...etc.....) or anything like that to help me with this.
Thanks in advance
Basquiat
Contributor
2386 Points
648 Posts
Re: Saving the contents of textboxes and dropdowns to an Access Database
Jun 30, 2012 05:33 AM|LINK
Use a FormView.
There will be tons of tutorials if you search for asp.net FormView.
Once you've managed that search for ItemTemplates and Dropdownlists in Formviews
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Saving the contents of textboxes and dropdowns to an Access Database
Jul 02, 2012 01:45 AM|LINK
If your TextBoxes as well as Dropdownlists are all out of a certain presentation control, you can just find them by referring their name and do directly inserting:
using (OleDbCommand cmd = new OleDbCommand(“insert into xxx (field1,field2,……,fieldN) valeus(@field1,@field2,……,@fieldN”,new OleDbConnection("Your Conn Str"))) { cmd.Parameters.AddWithValue("@field1",TextBox1.Text); ……………… cmd.Parameters.AddWithValue("@fieldN",Dropdownlist1.SelectedValue); }But if you use TextBoxes and Dropdownlists inside some presentation controls such as GridView,you should enable CRUD methods successfully and then make the GridView editable,and then do Updating or Inserting——However GridView isn't supporting inserting directly, I think you can use GridView's FooterRow——
Sample is here:
http://geekswithblogs.net/casualjim/archive/2006/05/04/77151.aspx
http://www.codeproject.com/Articles/16036/GridView-with-insert-line