Vcoderz Community

Vcoderz Community (http://forum.vcoderz.com/index.php)
-   Computers & Information Technologies (http://forum.vcoderz.com/forumdisplay.php?f=6)
-   -   asp.net help (http://forum.vcoderz.com/showthread.php?t=18202)

nonino_86 05-06-2010 02:31 PM

asp.net help
 
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......






jak 05-07-2010 02:16 PM

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()



All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger