473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

SqlDataSource Insert problem

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
*** Sent via Developersdex http://www.developersdex.com ***
Apr 4 '06 #1
2 3441
Steven,

What do you mean you are calling it manually? How are you making the
call? Are you setting the parameters correctly?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steven Blair" <st**********@btinternet.com> wrote in message
news:u1**************@TK2MSFTNGP14.phx.gbl...
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
*** Sent via Developersdex http://www.developersdex.com ***

Apr 4 '06 #2
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.

*** Sent via Developersdex http://www.developersdex.com ***
Apr 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
3
by: Wayne Wengert | last post by:
Using VSNET2005. I want to insert some rows into a table. Each row has 2 columns, "memberid" which is a GUID and "Interests" which is a varchar. I created a SQLDataSource with the values to insert...
2
by: Ned Balzer | last post by:
I'm trying to create a formview bound to a sqldatasource, and use a stored procedure to insert data from the formview into several tables. I have some simplified code below, the real code is much...
0
by: Steven Blair | last post by:
Hi, Would be grateful if anyone with a high understanding of the SqlDataSource and FormView could have a look at my example and my problems. This has really been puzzling me for some time, and...
2
by: djc | last post by:
1) I am wondering if I should be using an sqlDataSource object for my particular scenario. I need to loop through a listbox and perform an INSERT sql operation for each item. Could be a few or...
2
by: Jason | last post by:
Is there any way to initiate a sqldatasource insert from code in place of the button with commandname=insert or insert? I have a formview with a datasource with an insert command on a button....
1
by: ssims | last post by:
I'm working with ASP.Net on IIS 5.1 and MSSQL 2000 and have a rather frustrating problem. I'm trying to insert a record to a table, get the identity value, and insert two additional records to a...
1
by: David Lozzi | last post by:
Howdy, ASP.Net 2.0 using VB on SQL 2005 This is a two fold issue. I have a DetailsView control which users can insert or edit items. Editing works great. Insert works great however I need...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
0
BeemerBiker
by: BeemerBiker | last post by:
I was wondering if a command like "SqlDataSource1.insert()" can somehow give me the new index that was created when the insert took place. If the insert always occurs at the end of the dataset then...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.