S
slinky
On My Webserver I have an Access Database called "Warehouse.mdb"
I have a webform that has:
6 Textboxes named: txtAsset_Number.Text, txtDescription.Text,
txtSerial_Number.Text, txtMfg.Text, txtRDCnumber.Text,
txtAssetType.Text
1 Button named btnAdd
I dragged the Table called Assets onto my design surface (I'm using
Visual Web Developer Express. On another form I was able to drag the
table over and see the data in a gridview - but I want to add data to
the table - but in the fashion of textboxes and a submit button) to
get my datasource available.
What I need to do is take the values in the textboxes and update the
database's table called "Assets".
What I have so far is just this code:
Imports System.Data.OleDb
Partial Class Default5
Inherits System.Web.UI.Page
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
rowNew.Asset_Number = txtAsset_Number.Text
rowNew.Description = txtDescription.Text
rowNew.Serial_Number = txtSerial_Number.Text
rowNew.Mfg = txtMfg.Text
rowNew.RDCnumber = txtRDCnumber.Text
rowNew.AssetType = txtAssetType.Text
End Sub
End Class
So what I have above may not be the best code... for one thing I don't
know what to Dim the rowNew. Plus I need help knowing where to place
the code for the Update, etc.
I've looked in 2 Textbooks that have two different solutions. But I'm
stuck on how to make this work.
Any help would be appreciated. I don't want to have an Editable
Gridview to enter data... I'd like to learn how to do this in a
structured way.
I have a webform that has:
6 Textboxes named: txtAsset_Number.Text, txtDescription.Text,
txtSerial_Number.Text, txtMfg.Text, txtRDCnumber.Text,
txtAssetType.Text
1 Button named btnAdd
I dragged the Table called Assets onto my design surface (I'm using
Visual Web Developer Express. On another form I was able to drag the
table over and see the data in a gridview - but I want to add data to
the table - but in the fashion of textboxes and a submit button) to
get my datasource available.
What I need to do is take the values in the textboxes and update the
database's table called "Assets".
What I have so far is just this code:
Imports System.Data.OleDb
Partial Class Default5
Inherits System.Web.UI.Page
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
rowNew.Asset_Number = txtAsset_Number.Text
rowNew.Description = txtDescription.Text
rowNew.Serial_Number = txtSerial_Number.Text
rowNew.Mfg = txtMfg.Text
rowNew.RDCnumber = txtRDCnumber.Text
rowNew.AssetType = txtAssetType.Text
End Sub
End Class
So what I have above may not be the best code... for one thing I don't
know what to Dim the rowNew. Plus I need help knowing where to place
the code for the Update, etc.
I've looked in 2 Textbooks that have two different solutions. But I'm
stuck on how to make this work.
Any help would be appreciated. I don't want to have an Editable
Gridview to enter data... I'd like to learn how to do this in a
structured way.