blog.sparetomato.com

Archive for June, 2008

Stored Procedure Syntax error with C# and the SQLCommand object

by Andy on Jun.24, 2008, under General

What is wrong with the following statement?

private SQLCommand _cmd = new SQLCommand();

public void ExecuteStoredProcedure(string procedureName SQLParameter[] parms)
{
  _cmd.Connection = _dbConn;
  _cmd.CommandType = CommandType.StoredProcedure;
  _cmd.CommandText = procedureName;
  _cmd.Parameters.AddRange(parms);
  _cmd.ExecuteScalar();
}

(continue reading…)

1 Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!