【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, false00"@i", DataRowVersion.Default, i);
                        sqlParam[
1= new SqlParameter("@j", SqlDbType.NVarChar, 20, ParameterDirection.Input, false00"@j", DataRowVersion.Default, d);


                        DataSet ds 
= db.GetDataSet("pms_potential", sqlParam);
                   
                        strText 
= ds.Tables[0].Rows[0][0].ToString() + "%";
                    }
                    
catch
                    {
                        strText 
= "ERROR";
                    }
                   
                                    }
}

            }

            
//绑定table2

        }

 

posted @ 2007-10-12 14:51  李济宏(Amadeus)  阅读(202)  评论(0编辑  收藏  举报