C# Programming
03-29-2009, 04:13 PM
hello every one,
Well i have big problem whn i m debuging my Project. it gives me Exception"Only MySqlParameter objects may be stored".......
this is my cs file code.
public int ExecuteNonQuery(string storedProcedure, MySqlParameter[] parameterArray, MySqlParameter outputParam)
{
int result;
MySqlCommand comm = null;
string msg;
result = 0;
try
{
//ValidateConnectionString();
//conn = new SqlConnection();
//conn.ConnectionString = _connectionString;
comm = _connection.CreateCommand();
//conn.Open();
comm.CommandText = storedProcedure;
comm.CommandType = CommandType.StoredProcedure;
foreach (MySqlParameter param in parameterArray)
{
comm.Parameters.Add(param);
}
outputParam.Direction = ParameterDirection.Output;
comm.Parameters.Add(parameterArray);
result = comm.ExecuteNonQuery();
result = int.Parse(outputParam.Value.ToString());
}
this line is Exception// catch (Exception ex)
{
msg = ex.Message;
}
finally
{
comm = null;
}
// result = SqlHelper.ExecuteNonQuery(_connectionString, CommandType.StoredProcedure, storedProcedure, parameterArray);
return result;
}
please tell me what should i do solve this problem ......
reply me as soon as posible
thanks in Advance
Naim Khan
Well i have big problem whn i m debuging my Project. it gives me Exception"Only MySqlParameter objects may be stored".......
this is my cs file code.
public int ExecuteNonQuery(string storedProcedure, MySqlParameter[] parameterArray, MySqlParameter outputParam)
{
int result;
MySqlCommand comm = null;
string msg;
result = 0;
try
{
//ValidateConnectionString();
//conn = new SqlConnection();
//conn.ConnectionString = _connectionString;
comm = _connection.CreateCommand();
//conn.Open();
comm.CommandText = storedProcedure;
comm.CommandType = CommandType.StoredProcedure;
foreach (MySqlParameter param in parameterArray)
{
comm.Parameters.Add(param);
}
outputParam.Direction = ParameterDirection.Output;
comm.Parameters.Add(parameterArray);
result = comm.ExecuteNonQuery();
result = int.Parse(outputParam.Value.ToString());
}
this line is Exception// catch (Exception ex)
{
msg = ex.Message;
}
finally
{
comm = null;
}
// result = SqlHelper.ExecuteNonQuery(_connectionString, CommandType.StoredProcedure, storedProcedure, parameterArray);
return result;
}
please tell me what should i do solve this problem ......
reply me as soon as posible
thanks in Advance
Naim Khan