473,594 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Form/SQL Table Structure

Hello,

I am building a web form that will be used to gather information for
marketing plans. The form will have 15 questions which must be answered.
Each question can have large blocks of text. The issue is that the user
will go to the web to enter and update their information over time, so all
the questions need to be on one form. I believe the proper structure for
the table would be:

MarketingReques t
----------------
MktRequest_ID
MktQuestion
MktAnswer
However, since this needs to be on a FormView, should I use the following:

MarketingReques t
----------------
MktRequest_ID
MktQuestion01
MktAnswer01
MktQuestion02
MktAnswer02
MktQuestion03
MktAnswer03
....

The database guys said to use the first table structure, but I can't figure
out how to do this and have all the questions on the FormView. Any
assistance with this would be appreciated.

Thanks, sck10
Aug 22 '06 #1
9 1720
if it's only 15 questions and for a long time

if it was me I go for the 2nd one

if you want to add/remove/modify questions over time then you should come up
with the 1st...

[tblQuestions]
idQuestion [numeric, key]
tQuestion [nvarchar(300)]
tActive [bit] - show this question on the board?
tCreateUser [numeric] - id from the user who created the question
tCreateDate [datetime] - date and time for the creaion
tUpdateUser [numeric] - id from the user who updated
tUpdateDate [datetime] - date and time for the update

[tblMarketingReq uest]
idMRequest [numeric, key]
idQuestion [numeric, relationship with [tblQuestions].idQuestion]
tAnswer [text]
tInsertUser [numeric] - id from the user who inserted
tInsertDate [datetime] - date and time for the inserting
to present it in a FormView all you need to do is

"SELECT tQuestion as Question, idQuestion as idQ FROM tblQuestions WHERE
tActive = 1"

when your saving the answers all you need to do is:

"INSERT INTO tblMarketingReq uest (idQuestion, tAnswer, tInsertDate,
tInsertUser)
VALUES ( @idQ, @ans, convert(datetim e, getdate(), 103 ), @idU )"

if you need any more help, fell free to contact me over email

--

Bruno Alexandre
"a Portuguese in København, Danmark"

"sck10" <sc***@online.n ospamescreveu na mensagem
news:OB******** ******@TK2MSFTN GP03.phx.gbl...
Hello,

I am building a web form that will be used to gather information for
marketing plans. The form will have 15 questions which must be answered.
Each question can have large blocks of text. The issue is that the user
will go to the web to enter and update their information over time, so all
the questions need to be on one form. I believe the proper structure for
the table would be:

MarketingReques t
----------------
MktRequest_ID
MktQuestion
MktAnswer
However, since this needs to be on a FormView, should I use the following:

MarketingReques t
----------------
MktRequest_ID
MktQuestion01
MktAnswer01
MktQuestion02
MktAnswer02
MktQuestion03
MktAnswer03
...

The database guys said to use the first table structure, but I can't
figure out how to do this and have all the questions on the FormView. Any
assistance with this would be appreciated.

Thanks, sck10


Aug 22 '06 #2
Hello Steve,

As for database table structure, I also think the first one should be more
reasonable.

In the last message, you said that

=============
However, since this needs to be on a web form, should I use the following:
=============

do you mean you want to display all the questions on the single web page?
If so, there're many means to do this:

1. Use databound template control such as DataList, Repeater to display the
questions through a DataReader or DataSet query from database.

2. Programmtically use code to construct a Table and add rows to display
each questions from Datareader or DataSet

Also, if you're using template databound control(datalis t or repeater), it
also easy to submit the page and query new value in each template control
item and update them into backend database. How do you think of this?

Please feel free to let me know if there is any particular concerns here or
anything else you wonder.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 23 '06 #3
Thanks Bruno
"Bruno Alexandre" <br*********@gm ail.comwrote in message
news:eo******** ******@TK2MSFTN GP06.phx.gbl...
if it's only 15 questions and for a long time

if it was me I go for the 2nd one

if you want to add/remove/modify questions over time then you should come
up with the 1st...

