SqlDataSource Insert problem

  • Thread starter Thread starter Steven Blair
  • Start date Start date
S

Steven Blair

When I hit a button inside my FormView which has Insert as its Command
Name, my Insert statement is executed with the correct parameters (the
events Inserting & Inserted are fired).

But I need the Insert to be fired at the end of my wizard, so attempted
to call .Insert() manually. When I do this, all my paramters are null

Anyone know what I am doing wrong? Is there is some other step required
to populate the parameters which is missed out by directly calling
.Insert()?

Thanks in advance.

Steven
 
Steven,

What do you mean you are calling it manually? How are you making the
call? Are you setting the parameters correctly?
 
Thanks for the reply.

My Wizard has 3 steps. Each step has a FormView with its own
SqlDataSource.
I need to save all the details at the end of the wizard, so on the
Finish event of the Wizard I do this:

mySqlDataSource1.Insert();
mySqlDataSource2.Insert();
mySqlDataSource3.Insert();

The parameters ar always null when I run this.

However, if I place a button on each step and add Insert to the Command
Name, the parameters are populated.

It seems to be that an additional step is called when a Command Name is
used in a button.
 

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

Back
Top