Web表单和WCF服务. [英] web form and WCF services.

查看:75
本文介绍了Web表单和WCF服务.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从启用Silverlight的Web服务传递一个ID,然后在Web服务内部需要连接到sql-server,从db检索数据,如果数据是多个值,则可能需要使用数组列表或列表要传递回Web表单,任何人都可以给我提供示例代码,或者向我投影,我正在使用vb语言.

i want to pass an id from silverlight-enable web service, and then inside the web service need to connect to sql-server, retrieve data from db, the data if a multiple value, might need to use array list or list to pass back to web form, anyone can gv me sample code , or project to me, i am using vb language.

推荐答案

我在这里所做的就是创建数组在sql server中.

例子
表名称:#tblInvoiceNumber

INV_NO
第1行
第2行
第3行

我将其转换为带有逗号的列式,并在1列中将其缩小了

这用于使其以逗号分隔
what i did here is create the array in sql server.

example
Table name : #tblInvoiceNumber

INV_NO
row1
row2
row3

I convert this in to a columnar with comma dilimeted to result it in 1 column

This is used to make it comma delimited
while @int_min <= @int_max
    begin

            select @var_InvoiceNumber = isnull(INV_NO,'') from #tblInvoiceNumber where ID = @int_min

            if(isnull(@var_InvoiceNumber,'')<>'' )
                begin
                        set @out_InvoiceNo = @var_InvoiceNumber + ',' +  @out_InvoiceNo
                end

            set @int_min = @int_min + 1


    end


选择@out_InvoiceNo作为out_InvoiceNo


select @out_InvoiceNo as out_InvoiceNo


[ ^ ]分步介绍可能会有所帮助.
This[^] step by step article could help.


这篇关于Web表单和WCF服务.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