Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 30th, 2011, 12:48 PM
Authorized User
Points: 313, Level: 6
Points: 313, Level: 6 Points: 313, Level: 6 Points: 313, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 74
Thanks: 21
Thanked 2 Times in 2 Posts
Default Multiple Choice Online Exam

I'm working through the book and so far I'm up to Chapter 13.
Thought I would attempt some original code and having difficulties inserting data into a table via an online exam....

Below is the *.aspx code from a Form with the first question only of a multiple choice online exam which has 16 multiple choice radio button (A,B, C, D) questions along with a comment. All of the 15 remaining questions are code structured the same.

At the very bottom of this page is a submit button, which first validates all questions have been answered. If any questions are not answered the user gets a prompt to answer the missed question(s). If validation passes, the user is sent to another page where all the questions with his/her selected answers are displayed along with any comments.

What is missing is all the CRUD (Create, Read, Update, Insert), especially Insert, since my primary objective is to just insert all the selected answers. I have a database table and it's available in Visual Studio 2010's Server Explorer, but so far I'm at a loss for inserting data into the database table. While it's relatively easy to click an drag GirdView and/or ListView to validate database interactivity, how is this done without them?

I need help with the code (examples?) for inserting all the radio button selections into my database table.
Any help would be greatly appreciated.

Here is the code for just the first multiple choice question...

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Week1Exam.aspx.cs" Inherits="WeekExams_WeekI_Week1Exam" %>

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Online Exam</title>

  <link href="../../Style/Style2.css" rel="stylesheet" type="text/css" />


    <style type="text/css">
      .style2
      {
        width: 1021px;
     
      </style>


</head>
<body>

 <form id="form1" runat="server">
  
   
 <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
   AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" 
   DataSourceID="SqlDataSource1">
   <Columns>
     <asp:CommandField ShowSelectButton="True" />
     <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
       ReadOnly="True" SortExpression="Id" />
     <asp:BoundField DataField="ResidentName" HeaderText="ResidentName" 
       SortExpression="ResidentName" />
     <asp:BoundField DataField="Q1" HeaderText="Q1" SortExpression="Q1" />
     <asp:BoundField DataField="Q2" HeaderText="Q2" SortExpression="Q2" />
     <asp:BoundField DataField="Q3" HeaderText="Q3" SortExpression="Q3" />
     <asp:BoundField DataField="Q4" HeaderText="Q4" SortExpression="Q4" />
     <asp:BoundField DataField="Q5" HeaderText="Q5" SortExpression="Q5" />
     <asp:BoundField DataField="Q6" HeaderText="Q6" SortExpression="Q6" />
     <asp:BoundField DataField="Q7" HeaderText="Q7" SortExpression="Q7" />
     <asp:BoundField DataField="Q8" HeaderText="Q8" SortExpression="Q8" />
     <asp:BoundField DataField="Q9" HeaderText="Q9" SortExpression="Q9" />
     <asp:BoundField DataField="Q10" HeaderText="Q10" SortExpression="Q10" />
     <asp:BoundField DataField="Q11" HeaderText="Q11" SortExpression="Q11" />
     <asp:BoundField DataField="Q12" HeaderText="Q12" SortExpression="Q12" />
     <asp:BoundField DataField="Q13" HeaderText="Q13" SortExpression="Q13" />
     <asp:BoundField DataField="Q14" HeaderText="Q14" SortExpression="Q14" />
     <asp:BoundField DataField="Q15" HeaderText="Q15" SortExpression="Q15" />
     <asp:BoundField DataField="Q16" HeaderText="Q16" SortExpression="Q16" />
     <asp:BoundField DataField="CreateDateTime" HeaderText="CreateDateTime" 
       SortExpression="CreateDateTime" />
   </Columns>
 </asp:GridView>
 
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
   ConnectionString="<%$ ConnectionStrings:CCSExamsConnectionString1 %>" 
   SelectCommand="SELECT [Id], [ResidentName], [Q1], [Q2], [Q3], [Q4], [Q5], [Q6], [Q7], [Q8], [Q9], [Q10], [Q11], [Q12], [Q13], [Q14], [Q15], [Q16], [CreateDateTime] FROM [Week1]"
   InsertCommand="INSERT INTO [Week1] ([ResidentName], [Q1], [Q2], [Q3], [Q4], [Q5], [Q6], [Q7], [Q8], [Q9], [Q10], [Q11], [Q12], [Q13], [Q14], [Q15], [Q16], [CreateDateTime]) VALUES (@ResidentName, @Q1, @Q2, @Q3, @Q4, @Q5, @Q6, @Q7, @Q8, @Q9, @Q10, @Q11, @Q12, @Q13, @Q14, @Q15, @Q16, @CreateDateTime)" 
   DeleteCommand="DELETE FROM [Week1] WHERE [Id] = @Id" 
   UpdateCommand="UPDATE [Week1] SET [ResidentName] = @ResidentName, [Q1] = @Q1, [Q2] = @Q2, [Q3] = @Q3, [Q4] = @Q4, [Q5] = @Q5, [Q6] = @Q6, [Q7] = @Q7, [Q8] = @Q8, [Q9] = @Q9, [Q10] = @Q10, [Q11] = @Q11, [Q12] = @Q12, [Q13] = @Q13, [Q14] = @Q14, [Q15] = @Q15, [Q16] = @Q16, [CreateDateTime] = @CreateDateTime WHERE [Id] = @Id">
   <DeleteParameters>
     <asp:Parameter Name="Id" Type="Int32" />
   </DeleteParameters>
   <InsertParameters>
     <asp:Parameter Name="ResidentName" Type="String" />
     <asp:Parameter Name="Q1" Type="String" />
     <asp:Parameter Name="Q2" Type="String" />
     <asp:Parameter Name="Q3" Type="String" />
     <asp:Parameter Name="Q4" Type="String" />
     <asp:Parameter Name="Q5" Type="String" />
     <asp:Parameter Name="Q6" Type="String" />
     <asp:Parameter Name="Q7" Type="String" />
     <asp:Parameter Name="Q8" Type="String" />
     <asp:Parameter Name="Q9" Type="String" />
     <asp:Parameter Name="Q10" Type="String" />
     <asp:Parameter Name="Q11" Type="String" />
     <asp:Parameter Name="Q12" Type="String" />
     <asp:Parameter Name="Q13" Type="String" />
     <asp:Parameter Name="Q14" Type="String" />
     <asp:Parameter Name="Q15" Type="String" />
     <asp:Parameter Name="Q16" Type="String" />
     <asp:Parameter Name="CreateDateTime" Type="DateTime" />
   </InsertParameters>
   <UpdateParameters>
     <asp:Parameter Name="ResidentName" Type="String" />
     <asp:Parameter Name="Q1" Type="String" />
     <asp:Parameter Name="Q2" Type="String" />
     <asp:Parameter Name="Q3" Type="String" />
     <asp:Parameter Name="Q4" Type="String" />
     <asp:Parameter Name="Q5" Type="String" />
     <asp:Parameter Name="Q6" Type="String" />
     <asp:Parameter Name="Q7" Type="String" />
     <asp:Parameter Name="Q8" Type="String" />
     <asp:Parameter Name="Q9" Type="String" />
     <asp:Parameter Name="Q10" Type="String" />
     <asp:Parameter Name="Q11" Type="String" />
     <asp:Parameter Name="Q12" Type="String" />
     <asp:Parameter Name="Q13" Type="String" />
     <asp:Parameter Name="Q14" Type="String" />
     <asp:Parameter Name="Q15" Type="String" />
     <asp:Parameter Name="Q16" Type="String" />
     <asp:Parameter Name="CreateDateTime" Type="DateTime" />
     <asp:Parameter Name="Id" Type="Int32" />
   </UpdateParameters>
</asp:SqlDataSource>


 <div align="center">
<table width="650" cellspacing="0" cellpadding="0" border="0" height="107">
<tr> 
<td align="left" valign="top" > 
<font face="Arial" size="2">    

	 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Week I Exam</title>



 
<p><font face="Arial" size="+2" color="#00458a"><strong>Week I</font>
<br><font face="Arial" size="2" color="#00458a"> 
<br>Online Exam  	 
 </strong>
 </font>
<br> 
 <br>
 
 
 <table  width="650" cellpadding="5">


<tr>
<td valign="top" align="left" bgcolor="#00458a" colspan="2">
<font face="arial" color="white" size="2" >
<p><strong><font face="Arial" size="3">Question 1</font></strong>
<p>Question one context is located here. 
<p><strong>Based on these findings, what would you do next?</strong>
</td>
</tr>
<tr>
<td bgcolor="#d7ebff" align="left" class="style2">
<font face="arial" size="2">
A. Question A Answer
</td>
<td rowspan="4" bgcolor="#00458a" align="left">
<font face="arial" size="2" color="#ffffff">
<asp:RadioButtonList ID="Q1" runat="server" Font-Bold="True" 
    Font-Names="Arial" Font-Size="10pt" 
    ForeColor="White" ViewStateMode="Enabled">
     <asp:ListItem Value="A: A Answert">A</asp:ListItem>
     <asp:ListItem Value="B: B Answer.">B</asp:ListItem>
     <asp:ListItem Value="C: C Answer.">C</asp:ListItem>
     <asp:ListItem Value="D: D Answer">D</asp:ListItem>
     </asp:RadioButtonList>    
          </td>
</tr>
<tr>
<td bgcolor="#77bbff"align="left" class="style2">
<font face="arial" size="2">
B. Question B Answer.
</td>
</tr>
<tr>
<td bgcolor="#d7ebff" align="left" class="style2">
<font face="arial" size="2">
C. Question C Answer
</td>
</tr>
<tr>
<td bgcolor="#77bbff"align="left" class="style2">
<font face="arial" size="2">
D. Question D Answer.
</font>
</td>
</tr>
<tr>
<td bgcolor="#00458a" valign="top" align="left" colspan="2">
<font face="Arial" color="white" size="2"><strong>
Comments:</strong>
<br>
<asp:TextBox ID="Q1Comments" runat="server" Height="49px" Width="657px" 
    ontextchanged="Q1Comments_TextChanged" TextMode="MultiLine"></asp:TextBox>
</font>
</td>
</tr>

Last edited by jpjamie; November 30th, 2011 at 05:19 PM.. Reason: Addded [code][/code] tags
Reply With Quote
  #2 (permalink)  
Old December 1st, 2011, 10:16 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Try posting this in a more general ASP.NET cateogry (http://p2p.wrox.com/asp-net-asp-12/) as you'll attract more viewers...

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old December 1st, 2011, 11:00 AM
Authorized User
Points: 313, Level: 6
Points: 313, Level: 6 Points: 313, Level: 6 Points: 313, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 74
Thanks: 21
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi there,

Try posting this in a more general ASP.NET cateogry (http://p2p.wrox.com/asp-net-asp-12/) as you'll attract more viewers...

Cheers,

Imar
Thanks! I just clicked on the link you provided and "damolekunfemi" is working on the same kind of quiz!
Reply With Quote
  #4 (permalink)  
Old December 4th, 2011, 08:42 PM
Authorized User
Points: 313, Level: 6
Points: 313, Level: 6 Points: 313, Level: 6 Points: 313, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 74
Thanks: 21
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by jpjamie View Post
I'm working through the book and so far I'm up to Chapter 13.
Thought I would attempt some original code and having difficulties inserting data into a table via an online exam....

Below is the *.aspx code from a Form with the first question only of a multiple choice online exam which has 16 multiple choice radio button (A,B, C, D) questions along with a comment. All of the 15 remaining questions are code structured the same.

At the very bottom of this page is a submit button, which first validates all questions have been answered. If any questions are not answered the user gets a prompt to answer the missed question(s). If validation passes, the user is sent to another page where all the questions with his/her selected answers are displayed along with any comments.

What is missing is all the CRUD (Create, Read, Update, Insert), especially Insert, since my primary objective is to just insert all the selected answers. I have a database table and it's available in Visual Studio 2010's Server Explorer, but so far I'm at a loss for inserting data into the database table. While it's relatively easy to click an drag GirdView and/or ListView to validate database interactivity, how is this done without them?

I need help with the code (examples?) for inserting all the radio button selections into my database table.
Any help would be greatly appreciated.

Here is the code for just the first multiple choice question...

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Week1Exam.aspx.cs" Inherits="WeekExams_WeekI_Week1Exam" %>

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Online Exam</title>

  <link href="../../Style/Style2.css" rel="stylesheet" type="text/css" />


    <style type="text/css">
      .style2
      {
        width: 1021px;
     
      </style>


</head>
<body>

 <form id="form1" runat="server">
  
   
 <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
   AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" 
   DataSourceID="SqlDataSource1">
   <Columns>
     <asp:CommandField ShowSelectButton="True" />
     <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
       ReadOnly="True" SortExpression="Id" />
     <asp:BoundField DataField="ResidentName" HeaderText="ResidentName" 
       SortExpression="ResidentName" />
     <asp:BoundField DataField="Q1" HeaderText="Q1" SortExpression="Q1" />
     <asp:BoundField DataField="Q2" HeaderText="Q2" SortExpression="Q2" />
     <asp:BoundField DataField="Q3" HeaderText="Q3" SortExpression="Q3" />
     <asp:BoundField DataField="Q4" HeaderText="Q4" SortExpression="Q4" />
     <asp:BoundField DataField="Q5" HeaderText="Q5" SortExpression="Q5" />
     <asp:BoundField DataField="Q6" HeaderText="Q6" SortExpression="Q6" />
     <asp:BoundField DataField="Q7" HeaderText="Q7" SortExpression="Q7" />
     <asp:BoundField DataField="Q8" HeaderText="Q8" SortExpression="Q8" />
     <asp:BoundField DataField="Q9" HeaderText="Q9" SortExpression="Q9" />
     <asp:BoundField DataField="Q10" HeaderText="Q10" SortExpression="Q10" />
     <asp:BoundField DataField="Q11" HeaderText="Q11" SortExpression="Q11" />
     <asp:BoundField DataField="Q12" HeaderText="Q12" SortExpression="Q12" />
     <asp:BoundField DataField="Q13" HeaderText="Q13" SortExpression="Q13" />
     <asp:BoundField DataField="Q14" HeaderText="Q14" SortExpression="Q14" />
     <asp:BoundField DataField="Q15" HeaderText="Q15" SortExpression="Q15" />
     <asp:BoundField DataField="Q16" HeaderText="Q16" SortExpression="Q16" />
     <asp:BoundField DataField="CreateDateTime" HeaderText="CreateDateTime" 
       SortExpression="CreateDateTime" />
   </Columns>
 </asp:GridView>
 
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
   ConnectionString="<%$ ConnectionStrings:CCSExamsConnectionString1 %>" 
   SelectCommand="SELECT [Id], [ResidentName], [Q1], [Q2], [Q3], [Q4], [Q5], [Q6], [Q7], [Q8], [Q9], [Q10], [Q11], [Q12], [Q13], [Q14], [Q15], [Q16], [CreateDateTime] FROM [Week1]"
   InsertCommand="INSERT INTO [Week1] ([ResidentName], [Q1], [Q2], [Q3], [Q4], [Q5], [Q6], [Q7], [Q8], [Q9], [Q10], [Q11], [Q12], [Q13], [Q14], [Q15], [Q16], [CreateDateTime]) VALUES (@ResidentName, @Q1, @Q2, @Q3, @Q4, @Q5, @Q6, @Q7, @Q8, @Q9, @Q10, @Q11, @Q12, @Q13, @Q14, @Q15, @Q16, @CreateDateTime)" 
   DeleteCommand="DELETE FROM [Week1] WHERE [Id] = @Id" 
   UpdateCommand="UPDATE [Week1] SET [ResidentName] = @ResidentName, [Q1] = @Q1, [Q2] = @Q2, [Q3] = @Q3, [Q4] = @Q4, [Q5] = @Q5, [Q6] = @Q6, [Q7] = @Q7, [Q8] = @Q8, [Q9] = @Q9, [Q10] = @Q10, [Q11] = @Q11, [Q12] = @Q12, [Q13] = @Q13, [Q14] = @Q14, [Q15] = @Q15, [Q16] = @Q16, [CreateDateTime] = @CreateDateTime WHERE [Id] = @Id">
   <DeleteParameters>
     <asp:Parameter Name="Id" Type="Int32" />
   </DeleteParameters>
   <InsertParameters>
     <asp:Parameter Name="ResidentName" Type="String" />
     <asp:Parameter Name="Q1" Type="String" />
     <asp:Parameter Name="Q2" Type="String" />
     <asp:Parameter Name="Q3" Type="String" />
     <asp:Parameter Name="Q4" Type="String" />
     <asp:Parameter Name="Q5" Type="String" />
     <asp:Parameter Name="Q6" Type="String" />
     <asp:Parameter Name="Q7" Type="String" />
     <asp:Parameter Name="Q8" Type="String" />
     <asp:Parameter Name="Q9" Type="String" />
     <asp:Parameter Name="Q10" Type="String" />
     <asp:Parameter Name="Q11" Type="String" />
     <asp:Parameter Name="Q12" Type="String" />
     <asp:Parameter Name="Q13" Type="String" />
     <asp:Parameter Name="Q14" Type="String" />
     <asp:Parameter Name="Q15" Type="String" />
     <asp:Parameter Name="Q16" Type="String" />
     <asp:Parameter Name="CreateDateTime" Type="DateTime" />
   </InsertParameters>
   <UpdateParameters>
     <asp:Parameter Name="ResidentName" Type="String" />
     <asp:Parameter Name="Q1" Type="String" />
     <asp:Parameter Name="Q2" Type="String" />
     <asp:Parameter Name="Q3" Type="String" />
     <asp:Parameter Name="Q4" Type="String" />
     <asp:Parameter Name="Q5" Type="String" />
     <asp:Parameter Name="Q6" Type="String" />
     <asp:Parameter Name="Q7" Type="String" />
     <asp:Parameter Name="Q8" Type="String" />
     <asp:Parameter Name="Q9" Type="String" />
     <asp:Parameter Name="Q10" Type="String" />
     <asp:Parameter Name="Q11" Type="String" />
     <asp:Parameter Name="Q12" Type="String" />
     <asp:Parameter Name="Q13" Type="String" />
     <asp:Parameter Name="Q14" Type="String" />
     <asp:Parameter Name="Q15" Type="String" />
     <asp:Parameter Name="Q16" Type="String" />
     <asp:Parameter Name="CreateDateTime" Type="DateTime" />
     <asp:Parameter Name="Id" Type="Int32" />
   </UpdateParameters>
</asp:SqlDataSource>


 <div align="center">
<table width="650" cellspacing="0" cellpadding="0" border="0" height="107">
<tr> 
<td align="left" valign="top" > 
<font face="Arial" size="2">    

	 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Week I Exam</title>



 
<p><font face="Arial" size="+2" color="#00458a"><strong>Week I</font>
<br><font face="Arial" size="2" color="#00458a"> 
<br>Online Exam  	 
 </strong>
 </font>
<br> 
 <br>
 
 
 <table  width="650" cellpadding="5">


<tr>
<td valign="top" align="left" bgcolor="#00458a" colspan="2">
<font face="arial" color="white" size="2" >
<p><strong><font face="Arial" size="3">Question 1</font></strong>
<p>Question one context is located here. 
<p><strong>Based on these findings, what would you do next?</strong>
</td>
</tr>
<tr>
<td bgcolor="#d7ebff" align="left" class="style2">
<font face="arial" size="2">
A. Question A Answer
</td>
<td rowspan="4" bgcolor="#00458a" align="left">
<font face="arial" size="2" color="#ffffff">
<asp:RadioButtonList ID="Q1" runat="server" Font-Bold="True" 
    Font-Names="Arial" Font-Size="10pt" 
    ForeColor="White" ViewStateMode="Enabled">
     <asp:ListItem Value="A: A Answert">A</asp:ListItem>
     <asp:ListItem Value="B: B Answer.">B</asp:ListItem>
     <asp:ListItem Value="C: C Answer.">C</asp:ListItem>
     <asp:ListItem Value="D: D Answer">D</asp:ListItem>
     </asp:RadioButtonList>    
          </td>
</tr>
<tr>
<td bgcolor="#77bbff"align="left" class="style2">
<font face="arial" size="2">
B. Question B Answer.
</td>
</tr>
<tr>
<td bgcolor="#d7ebff" align="left" class="style2">
<font face="arial" size="2">
C. Question C Answer
</td>
</tr>
<tr>
<td bgcolor="#77bbff"align="left" class="style2">
<font face="arial" size="2">
D. Question D Answer.
</font>
</td>
</tr>
<tr>
<td bgcolor="#00458a" valign="top" align="left" colspan="2">
<font face="Arial" color="white" size="2"><strong>
Comments:</strong>
<br>
<asp:TextBox ID="Q1Comments" runat="server" Height="49px" Width="657px" 
    ontextchanged="Q1Comments_TextChanged" TextMode="MultiLine"></asp:TextBox>
</font>
</td>
</tr>
UPDATE:
After a lot of searching I now fully realize I need to write C# code in the code behind file for this quiz form. Visual Studio's GridView and DetailsView WILL connect to your database table for basic CRUD, but the interface (to use an loose analogy) is like baking the same "cake" over and over with different flavors. The graphical user interface choice is basically the same. C# code (in the code behind file) is needed to break the "Gridlock" of GridView.
Reply With Quote
  #5 (permalink)  
Old December 5th, 2011, 05:44 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You may want to take another look at Chapter 15, page 554 and further on "hand-coding data access code". It shows similar concepts using the Entity Framework, freeing you from some of the complex code needed to do it all yourself.....

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
open source online test/exam system surendran PHP How-To 5 August 22nd, 2010 07:10 AM
countdown timer for online exam project-help me manisha agarwal ASP.NET 2.0 Basics 1 September 12th, 2008 02:56 AM
online exam project manisha agarwal ASP.NET 2.0 Basics 1 September 2nd, 2008 10:07 AM
Online exam Application--Urgent!!!! e.suni .NET Framework 1.x 5 December 29th, 2007 07:52 AM



All times are GMT -4. The time now is 06:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.