c#结构体问题!
先定义一个类:public class SQLDBOperationer
{
public struct Paramor
{
public string Name;
public SqlDbType DBType;
public int Size;
public object Value;
}
public DataSet Operation_StoredProcedure_GetDataSet(string SPName, Paramor[] P)
{
SqlConnection conn = new SqlConnection(NormalOperations.SQLConnectionString);
SqlCommand cmd = new SqlCommand(SPName , conn);
cmd.CommandType = CommandType.StoredProcedure ;
foreach (Paramor pa in P)
{
cmd.Parameters.Add(pa);
}
SqlDataAdapter dsCommand = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
dsCommand.Fill(ds);
conn.Close();
return ds;
}
}
这样定义结构体行吗,怎么调用呢?
{
public struct Paramor
{
public string Name;
public SqlDbType DBType;
public int Size;
public object Value;
}
public DataSet Operation_StoredProcedure_GetDataSet(string SPName, Paramor[] P)
{
SqlConnection conn = new SqlConnection(NormalOperations.SQLConnectionString);
SqlCommand cmd = new SqlCommand(SPName , conn);
cmd.CommandType = CommandType.StoredProcedure ;
foreach (Paramor pa in P)
{
cmd.Parameters.Add(pa);
}
SqlDataAdapter dsCommand = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
dsCommand.Fill(ds);
conn.Close();
return ds;
}
}