Solved

creating a registration page.

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

14 Experts available now in Live!

Get 1:1 Help Now