Update an database using ASP .Net

T

Tony A.

I'm developing an app using ASP .Net 3.5 for the frontend and and Access
database for the backend. Using the Query Builder I've developed a command
query that updates fields in a table of the database.

I'd like for users to enter data in a text box on a web page, click the
update button have the command query run. Any suggestion on how this can be
done?
 
M

Miro

Add a dataset to your asp project

In the dataset add tables with table adapters

now in your form add a command button

in your command button do something like this ( written in notepad )



Dim mytableTA As New
datasetnameTableAdapters.TableAdapterfromDataset
Dim ATableName As New datasetname.tableindataset
Dim arowname As datasetname.tableindatasetrow

mytableTA .Fill(ATableName) 'Here .fill is the query name in the
table adapter
arowname = ATableName .Rows(0) 'This will cause an exception if
you returned zero rows

but i am just giving you an example of how to populate the table, with the
tableadapter, and then reference rows.
So you can do a for next loop or something

Hope this gets you started.

Miro
 
C

Cor Ligthert[MVP]

Tony,

This can be done with only a buttonevent, a connectionstring an insert SQL
transactstring and a command which performs an executenonquerry.

But it is a little bit senseless if you don't have a least a primary key and
if it are only inserts and no updates.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top