获得存储过程返回值的方法(return的值)

来源:互联网 发布:java开发小游戏教程 编辑:程序博客网 时间:2024/06/11 16:30
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
获得存储过程的返回值


System.Data.SqlClient.SqlConnection scon = new System.Data.SqlClient.SqlConnection("server=Netangel;uid=etopsUS;pwd=etops;database=etops");
System.Data.SqlClient.SqlCommand scom = new System.Data.SqlClient.SqlCommand("",scon);

scon.Open();
scom.CommandText="p_CorpClassAdd";
scom.CommandType = System.Data.CommandType.StoredProcedure;
scom.Parameters.Add(
                new SqlParameter("returnValue", SqlDbType.Int, 4,
                ParameterDirection.returnValue, false, 0, 0,
                string.Empty, DataRowVersion.Default, null)) //增加存储过程的返回值参数

            

scom.ExecuteNonQuery();
Response.Write(scom.Parameters["returnValue"].Value.ToString());  //输出存储过程

获得存储过程返回值的方法(return的值)';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>