SQL SERVER ERROR IN VS.NET
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!!!
|