Vcoderz Community
We create websites that have it all, beauty & brains
Lebanon Web Design & Development - Coddict
 

Go Back   Vcoderz Community > Computer Zone > Computers & Information Technologies

Notices

Computers & Information Technologies « Everything related to computers and internet. »

Reply
 
Share Thread Tools Search this Thread
Old 05-06-2010   #1
nonino_86
Registered Member
 
nonino_86's Avatar
 
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
Default 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......







nonino_86 is offline   Reply With Quote
Old 05-07-2010   #2
jak
Registered Member
 
jak's Avatar
 
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
Default

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

jak is offline   Reply With Quote
The Following User Says Thank You to jak For This Useful Post:
nonino_86 (05-10-2010)
Reply

  Vcoderz Community > Computer Zone > Computers & Information Technologies

Tags
aspnet



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:31 AM.


Lebanon web design and development
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Share