Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

creating a registration page.

Posted on 2008-09-29
5
Medium Priority
?
178 Views
Last Modified: 2013-11-07
Is there a way you can use information that is put into a textbox to update a database?  For example: A user puts in his/her email address and inputs a password, it updates the database when they click on the register button.  This of course happens if it passes the validators. I appreciate any help I can get on this.
0
Comment
Question by:smitty68521
  • 4
5 Comments
 
LVL 11

Accepted Solution

by:
Muhammad Kashif earned 1000 total points
ID: 22602828
0
 
LVL 1

Author Comment

by:smitty68521
ID: 22602858
That helps if you are using a datagrid. However, that isn't any help as far as the text boxes.  This is a snippet of what I have so far. Where I am having problems is the code that will allow the user to click on the "register" button and update the sql database based on user input. Here is what I have so far:
 Company Contact Name:
                    <asp:TextBox ID="cocontact" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                        ControlToValidate="cocontact" ErrorMessage="Please Include a contact name "></asp:RequiredFieldValidator>
                    <br />
                    Company Street Address:
                    <asp:TextBox ID="costreetadd" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <br />
                    Company City:
                    <asp:TextBox ID="cocity" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <br />
                    Company State:
                    <asp:TextBox ID="costate" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <br />
                    Company Zip Code:
                    <asp:TextBox ID="cozip" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <br />
                    Company Phone:
                    <asp:TextBox ID="cophone" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                        ControlToValidate="cophone" ErrorMessage="Please include a phone number"></asp:RequiredFieldValidator>
                    <br />
                    Company Fax:
                    <asp:TextBox ID="cofax" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <br />
                    Company Email:
                    <asp:TextBox ID="coemail" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <br />
                    Company Website:
                    <asp:TextBox ID="cowebsite" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <br />
                    Hours:
                    <asp:TextBox ID="hours1" runat="server" Height="116px" Width="247px"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                        ControlToValidate="hours1"
                        ErrorMessage="Please include the times you prefer to be contacted."></asp:RequiredFieldValidator>
                    <br />
                    <br />
                    <asp:Label ID="Label4" runat="server" BackColor="#663300" Font-Bold="True"
                        Text="Choose your login Email and Password."></asp:Label>
                    <br />
                    Login Email:<asp:TextBox ID="cologin" runat="server" Width="247px"></asp:TextBox>
                    <br />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                        ControlToValidate="cologin" ErrorMessage="Please enter a valid email address"
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                        ControlToValidate="cologin" ErrorMessage="Please enter a valid Email Address"></asp:RequiredFieldValidator>
                    <br />
                    Login Password:<asp:TextBox ID="copassword" runat="server" Width="247px"
                        TextMode="Password"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                        ControlToValidate="copassword" ErrorMessage="Please choose a password"></asp:RequiredFieldValidator>
                    <br />
                    Retype Login Password:<asp:TextBox ID="copasswordverify" runat="server"
                        TextMode="Password" Width="247px"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                        ControlToValidate="copasswordverify"
                        ErrorMessage="Please verify your password."></asp:RequiredFieldValidator>
                    <br />
                    <asp:CompareValidator ID="CompareValidator1" runat="server"
                        ControlToCompare="copassword" ControlToValidate="copasswordverify"
                        ErrorMessage="Please make sure both passwords match."></asp:CompareValidator>
&nbsp;<br />
0
 
LVL 1

Author Comment

by:smitty68521
ID: 22611674
I was able to figure this part out. I used a sql data source and an insert statement from there. On the button click event I put the following code:

sqldatasource1.insert().

When I run the website, I get this error:
[InvalidOperationException: Could not find control 'cologin' in ControlParameter 'loginemail'.]

I double checked this over an over again, I still was not able to come up with why this is happening. Anyone have any suggestions?
0
 
LVL 1

Author Comment

by:smitty68521
ID: 22622206
I still haven't been able to figure this one out. I am still getting the same error. I have been doing research it isn't like I am asking everyone on here to spoonfeed me the informaiton. I do appreciate the help I have gotten so far. I simply used a sql data source and dragged it on the page and configured an insert statement as was said in one of the earlier posts in this website. I am lost on this and haven't been able to find an answer.
0
 
LVL 1

Author Closing Comment

by:smitty68521
ID: 31501409
I still haven't been able to figure this one out. The expert never got back to me. I am to the point that I know I need a data connection. I did that and I am still getting the error I noted in this post.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question