Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 26th, 2005, 09:50 PM
Registered User
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to damnv
Default System Error

Hi All!

I had seen an Error Message "System Error" at sqlCom.ExecuteNonQuery when compile the folowing code:

private void cmdLogin_Click(object sender, System.EventArgs e)
        {
            string strUserName, strPassWord,strDBUserName, strDBPassword,strServerName, strDBName;
            string strConn;
            strUserName = txtUserName.Text.ToString();
            strPassWord = txtPassword.Text.ToString();
            strDBUserName = txtDBUserName.Text.ToString();
            strDBPassword = txtDBName.Text.ToString();
            strServerName = txtServerName.Text.ToString();
            strDBName = txtDBName.Text.ToString();

            strConn = "User ID ="+strDBUserName+";Password ="+strPassWord+";Initial Catalog ="+strDBName+";Data Source ="+strServerName;
            SqlConnection sqlConn = new SqlConnection(strConn);
            SqlCommand sqlCom = new SqlCommand("sp_Select_User",sqlConn);

            sqlCom.CommandType = CommandType.StoredProcedure;

            sqlCom.Parameters.Add(new SqlParameter("@sLoginName",SqlDbType.VarChar,50));
            sqlCom.Parameters["@sLoginName"].Value = strUserName;
            sqlCom.Parameters.Add(new SqlParameter("@sEncryptedPassword",SqlDbType.NVarC har,200));
            sqlCom.Parameters["@sEncryptedPassword"].Value = strPassWord;

            sqlConn.Open();
            sqlCom.ExecuteNonQuery();
            sqlConn.Close();
            DataTable dt = new DataTable();

            SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCom);
            sqlDa.Fill(dt);

            int row = dt.Rows.Count;
            if (row == 0)
            {
                MessageBox.Show("Wrong UserName or Password");
            }
            else
            {
                MessageBox.Show("Successfull Login");
            }
        }

Is there anyone help me ?
 
Old July 27th, 2005, 02:47 AM
Authorized User
 
Join Date: Nov 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to avanishp
Default

Hi
In SQL Profiler you can check what query it is firing... paste that query in query analyzer and run... if any error in sql query you will get it there.



Avanish Pandey
Set your heart upon your work, but never on its reward





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Web Error snowy0 VB.NET 2002/2003 Basics 12 October 14th, 2006 11:13 PM
System.InvalidCastException QueryInterface Error MTCVS .NET Web Services 1 November 30th, 2005 01:21 PM
error system.web....... anpham ASP.NET 1.0 and 1.1 Basics 3 July 1st, 2005 01:36 PM
system error 1157 preita Oracle 3 March 1st, 2005 01:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.