[tblQuestions]
idQuestion [numeric, key]
tQuestion [nvarchar(300)]
tActive [bit] - show this question on the board?
tCreateUser [numeric] - id from the user who created the question
tCreateDate [datetime] - date and time for the creaion
tUpdateUser [numeric] - id from the user who updated
tUpdateDate [datetime] - date and time for the update

[tblMarketingReq uest]
idMRequest [numeric, key]
idQuestion [numeric, relationship with [tblQuestions].idQuestion]
tAnswer [text]
tInsertUser [numeric] - id from the user who inserted
tInsertDate [datetime] - date and time for the inserting
to present it in a FormView all you need to do is

"SELECT tQuestion as Question, idQuestion as idQ FROM tblQuestions WHERE
tActive = 1"

when your saving the answers all you need to do is:

"INSERT INTO tblMarketingReq uest (idQuestion, tAnswer, tInsertDate,
tInsertUser)
VALUES ( @idQ, @ans, convert(datetim e, getdate(), 103 ), @idU )"

if you need any more help, fell free to contact me over email

--

Bruno Alexandre
"a Portuguese in København, Danmark"

"sck10" <sc***@online.n ospamescreveu na mensagem
news:OB******** ******@TK2MSFTN GP03.phx.gbl...
>Hello,

I am building a web form that will be used to gather information for
marketing plans. The form will have 15 questions which must be answered.
Each question can have large blocks of text. The issue is that the user
will go to the web to enter and update their information over time, so
all the questions need to be on one form. I believe the proper structure
for the table would be:

MarketingReque st
----------------
MktRequest_I D
MktQuestion
MktAnswer
However, since this needs to be on a FormView, should I use the
following:

MarketingReque st
----------------
MktRequest_I D
MktQuestion0 1
MktAnswer01
MktQuestion0 2
MktAnswer02
MktQuestion0 3
MktAnswer03
...

The database guys said to use the first table structure, but I can't
figure out how to do this and have all the questions on the FormView.
Any
assistance with this would be appreciated.

Thanks, sck10



Aug 24 '06 #4
Hi Steven,

I Have a couple of question about using the first table structure. The main
issue is that the user needs to be able to update their information over
time.

Lets say I have 3 questions (to make this short) that need to be answered,
each of a different control type:
Question 01: DropDownList
Question 02: MultiLine Text Box
Question 03: RadioButtonList

So the Repeater tool output would look something like this:

1. What Region are you operating in?
DropDownList for regions

2. What is the ops plan and revenue projection for this region?
MultiLine TextBox

3. Is the product available today?
0 yes 0 no

So using the Repeater Tool,
1. How would I call the correct control for the question (DropDownList,
RadioButtonList , TextBox)?
2. How do I name the controls on the fly?
3. How and when would I populate the DropDownList with values from a
stored procedure since I don't know what the DDL name is for binding?
4. When do you do the Binding for DropDownList and RadioButtonList
controls

Anyway, thanks for your help...

MarketingReques t
----------------
MktRequest_ID
MktQuestion
MktAnswer
MarketingReques t
----------------
MktRequest_ID
MktQuestion01
MktAnswer01
MktQuestion02
MktAnswer02
MktQuestion03
MktAnswer03

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:qE******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hello Steve,

As for database table structure, I also think the first one should be more
reasonable.

In the last message, you said that

=============
However, since this needs to be on a web form, should I use the following:
=============

do you mean you want to display all the questions on the single web page?
If so, there're many means to do this:

1. Use databound template control such as DataList, Repeater to display
the
questions through a DataReader or DataSet query from database.

2. Programmtically use code to construct a Table and add rows to display
each questions from Datareader or DataSet

Also, if you're using template databound control(datalis t or repeater), it
also easy to submit the page and query new value in each template control
item and update them into backend database. How do you think of this?

Please feel free to let me know if there is any particular concerns here
or
anything else you wonder.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.


Aug 24 '06 #5
Hi Steve,

Thanks for the followup. If you're using the first table design. Then, we
can consider using a Repeater(or other template databound control) to bind
to a list of all the Main questions(selec t distinct questinoID from the
table). And also prepare a DataTable which queried all the records from the
Question Table.

