All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASPX页面出现乱码的解决办法_[Asp.Net教程]
技巧:Asp.net直接保存文件到客户端_.net资料_编程技术
用PHP将数据导入到Foxmail_php资料_编程技术
asp.net2.0生成验证码,并显示验证码_[Asp.Net教程]
在ASP.NET,Atlas中调用Web,Service_[Asp.Net教程]
asp.net2.0验证控件之 CompareValidator控件使用方法详
sql server2005设置自动备份全过程_[SQL Server教程]
SEO该如何进行图片优化?_百度优化_seo学堂
asp.net2.0指定和禁用主题
net得到本地电脑基本信息的简单方法_[Asp.Net教程]
Reading number is top 10 pictures
含苞欲放的素颜美少女2
Rendez-vous Sleep with actress, three days to earn 600000
30 beautiful school beauty6
The little woman's bright wire1
So beauty, will let you spray blood4
战场废物1
这酸爽,让人不敢相信
Beautiful Japanese beauty(漂亮的日本美女)3
身材野火台灣美女1
Absolutely shocked. National geographic 50 animal photographys7
Download software ranking
Sora aoi 120 minutes
Boxer Classic video1
Ashlynn Video4
金山office2007
Unix video tutorial2
jdk1.5
SQL2000 For 4IN1
C#COM编程指南
C#编程思想
Tram sex maniac 2 (H) rar bag16
delv published in(发表于) 2014/1/10 6:31:47 Edit(编辑)
如何解决Remoting无法传输存储过程参数的问题_[Asp.Net教程]

如何解决Remoting无法传输存储过程参数的问题_[Asp.Net教程]

如何解决Remoting无法传输存储过程参数的问题_[Asp.Net教程]

在项目的开发中使用Remoting,并且所有的数据请求服务都是通过Remoting完成的,所以自然就在其中到了传递参数的存储过程,在业务逻辑中把参数构建好后传递到Remoting服务端,在取出存储过程的参数时报错,具体错误不记得了,自己尝试了各种方法也不行,上网资讯也没有结果,最后变通了一下,问题解决了,例子如下:

以下部分为客户调用端


1//先声明参数
2 private const string PARAM_GUID = "@GUID";
3 private const string PARAM_VGA_TREEGUID = "@VGATreeGUID";
4 private const string PARAM_MB_TREEGUID = "@MBTreeGUID";
5
6 public static string GetProductTypeByGUID(string GUID, String VGATreeID, String MbTreeID)
7 {
8 try
9 {
10 int lcID = Thread.CurrentThread.CurrentUICulture.LCID;
11
12 BaseModel bt = new BaseModel();
13
14 //构建一个哈希表,把参数依次压入
15 Hashtable parames = new Hashtable();
16 parames.Add(PARAM_PROGUID, GUID);
17 parames.Add(PARAM_VGA_TREEGUID, VGATreeID);
18 parames.Add(PARAM_MB_TREEGUID, MbTreeID);
19
20 //把存储过程名称和带参数的哈希表传入
21 DataAccess.DataBase.RunProcedureDataSet(lcID, "GetProductTypeByTreeID", parames, ref bt);
22
23 return bt.Rows[0]["ProductType"].ToString();
24 }
25 catch (Exception ex)
26 {
27 CommFunction.WriteErrorLogFile("public static string GetProductTypeByGUID(stirng GUID, String VGATreeID, String MbTreeID)出错:" + ex.Message);
28 return "Other";
29 }
30 }
31
32


以下为服务端:


1public void Query(int lcid, string SQLString, Hashtable cmdHashtable, ref BaseModel baseModel)#region public void Query(int lcid, string SQLString, Hashtable cmdHashtable, ref BaseModel baseModel)
2 // -------------------------------------------------------------
3 public void Query(int lcid, string SQLString, Hashtable cmdHashtable, ref BaseModel baseModel)
4 {
5 if (!CheckRemotingClient())
6 {
7 return;
8 }
9 Console.WriteLine(DateTime.Now.ToString() + "调用了Query(" + lcid.ToString() + ", string SQLString, Hashtable cmdHashtable, ref BaseModel baseModel)");
10 int i = cmdHashtable.Count;
11 //以下构造存储过程参数
12 SqlParameter[] cmdParms = new SqlParameter[i];
13 int j = 0;
14 foreach (DictionaryEntry de in cmdHashtable)
15 {
16 cmdParms[j] = new SqlParameter(de.Key.ToString(), de.Value);
17 j++;
18 }
19 Colorful.DBUtility.DbHelperSQL.Query(lcid, SQLString, cmdParms, ref baseModel);
20 }
21 // --------------------------------------------------------------------
22 #endregion


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.