Hi, I have a C# web project where I am trying to pass an array from one class to another, but I keep getting errors during build saying:
invalid expression term ")"
here is my code trying to pass SqlParameter array
// get the last 3 or 4 character of expression to find sort direction
string direction = sortExpression.Substring(sortExpression.LastIndexOf(' ')+1, sortExpression.Length-sortExpression.LastIndexOf(' ')-1);
SqlParameter p = new SqlParameter;
p = new SqlParameter("@direction", direction.ToString());
DataTable dt = Db.GetDataTable(sql.ToString(), SqlParameter p); <======== it is having a problem with this statement
here is the class recieving the parameter
public static DataTable GetDataTable(string sql, SqlParameter p)
It got to be something simple that I am missing.