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

inserting multiple records.....

I need help PLEASEEEEEEEEEEEEEEE.....

I am trying to create a list of questions that have yes/no answers.
There are 8 groups of questions. Based on who the user is that logs in
will determine what groups of yes/no questions they will get... The way
I was trying to do it, was to store each group of questions as one
record. Then all I had to do is do a query and use a Repeater to show
only the groups that I needed. That part works great.. Now I need to
take the answers to these questions and insert them into a table. Each
answer must be a separate record. I thought about using the
commandbuilder, however, I dont know how to loop through each question.
I am also using plain radio buttons as opposed to asp:radiobuttons. I
am desperate here.. Please help me through this.. If there is a better
way, I would love to hear it... Some sample code would be great too..

thanks...

Nov 19 '05 #1
5 2446
The Controls property is a collection that supports the IEnumerable
interface, you can simple iterate through the collection using a foreach
loop to pick out dynamically created controls. Have a run through the code
to see what your repeater produces as output and go from there.

<script runat="server" language="C#">
void Page_Load(Object sender, EventArgs e)
{
foreach(Control c in Controls)
lblControlList.Text += c.ToString() + " - " + c.ID + "<br>";
}
</script>

<html>
<head>
</head>
<body>
<b>A List of the Controls in the
<code>Controls</code> Collection</b><br>
<asp:label runat="server" id="lblControlList" />
<p>
<form runat="server">
What's your name?
<asp:textbox runat="Server" id="txtName" />
</form>
</body>
</html>


--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Brian" <bc******@pepehazard.com> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
I need help PLEASEEEEEEEEEEEEEEE.....

I am trying to create a list of questions that have yes/no answers.
There are 8 groups of questions. Based on who the user is that logs in
will determine what groups of yes/no questions they will get... The way
I was trying to do it, was to store each group of questions as one
record. Then all I had to do is do a query and use a Repeater to show
only the groups that I needed. That part works great.. Now I need to
take the answers to these questions and insert them into a table. Each
answer must be a separate record. I thought about using the
commandbuilder, however, I dont know how to loop through each question.
I am also using plain radio buttons as opposed to asp:radiobuttons. I
am desperate here.. Please help me through this.. If there is a better
way, I would love to hear it... Some sample code would be great too..

thanks...

Nov 19 '05 #2
Hey John,

Thanks for the response... The radio buttons aren't actually
dynamically generated.. I am just holding the html code for them in a
table, so when it renders on the page, it just looks like a plain form.
I am also using regular radiobuttons.. not asp:radiobuttons, so I
can't use the runat=server attribute..

Here is a snippet of my code..

P.S. I am using VB..

<table width="100%" border="0" cellspacing="0"
cellpadding="0"><ASP:Repeater runat="server"
id="QuestionGrid"><headertemplate><tr><td></td>
</tr></headertemplate>
<ItemTemplate>
<tr>
<td >
<%# DataBinder.Eval(Container.DataItem, "QuestionHTML") %>
<br>
<br>
</td>
</tr></ItemTemplate>
<footertemplate><tr>
<td></td>
</tr></footertemplate>

</ASP:Repeater></table>

Nov 19 '05 #3
then just iterate through the request.form values

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Brian" <bc******@pepehazard.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hey John,

Thanks for the response... The radio buttons aren't actually
dynamically generated.. I am just holding the html code for them in a
table, so when it renders on the page, it just looks like a plain form.
I am also using regular radiobuttons.. not asp:radiobuttons, so I
can't use the runat=server attribute..

Here is a snippet of my code..

P.S. I am using VB..

<table width="100%" border="0" cellspacing="0"
cellpadding="0"><ASP:Repeater runat="server"
id="QuestionGrid"><headertemplate><tr><td></td>
</tr></headertemplate>
<ItemTemplate>
<tr>
<td >
<%# DataBinder.Eval(Container.DataItem, "QuestionHTML") %>
<br>
<br>
</td>
</tr></ItemTemplate>
<footertemplate><tr>
<td></td>
</tr></footertemplate>

</ASP:Repeater></table>

Nov 19 '05 #4
Is it possible to do something like this? "My favorite color is blue
yes / no " with asp:radiobuttons????

Nov 19 '05 #5
Heres a good tutorial on creating a atabound list of asp.net radio controls

http://www.4guysfromrolla.com/webtech/072701-1.shtml

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Brian" <bc******@pepehazard.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Is it possible to do something like this? "My favorite color is blue
yes / no " with asp:radiobuttons????

Nov 19 '05 #6

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

Similar topics

10
by: Roger Withnell | last post by:
I'm using ASP, VBScript and SQL Server. I'm also using UTF-8 character set and so my codepage is 65001 and SQL Server datatype nvarchar. I can insert unicode characters correctly into the...
2
by: kokul_k | last post by:
Hi.. I'm facing a problem during inserting records in Mysql database. My table consists of 9 fields. When i try to insert 1000 records to this table using for loop it takes a lot of time.. nearly...
7
by: ebindia0041 | last post by:
This is like the bug from hell. It is kind of hard to explain, so please bear with me. Background Info: SQL Server 7.0, Asp.net 1.1 with c# I'm inserting simple records into a table. But one...
0
by: t8ntboy | last post by:
ASP/SQL Server Express 05 I have two tables, A and B. I would like to insert multiple records into both form A and B, but a field in form B is the Record ID in form A. So, I need to insert the...
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.