Using insertcommand with AccessDataSource in asp.net 2.0

J

jb50c

Hello,

Im new to .net 2.0. I've worked with 1.x for a couple of years now
with a working (not advanced) knowledge of asp.net. I am building a
simple knowledgebase with an interface for people answering questions
to enter their response into an access database from a web form.

What I need help with is this: Can I use the Accessdatasource to
insert form data on a postback?

I like that sqldatasource and accessdatasource cut down on your code,
but they seem to do too much and I can't make heads or tails of them.
I'm not sure what the correct option is to use and whether or not I
should use an ExcecuteNonQuery and where I would put it. I've tried
using the "insertcommand" with the accessdatasource option, but on the
postback (default button click) my form data is not entered into my
access database. I'm used to writing my code in the script header and
am further confused by having to interact almost exclusively with the
inline code generated by Visual Studio Express 2005 Web Edition.

In .net 1.x I would write a simple onClick event that on postback ran a
sql insert command on my access database which I suppose I could still
do, but why would microsoft create the "insertcommand" if it couldn't
be used?

Any help or relatable examples are appreciated.

Thanks,

-JB
 

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