In the repeater or DataList, we can use its "ItemDataBo und" event to hook
into each items' databinding, and there, we can query the sub
questions(answs ers) according to the main questionID from the DataTable I
mentioned before.

And as for the DropDownList, TextBox or ListBox... You can add an
additional field int the table to tell what type of control should be used
to display the sub questions. And in the "ItemDataBo und" event, we can
construct the certain type of control dynamically and bind data with it.

Currently I haven't the detailed table structure or test data on hande, if
convenient, you can send me a simple database file and how you want to
display it and I can help create a small demo against the things I
mentioned above.

If you still have interests on this idea, please feel free to let me know.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.


Aug 25 '06 #6
Hi Steven,

Below is the code to create a table in SQL Server and populate it with 3
questions and their respective control. What I would like to do is populate
the repeater control with the questions and then generate the control.

Also, I need to be able to:
populate the DropDownList and RadioButtonList
Reference the values with a loop for inserting

If you are updating records, how would you set the DropDownList and
RadioButtonList values to the current values?

Thanks again, sck10
GO
/****** Object: Table [dbo].[MyTies] Script Date: 08/26/2006 21:37:17
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFI ER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[StockPicker](
[StockPicker_ID] [int] IDENTITY(1,1) NOT NULL,
[Question] [varchar](50) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NULL,
[ControlType] [varchar](50) COLLATE SQL_Latin1_Gene ral_CP1_CI_AS NULL,
CONSTRAINT [PK_StockPicker] PRIMARY KEY CLUSTERED
(
[StockPicker_ID] ASC
) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

INSERT INTO StockPicker (Question, ControlType)
VALUES ('Stock Name', 'TextBox')

INSERT INTO StockPicker (Question, ControlType)
VALUES ('Industry Type', 'DropDownList')

INSERT INTO StockPicker (Question, ControlType)
VALUES ('Overvalued', 'RadioButtonLis t')
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:No******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Steve,

Thanks for the followup. If you're using the first table design. Then, we
can consider using a Repeater(or other template databound control) to bind
to a list of all the Main questions(selec t distinct questinoID from the
table). And also prepare a DataTable which queried all the records from
the
Question Table.

In the repeater or DataList, we can use its "ItemDataBo und" event to hook
into each items' databinding, and there, we can query the sub
questions(answs ers) according to the main questionID from the DataTable I
mentioned before.

And as for the DropDownList, TextBox or ListBox... You can add an
additional field int the table to tell what type of control should be used
to display the sub questions. And in the "ItemDataBo und" event, we can
construct the certain type of control dynamically and bind data with it.

Currently I haven't the detailed table structure or test data on hande, if
convenient, you can send me a simple database file and how you want to
display it and I can help create a small demo against the things I
mentioned above.

If you still have interests on this idea, please feel free to let me know.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.



Aug 27 '06 #7
Hi Steve,

After some research against the table data and the requirement here, I
found that it is quite hard to do all the things dynamically, especially
for the different kind of controls. Here you've given me three
ControlTypes, they're TextBox, DropDownList and RadioButtonList , how many
ones will you have in the real project? This will determine whether my
solution here is workable(it won't quite work if there're many different
kinds of controls).

Currently, in template databound control, such as Repeater or DataList... ,
we can dynamically modify and customize some existing controls in the
ItemTemplate during databinding period, however, we can not dynamically
create and add new controls at that time. This is because all the dynamic
controls added in databinding will lost in sequential postback. One way
to resolve this is predefined all the possible controls in the template and
dynamically choose to show and hide the proper one.

Also, for updating, we can loop through all the controls in the template
databound control's item collection and get reference to those sub controls
in each item and pickup the updated value from them. Here is a simple test
page demonstrate the funcionality (use the test database data you provided
in the last message):

==============a spx =============== =========
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:CLRTestDBCon nectionString %>"
SelectCommand=" SELECT [StockPicker_ID], [Question],
[ControlType] FROM [StockPicker]">
</asp:SqlDataSour ce>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="S qlDataSource1" OnItemDataBound ="Repeater1_Ite mDataBound">
<ItemTemplate >
<br /><hr /><br />
<table
style="width:10 0%;border-style:solid;bor der-width:2pt;borde r-color:Black"
cellpadding="0" cellspacing="0" >
<tr>
<td>
Question: <asp:Label ID="lblQuestion " runat="server"
Text='<%# Eval("Question" )%>'></asp:Label><br />
<asp:TextBox ID="txt" runat="server"> </asp:TextBox>
<asp:DropDownLi st ID="lst" runat="server">
</asp:DropDownLis t>
<asp:RadioButto nList ID="rlst" runat="server">
</asp:RadioButton List>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
<br />
<br />
<asp:Button ID="btnUpdate" runat="server" Text="Submit Update"
OnClick="btnUpd ate_Click" /></div>
</form>
</body>
</html>

==========code behind========= ===========
public partial class dataaccess_Repe aterPage : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

}
protected void Repeater1_ItemD ataBound(object sender,
RepeaterItemEve ntArgs e)
{
if (e.Item.ItemTyp e == ListItemType.It em || e.Item.ItemType ==
ListItemType.Al ternatingItem)
{
PlaceHolder holder = e.Item.FindCont rol("phItem") as
PlaceHolder;

string ctype = DataBinder.Eval (e.Item.DataIte m, "ControlTyp e")
as string;
int qid = (int)DataBinder .Eval(e.Item.Da taItem,
"StockPicker_ID ");

Label lbl = e.Item.FindCont rol("lblQuestio n") as Label;
TextBox txt = e.Item.FindCont rol("txt") as TextBox;
DropDownList lst = e.Item.FindCont rol("lst") as DropDownList;
RadioButtonList rlst = e.Item.FindCont rol("rlst") as
RadioButtonList ;
lbl.Attributes["qid"] = qid.ToString();
lbl.Attributes["ctype"] = ctype;

switch (ctype)
{
case "TextBox":

txt.Text = "Questions..... ......";
txt.Visible = true;
lst.Visible = false;
rlst.Visible = false;

break;
case "DropDownLi st":

lst.Items.Add(" item1.......");
lst.Items.Add(" item2.......");
lst.Items.Add(" item3.......");

txt.Visible = false;
lst.Visible = true;
rlst.Visible = false;

break;
case "RadioButtonLis t":

rlst.Items.Add( "item1......... ");
rlst.Items.Add( "item2......... ");
rlst.Items.Add( "item3......... ");

txt.Visible = false;
lst.Visible = false;
rlst.Visible = true;

break;
}
}
}
protected void btnUpdate_Click (object sender, EventArgs e)
{
foreach (RepeaterItem item in Repeater1.Items )
{
if (item.ItemType == ListItemType.It em || item.ItemType ==
ListItemType.Al ternatingItem)
{
Label lbl = item.FindContro l("lblQuestion" ) as Label;

int qid = int.Parse(lbl.A ttributes["qid"]);
string ctype = lbl.Attributes["ctype"];
string newvalue = null;

switch (ctype)
{
case "TextBox":

TextBox txt = item.FindContro l("txt") as TextBox;
newvalue = txt.Text;

break;
case "DropDownLi st":

DropDownList lst = item.FindContro l("lst") as
DropDownList;
newvalue = lst.SelectedVal ue;

break;
case "RadioButtonLis t":

RadioButtonList rlst = item.FindContro l("rlst") as
RadioButtonList ;
newvalue = rlst.SelectedVa lue;

break;
}
Response.Write( "<br/>questionID: "+ qid + ", new value: " +
newvalue);
}
}
}
}
=============== =============== ========
Please feel free to let me know if you have anything unclear or any other
ideas on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 29 '06 #8
Thanks Steven, appreciate the help on this. This should get me started.
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:Ii******** *****@TK2MSFTNG XA01.phx.gbl...
Hi Steve,

After some research against the table data and the requirement here, I
found that it is quite hard to do all the things dynamically, especially
for the different kind of controls. Here you've given me three
ControlTypes, they're TextBox, DropDownList and RadioButtonList , how
many
ones will you have in the real project? This will determine whether my
solution here is workable(it won't quite work if there're many different
kinds of controls).

Currently, in template databound control, such as Repeater or DataList...
,
we can dynamically modify and customize some existing controls in the
ItemTemplate during databinding period, however, we can not dynamically
create and add new controls at that time. This is because all the dynamic
controls added in databinding will lost in sequential postback. One way
to resolve this is predefined all the possible controls in the template
and
dynamically choose to show and hide the proper one.

Also, for updating, we can loop through all the controls in the template
databound control's item collection and get reference to those sub
controls
in each item and pickup the updated value from them. Here is a simple
test
page demonstrate the funcionality (use the test database data you provided
in the last message):

==============a spx =============== =========
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:CLRTestDBCon nectionString %>"
SelectCommand=" SELECT [StockPicker_ID], [Question],
[ControlType] FROM [StockPicker]">
</asp:SqlDataSour ce>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="S qlDataSource1" OnItemDataBound ="Repeater1_Ite mDataBound">
<ItemTemplate >
<br /><hr /><br />
<table
style="width:10 0%;border-style:solid;bor der-width:2pt;borde r-color:Black"
cellpadding="0" cellspacing="0" >
<tr>
<td>
Question: <asp:Label ID="lblQuestion " runat="server"
Text='<%# Eval("Question" )%>'></asp:Label><br />
<asp:TextBox ID="txt" runat="server"> </asp:TextBox>
<asp:DropDownLi st ID="lst" runat="server">
</asp:DropDownLis t>
<asp:RadioButto nList ID="rlst" runat="server">
</asp:RadioButton List>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
<br />
<br />
<asp:Button ID="btnUpdate" runat="server" Text="Submit Update"
OnClick="btnUpd ate_Click" /></div>
</form>
</body>
</html>

==========code behind========= ===========
public partial class dataaccess_Repe aterPage : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

}
protected void Repeater1_ItemD ataBound(object sender,
RepeaterItemEve ntArgs e)
{
if (e.Item.ItemTyp e == ListItemType.It em || e.Item.ItemType ==
ListItemType.Al ternatingItem)
{
PlaceHolder holder = e.Item.FindCont rol("phItem") as
PlaceHolder;

string ctype = DataBinder.Eval (e.Item.DataIte m, "ControlTyp e")
as string;
int qid = (int)DataBinder .Eval(e.Item.Da taItem,
"StockPicker_ID ");

Label lbl = e.Item.FindCont rol("lblQuestio n") as Label;
TextBox txt = e.Item.FindCont rol("txt") as TextBox;
DropDownList lst = e.Item.FindCont rol("lst") as DropDownList;
RadioButtonList rlst = e.Item.FindCont rol("rlst") as
RadioButtonList ;
lbl.Attributes["qid"] = qid.ToString();
lbl.Attributes["ctype"] = ctype;

switch (ctype)
{
case "TextBox":

txt.Text = "Questions..... ......";
txt.Visible = true;
lst.Visible = false;
rlst.Visible = false;

break;
case "DropDownLi st":

lst.Items.Add(" item1.......");
lst.Items.Add(" item2.......");
lst.Items.Add(" item3.......");

txt.Visible = false;
lst.Visible = true;
rlst.Visible = false;

break;
case "RadioButtonLis t":

rlst.Items.Add( "item1......... ");
rlst.Items.Add( "item2......... ");
rlst.Items.Add( "item3......... ");

txt.Visible = false;
lst.Visible = false;
rlst.Visible = true;

break;
}
}
}
protected void btnUpdate_Click (object sender, EventArgs e)
{
foreach (RepeaterItem item in Repeater1.Items )
{
if (item.ItemType == ListItemType.It em || item.ItemType ==
ListItemType.Al ternatingItem)
{
Label lbl = item.FindContro l("lblQuestion" ) as Label;

int qid = int.Parse(lbl.A ttributes["qid"]);
string ctype = lbl.Attributes["ctype"];
string newvalue = null;

switch (ctype)
{
case "TextBox":

TextBox txt = item.FindContro l("txt") as TextBox;
newvalue = txt.Text;

break;
case "DropDownLi st":

DropDownList lst = item.FindContro l("lst") as
DropDownList;
newvalue = lst.SelectedVal ue;

break;
case "RadioButtonLis t":

RadioButtonList rlst = item.FindContro l("rlst") as
RadioButtonList ;
newvalue = rlst.SelectedVa lue;

break;
}
Response.Write( "<br/>questionID: "+ qid + ", new value: " +
newvalue);
}
}
}
}
=============== =============== ========
Please feel free to let me know if you have anything unclear or any other
ideas on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Aug 29 '06 #9
Hi Steve,

I'm glad that the code is of assistance. If you meet any further problem,
please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 30 '06 #10

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

Similar topics

4
9293
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form action="MaintNotification.php?ReqID=5" method="post" name="frm5"> <tr align="left" bgcolor="#dddddd" class="text" onClick="submit()"
5
7396
by: Markus Ernst | last post by:
Hi I have a validation problem with a form and nested divs. I understand what the problem is, but I don't see how to fix it. This is my normal page structure, and it validates: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
8
3064
by: news | last post by:
I seriously doubt this is possible...but you never know, so here goes. Due to bad pre-planning I have a Web page that is VERY table heavy with a very complicated and delicate setup. Any changes to the table structure, as in size changes or additions of new cells, throws the whole thing out of whack. (Let me pause here to say I understand quite well that tables in general are not a good idea anymore. Didn't know that until after I...
2
3543
by: Pete | last post by:
Before I get started with the question, does anyone have a (single) good book recommendation for database design? Not an Access-specific book, but something geared toward helping me figure out *what the user wants*. I've had brief formal education about data flow diagramming, but I'm looking for ... more, now that I'm actually running into problems I think stem from the fact that my users can't explain what they need done, compounded by...
2
8978
by: Almir | last post by:
I have a simple problem, i just can get a grasp on it. I designed a database for inventory of computer equipment. Now i created forms for each table. Each piece of equipment is going to come in an order. ORDERS --> ORDER CONTENTS --> DEVICES --> CPUS --> PRINTERS --> NETWORK HARDWARE You get the picture. I want to make the updating easy. I start from ORDERS table enter all the common information, then ORDER CONTENTS table and get all...
1
4020
by: DataB | last post by:
Hi Everyone! I have, essentially, two table structures in the same ms access database file. Both are of the parent-child format, one parent table with personal details, then multiple child tables keeping specific information, all child tables being linked to the parent in a 1-to-1 relationship on primary key value. I have 2 structures like this. One for "Applicants", one for "Members".
2
4330
by: Mike | last post by:
I'm sure this has been covered before in the newsgroup but have had no luck locating it. I have two tables: InstMonitors & MonModDesc Structure of MonModDesc: Model, Description Structure of InstMonitors: CompName, Make, Model, Description, Serial, PurchDate, WarrExpDate
1
2381
by: Peter | last post by:
Dear all, Could you give me a hint? a) I generate a report from a query table, then I want to use this report to show the total numbers of the customers who buy the goods. There is a string field "choose goods" in the table. Such field only contains either "1" or "". Therefore, I write the IIF function on the report form at the beginning of group row:
10
1444
by: raytackett | last post by:
I need to take information from a table, let's say one field is Agent Name and the other field is Agent e-mail address. I need a combo box with all of the agent names in there, and once I choose a name, the correct e-mail address associated with that name goes into any control that I may have on the form. I was able to write: SELECT DISTINCTROW .,. FROM ; It shows me 2 columns, with the 2nd column bound it will show me both of them,...
10
2868
by: Tom | last post by:
I am looking for some ideas for how to design the layout of the form for data entry and to display the data for the following situation: There are many sales associates. A sales associate can work for multiple companies and work for multiple divisions within each company. Within each division he can work in multiple departments and within each department he can work with multiple groups. In each group he works on multiple projects. All the...
0
7936
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7874
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8227
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6646
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5738
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3853
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.