【Vegas原创】Procedure经典用法~(需配合DBAccess类)
void bind()
{
string d = "";
string p = "%";
string strText = "";
//绑定table1
for (int j = 1; j <= 4; j++)
{
for (int i = 3; i >= 1; i--)
{
if (j == 1) d = "D000";
else if (j == 2) d = "M000";
else if (j == 3) d = "P000";
else if (j == 4) d = "T000";
try
{
//连接数据库,并插入数据
SqlParameter[] sqlParam = new SqlParameter[2];
sqlParam[0] = new SqlParameter("@i", SqlDbType.Int, 20, ParameterDirection.Input, false, 0, 0, "@i", DataRowVersion.Default, i);
sqlParam[1] = new SqlParameter("@j", SqlDbType.NVarChar, 20, ParameterDirection.Input, false, 0, 0, "@j", DataRowVersion.Default, d);
DataSet ds = db.GetDataSet("pms_potential", sqlParam);
strText = ds.Tables[0].Rows[0][0].ToString() + "%";
}
catch
{
strText = "ERROR";
}
}
}
}
//绑定table2
}
{
string d = "";
string p = "%";
string strText = "";
//绑定table1
for (int j = 1; j <= 4; j++)
{
for (int i = 3; i >= 1; i--)
{
if (j == 1) d = "D000";
else if (j == 2) d = "M000";
else if (j == 3) d = "P000";
else if (j == 4) d = "T000";
try
{
//连接数据库,并插入数据
SqlParameter[] sqlParam = new SqlParameter[2];
sqlParam[0] = new SqlParameter("@i", SqlDbType.Int, 20, ParameterDirection.Input, false, 0, 0, "@i", DataRowVersion.Default, i);
sqlParam[1] = new SqlParameter("@j", SqlDbType.NVarChar, 20, ParameterDirection.Input, false, 0, 0, "@j", DataRowVersion.Default, d);
DataSet ds = db.GetDataSet("pms_potential", sqlParam);
strText = ds.Tables[0].Rows[0][0].ToString() + "%";
}
catch
{
strText = "ERROR";
}
}
}
}
//绑定table2
}
喜欢请赞赏一下啦^_^