|
|
|||||||
| Computers & Information Technologies « Everything related to computers and internet. » |
![]() |
|
|
Share | Thread Tools | Search this Thread |
|
|
#1 |
|
Registered Member
Last Online: 06-09-2014
Join Date: Dec 2008
Posts: 68
Thanks: 30
Thanked 9 Times in 5 Posts
Groans: 2
Groaned at 0 Times in 0 Posts
|
hello i am a student in asp.net course and i hav e a homework or competition and i need your help.... i am working on access database that contains : productcode,productname,price,quatity,categoryid(r elated to another table categories) my work is to delete ,update the info of the product when the productcode is selected after i click th button that is a sample:
ID: textbox Name: textbox Price:textbox qtty:textbox categories:dropdownlist related to the database categories when i write a productcode and click on the button delete\update i have to delete\update the info of this product that is the code that i write it and cannot continue it : ProtectedSub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim con As New OleDbConnection() con.ConnectionString ="Provider = Microsoft.Jet.Oledb.4.0;Data Source=C:\Users\NONINO\Documents\Visual Studio 2008\WebSites\homwork 5\App_Data\Company.mdb" con.Open() Dim cmd As New OleDbCommand() cmd.Connection = concmd.CommandText =String.Format("DELETE FROM PRODUCTS product where ProductCode = @productcode values ('{0}') ", tbxProductcode) hope i will get your help as fast as you can and thank you a lot...... |
|
|
|
|
|
#2 |
|
Registered Member
Last Online: 12-11-2011
Join Date: Dec 2006
Posts: 946
Thanks: 388
Thanked 601 Times in 294 Posts
Groans: 4
Groaned at 3 Times in 3 Posts
|
Dim cmd As New OleDbCommand()
Dim con As New OleDbConnection() con.ConnectionString ="Provider = Microsoft.Jet.Oledb.4.0;Data Source=C:\Users\NONINO\Documents\Visual Studio 2008\WebSites\homwork 5\App_Data\Company.mdb" con.open() dim strQuery as string="DELETE FROM PRODUCTS where ProductCode = @productcode values ('{0}') ", tbxProductcode" cmd.Connection=con cmd.CommandText = strQuery cmd.ExecuteNonQuery() |
|
|
|
| The Following User Says Thank You to jak For This Useful Post: | nonino_86 (05-10-2010) |
![]() |
|
| Tags |
| aspnet |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|