473,394 Members | 1,932 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,394 software developers and data experts.

Wizards - 2 way data binding not possible?

Hi,

A bit long winded this one, but would be grateful for some help.

I have a problem using the Wizard component and can think of only two
ways of completing the task.
Can anyone with some Wizard experience have a read of my two methods and
let me know if there are alternatives?

1. Each step of the wizard has each component (Textboxes etc) dropped
on. This means I cannot use data binding and
have to write a lot of code, both for adding then saving the details.

2. I use FormViews & SqlDataSoruce on each Wizard step, allowing 2 way
data binding,
but the Next button needs to have a Command Name of Insert.
On the Inserting method I capture the newly created Command object and
hold it in the Session.
The Next button has an On_Click event to
increment the Wizard step. This is repeated for each step and at the
Finish step I use the stored Command objects wrapped around a
transaction
to verify all Inserts were successfull.

So, pass in the 3 Command objects (my wizard has 3 steps)

public bool Insert(SqlCommand cmd1, SqlCommand cmd2, SqlCommand cmd3)
{
SqlCommand masterCmd = new SqlCommand();

//Open connection etc
//Start a transaction using masterCmd

masterCmd.CommandText = cmd1.CommandText;
masterCmd.CommandParameters = cm1.CommandParamters; //Might not be
as easy this.

masterCmd.ExecuteNonQuery();
masterCmd.Paramters.Clear(); //We need to add new params

//repeat this process for cmd2 & cmd3

//Rollback or Commit
}

Ideally I would have preferred calling Insert() directly from my
webpage, but this does not seem to work.
The parameters are always null.
If someone could spare 5 minutes and add a FormView with a SqlDataSource
and attempt to Invoke the Insert manually
(ie dont have an insert button on the FormView with a Command Name
Insert). Just add a normal button and make a
call to the SqlDataSources Insert method.

Can anyone help?

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Apr 5 '06 #1
0 1191

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

Similar topics

0
by: Cees Wesseling | last post by:
For a couple of years I am using now my own data binding tool that can create C++ classes from a DTD. At this moment I need to reconsider this tool since I want to use W3C XML Schemas and need to...
5
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
1
by: matty.hall | last post by:
There's a lot of information out there about data-binding UI objects (i.e. derived from Control) to non-UI custom business objects. Is it possible to do the same without any UI being involved at...
6
by: Brad | last post by:
I have a web service which returns a collection of class object (see below). I want to consume this service in another web application by binding it to a List control The data returns from the...
9
by: Timm | last post by:
I have an ASP.NET 2.0 page with two DropDownLists. I am using declarative data binding wherever possible and trying to minimize the use of code. The list of values in DropDownList DDL2 should be...
0
by: Larry Serflaten | last post by:
I am not sure how many are aware of this sort of data binding, but as it is new to many (classic) VB developers I thought I would post this once just to let people know of its availablility. ...
0
by: EricLondaits | last post by:
Hi, I have an ASP.NET page with a ListBox that is data bound to a table with a single field (it holds a list of valid IDs). The page also has a textBox into which you can add new valid IDs, one...
0
by: =?Utf-8?B?Q3JhaWdo?= | last post by:
Background: I am currently using WCF for remoting (using CSLA hosted in IIS) with a binding config entry like this: <binding name ="default" transferMode="Buffered" messageEncoding="Text"...
0
MrMancunian
by: MrMancunian | last post by:
How to create a database connection without using wizards Introduction I've seen a lot of questions on the net about getting data from, and saving data to databases. Here's a little insight how...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.