iam getting this error please modify run it

  • public partial class Default2 : System.Web.UI.Page

    {

    SqlConnection cn = new SqlConnection("Persist Security Info=False;User ID=sa;Initial Catalog=Sms;data source=WINDOWS-8D8C34A;password=sqlserver ");

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void Button2_Click(object sender, EventArgs e)

    {

    Response.Redirect("register.aspx");

    }

    protected void LinkButton1_Click(object sender, EventArgs e)

    {

    }

    protected void Button1_Click(object sender, EventArgs e)

    {

    SqlCommand cmd = new SqlCommand("select Login from Register Where Mobile NO='"+TextBox1.Text+"' and Password='"+TextBox2.Text+"'",cn );

    cn.Open();

    SqlDataReader dr = cmd.ExecuteReader();

    if (dr.Read())

    {

    Response.Redirect("send sms.aspx");

    }

    }

    }

    source code:

    Editor's Note: Removed source code and moved to an attachment.

  • Which line of code's throwing the error and what's the complete error message?

    p.s. SA login and a simple password? I hope that's not what your system's actually using....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply