Solved

creating a registration page.

Posted on 2008-09-29
5
158 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 500 total points
Comment Utility
0
 
LVL 1

Author Comment

by:smitty68521
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now