Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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 November 30th, 2005, 02:07 AM
Authorized User
 
Join Date: Nov 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL SERVER ERROR IN VS.NET USING C#

 I'm working on creating a database using SQL server, and my code is written in VS.NET. I get the following error:

---------------------------
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error.
---------------------------

Here is the function where the 1st error takes place:

------------------------
public static int ExecuteNonQuery (string procName, params object[] args) {

      SqlCommand cmnd = null;
        try
        {
            // Run the stored procedure to update the database
            cmnd = DbUtil.BuildCommand(procName, args);
            cmnd.Connection.Open();
            int iRowsAffected = cmnd.ExecuteNonQuery();

            // return the number of rows affected
            return iRowsAffected;
        }

        finally
        {
            // Close resources
            if (cmnd != null)
                if (cmnd.Connection.State != ConnectionState.Closed)
                    cmnd.Connection.Close();
        }

    }
----------------------

I think the problem has something to do with my connection string. I'm not sure if I wrote the connection string correctly. Here it is:
_DSN = "Data Source=132.47.120.194;User ID=sa;Password=par>05sql;Database=Jodiv;";

If anyone has any suggestions please reply back!!!
 
Old December 2nd, 2005, 03:01 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Cross post:
http://p2p.wrox.com/topic.asp?TOPIC_ID=37073

 
Old December 8th, 2005, 02:33 AM
Authorized User
 
Join Date: Nov 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it's been resolved, thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
SQL SERVER ERROR IN VS.NET divyak02 SQL Server 2000 2 December 13th, 2005 11:46 PM
SQL SERVER ERROR IN VS.NET divyak02 VS.NET 2002/2003 1 December 8th, 2005 02:34 AM
SQL SERVER ERROR IN VS.NET USING C# divyak02 C# 1 December 5th, 2005 09:03 AM
SQL Server sync with net server and browser server ne SQL Server DTS 0 June 13th, 2005 06:29 PM





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