欢迎光临
我们一直在努力

我没看但是根据提示这个是写xml的,好事vb的—哎。。。。quickstart呀。。靠你就可以说几天了-.net教程,xml应

建站超值云服务器,限时71元/月

<%@ import namespace="system.data" %>
<%@ import namespace="system.data.sqlclient" %>

<html>
<head>

    <script language="vb" runat="server">

        public source as dataview
        public ds as dataset
        public getschemachecked, getdatachecked as boolean

        sub submit_click(sender as object, e as eventargs)

            if (page.ispostback)

                dim myconnection as sqlconnection
                dim mycommand as sqldataadapter

                myconnection = new sqlconnection(connectstring.value)
                mycommand = new sqldataadapter(mytext.value, myconnection)

                ds = new dataset()
                mycommand.fill(ds, "table")

                source = new dataview(ds.tables(0))

                getschemachecked = getschema.checked
                getdatachecked = getdata.checked

                mydatagrid.datasource=source
                mydatagrid.databind()
            end if
         end sub

    </script>

</head>
<body bgcolor="ffffcc">

    <h3><font face="verdana">sql to xml generator</font></h3>

    <form runat="server">

        <table border=0 cellpadding=5 style="font:10pt verdana">
        <tr>
          <td colspan="2">
            <b>connect string:</b><br>
            <input id="connectstring" type="text" value="server=(local)\netsdk;database=pubs;trusted_connection=yes" size="85" runat="server">
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <b>query:</b><br>
            <input id="mytext" type="text" value="select * from authors" size="85" runat="server">
          </td>
        </tr>
        <tr>
          <td>
            <input type="radio" id="getschema" name="mode" runat="server"/>get xml schema<br>
            <input type="radio" id="getdata" name="mode" runat="server"/>get xml data<br>
            <input type="radio" id="getboth" name="mode" checked runat="server"/>get both
          </td>
          <td valign="top">
            <input type="submit" runat="server" onserverclick="submit_click">
          </td>
        </tr>
        <tr>
          <td colspan="2">

              <%  if page.ispostback  %>
                  <b>result:</b><br>
                  <textarea cols=80 rows=25>
              <%
                  if getschemachecked
                      ds.writexmlschema(response.output)
                  else if getdatachecked
                      ds.writexml(response.output, xmlwritemode.ignoreschema)
                  else
                      ds.writexml(response.output)
                  end if
              %>
                  </textarea>
              <%  end if  %>

          </td>
        </tr>
        <tr>
          <td colspan="2">

              <%  if (page.ispostback)  %>
                  <b>data:</b><br>
              <%  end if  %>

              <asp:datagrid id="mydatagrid"
                backcolor="#edbe7b"
                bordercolor="black"
                showfooter="false"
                cellpadding=3
                cellspacing="0"
                font-name="verdana"
                font-size="8pt"
                headerstyle-backcolor="#dc6035"
                enableviewstate="false"
                runat="server"
              />

          </td>
        <tr>
        </table>

    </form>

</body>
</html>

  

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 我没看但是根据提示这个是写xml的,好事vb的—哎。。。。quickstart呀。。靠你就可以说几天了-.net教程,xml应
分享到: 更多 (0)

相关推荐

  • 暂无文章