为什么它要求声明一个标量变量@Code
private DataSet SearchRecord ( string lQuery, string SwiftCode)
using ( pConnectionState = new SqlConnection(pConnectionString) )
{
try
{
string TableName = "ACCOUNT_DETAILS";
pConnectionState.Open();
SqlCommand lSqlCommand = new SqlCommand(lQuery , pConnectionState);
lSqlCommand.Parameters.Add("@SwiftCode" , SqlDbType.VarChar).Value = SwiftCode;
SqlDataAdapter lSqlDataAdapter = new SqlDataAdapter(lQuery, pConnectionState);
DataTable lDataTable = new DataTable(TableName);
DataSet lDataSet = new DataSet();
lSqlDataAdapter.Fill(lDataSet, TableName);
pConnectionState.Close();
return lDataSet;
}
catch ( Exception ex )
{
MessageBox.Show("Error: " + ex.ToString());
}
return null;
}
}