以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]咋就没换行呢?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=95759)

--  作者:huhu
--  发布时间:2017/2/4 14:53:00
--  [求助]咋就没换行呢?
  <WebMethod()>
    Public Function Detailedquery(ByVal scddhm As String, ByVal gdhh As String, ByVal wlbm As String, ByVal kwlb As String, ByVal startdate As String, ByVal enddate As String) As String
        Dim cnStr As String = "Data Source=172.16.11.201;Initial Catalog=songjiang;Integrated Security=False;User ID=sa;Password=bdcom103liujy;"
        Dim cn As New SqlClient.SqlConnection(cnStr)
        cn.Open()
        Dim state As String = ""
        If scddhm = "" And gdhh = "" And wlbm = "" And kwlb = "" And startdate = "" And enddate = "" Then
            Dim adapter As New SqlClient.SqlDataAdapter("se lect * from [可用数量表]", cn)
            Dim dt As New DataTable
            adapter.Fill(dt)
            cn.Close()
            For Each dr As DataRow In dt.Rows
                state &= "%" & "生产订单号码:" & dr("生产订单号码") & "工单行号:" & dr("工单行号") & "物料编码:" & dr("物料编码") & "库位类别:" & dr("库位类别") & "入库时间:" & dr("入库时间") & "%" & Chr(10) & Chr(13)
            Next
        End If
        Return state
    End Function

Chr(10) & Chr(13)改为VBcrlf也没用。

--  作者:有点色
--  发布时间:2017/2/4 15:08:00
--  

直接msgbox(state)看一下,代码没问题。

 

再有就是,你不能用另外一些分割符号?