Solved

creating a registration page.

Posted on 2008-09-29
5
165 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

756 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