Monday, March 12, 2012

Help (require code)

right im programming a database program and i need some code. (the database is in sql/msde)
This is what i am attempting to do:
I have a page with textboxes on it with buttons at the bottom
i need to program the database with the add function

this is the code that i have already
Imports system.data.sqlclient

'You need two objects

Dim conn as new sqlconnection
dim comm as new sqlcommand

conn.connectionstring = "Your UDL String here"
comm.text = "insert into books (isbn, title, author, publisher, description, price,)
'books is the name of the databse
values ( '1234' , 'Title', 'Author', 'Publisher' )
conn.open
comm.connection = conn
comm.executenonquery
comm.close
conn.close

now i think i need to insert this at the top of the page but im not 100% sure (btw i have the udl string)

so what do i need to add to this code to make the page submit data that has been enterd into textboxes into a database table(sql/msde) on the click of the button?

thanks for any help providedI think you need to read some very simple getting started tutorials. What you've asked is very, very easy and to be honest shows that you've not really got any kinda' grip on this stuff. The totorials on this forum should sort you out - it'll take you 30mins to learn this, honest. Sorry if this sounds a bit cruel by you'll get no where fast by cribbing blocks of code without understand it.

No comments:

Post a Comment