Advertisement

05.02.2007 at 05:48PM PDT, ID: 22549287
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

asp.net c# login class

Asked by riskyricky1972 in C# Programming Language, Programming for ASP.NET

Tags:

I have the following code behind asp.net c#. It works fine, and now I want to put them into class and save in Bin folder.
Can you show me what I need to edit inside of the following codes, and save in class in bin folder?
and I will have login.aspx and use code behind to call the class back. How can I do that?
I will give out 500 pts for this question
Note: You can ignore the dbReader object, and simply return value (LoginChkCommand.Parameters["@retval"].Value)

protected void cmdlogin_Click(object sender, EventArgs e)
    {
        SqlConnection myConnection = new SqlConnection();
        try
        {
            //create db connection and open it
            string ConnectionString = ConfigurationSettings.AppSettings["DBconnection"];
            string CommandText = "up_IsValidLogon";
            myConnection.ConnectionString = ConnectionString;

            SqlCommand LoginChkCommand = new SqlCommand(CommandText, myConnection);
            LoginChkCommand.CommandType = CommandType.StoredProcedure;
            //need to add parameter
            //**********************
            SqlParameter var1 = new SqlParameter();
            var1.ParameterName = "@username";
            var1.SqlDbType = SqlDbType.VarChar;
            var1.Value = UserName.Text;
            LoginChkCommand.Parameters.Add(var1);

            SqlParameter var2 = new SqlParameter();
            var2.ParameterName = "@password";
            var2.SqlDbType = SqlDbType.VarChar;
            var2.Value = UserPass.Text;
            LoginChkCommand.Parameters.Add(var2);

            SqlParameter var3 = new SqlParameter();
            var3.ParameterName = "@retval";
            var3.SqlDbType = SqlDbType.Int;
            var3.Direction = ParameterDirection.Output;
            LoginChkCommand.Parameters.Add(var3);
            //**********************
              myConnection.Open();
              SqlDataReader myReader = LoginChkCommand.ExecuteReader();
              GridView1.DataSource = myReader;
              GridView1.DataBind();
              myReader.Close();
            //**********************
            //now get the output parameter:
            lblmsg.Text =  LoginChkCommand.Parameters["@retval"].Value
            //**********************
        }
        catch (Exception ex)
        {
            throw (ex);
        }
        finally
        {
            myConnection.Close();
        }

    }Start Free Trial
[+][-]05.02.2007 at 06:43PM PDT, ID: 19020510

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.02.2007 at 09:56PM PDT, ID: 19021131

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 12:36AM PDT, ID: 19021534

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 05:37AM PDT, ID: 19022602

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 06:40AM PDT, ID: 19023090

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 07:11AM PDT, ID: 19023364

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 08:13AM PDT, ID: 19023944

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 11:21PM PDT, ID: 19029068

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, Programming for ASP.NET
Tags: login
Sign Up Now!
Solution Provided By: RizwanKhalid
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.06.2007 at 11:00PM PDT, ID: 19041200

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44