Solved

creating a registration page.

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

792 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