string connection = "Data Source=" + server + ";Initial Catalog=" + dbase +
";User ID=" + userid + ";Password=" + password;
conn = new SqlConnection(connection);
conn.Open();
SqlCommand cmd = new SqlCommand("SUBNETTEMP", conn);
cmd.CommandType = CommandType.StoredProcedure;
Parameters d = new Parameters();
d.addparam(15, 1);
d.addparam(15, 2);
foreach (var param in d)
{
cmd.Parameters.Add(new SqlParameter(param.Key, param.Value));
}
There s a class called parameters:
class Parameters
{
Dictionary<int, int> paramids;
public Dictionary<int, int> addparam(int sid, int sbid)
{
if (paramids == null)
paramids = new Dictionary<int, int>();
paramids.Add(sid, sbid);
return paramids;
}
}
我不敢肯定,为什么我错过了:“每次发言都无法按类型ConsoleApplication1的变量操作。 参数:ConsoleApplication1。 参数并不包含基因组数字的公开定义。