4
Reply

code correction

Alshifa Abdulrahman

Alshifa Abdulrahman

Apr 29 2015 7:57 PM
488
Please can you tell me where is the error ??

I am using Microsoft visual web developer 2008 Express edition / asp.net / C# 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Configuration;
using System.Data;


SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RUWSportCenterConnectionString2"].ConnectionString);
        SqlDataAdapter sda = new SqlDataAdapter("select * from Registration where User name = '"+ TextBox1.Text +"' and Password = '"+ TextBox2.Text +"'", con);
        DataTable dt = new DataTable();
        sda.Fill(dt);

        if (dt.Rows.Count == 1)
        {
            Label6.Visible = false;
            Response.Redirect("ViewPro.aspx");
        }
        else
        {
            TextBox2.Text = "";
            Label6.Text = "Check your USER NAME or PASSWORD";
            Label6.Visible = true;
        }

Answers (4)