|
-
Mar 27th, 2004, 11:22 AM
#1
Thread Starter
Member
Update Database
I am trying to create a feature to update a database. I have already used the INSERT data method to generate the code, but I am having trouble assigning code to a command button to update the database with a record using information supplied in text boxes. I currently have:
Sub cmdAddRecord_Click(sender As Object, e As EventArgs)
addRecord(txtAddDiscID.Text, txtAddArtist.Text, txtAddLabel.Text, txtAddRelease.Text, txtAddURL.Text)
MXdatagrid1.datasource=showdata
MXdatagrid1.databind
End Sub
in runtime it says that showdata is not defined. Can anybody tell me what showdata is referring to?
Many thanks.
-
Mar 28th, 2004, 05:54 PM
#2
Not really! It could be a return value from the addRecord call - if this was addRecord method was coded as a function & returned a datareader or a dataset object for example you could alter the code like this:
showdata = addRecord(txtAddDiscID.Text, txtAddArtist.Text, txtAddLabel.Text, txtAddRelease.Text, txtAddURL.Text)
MXdatagrid1.datasource=showdata
Apart from that I can't think of anything else this could be just from the code you have given. If this was copied from another project which I suspect it was, you could try & see if this showdata is a global (class-level) variable - declared right at the top of the class...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|