Professional Web Applications Themes

Datagrid control in asp.net mobile web application - ASP.NET Data Grid Control

I want to use the datagrid control in an ASP.Net mobile web application When I run the following code, I get a blank webpage. I have added the datagrid inside the <Device Specific> tag Any suggestions. Thanks <% Import Namespace="System.Data" %> <% Import Namespace="System.Data.SqlClient" %> <HEAD> <... <meta content="http://schemas.microsoft.com/Mobile/Page" name="vs_targetSchema"> </HEAD> <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm"> <script language="vb" runat="server"> Sub Page_Load(sender as Object, e as EventArgs) If Not Page.IsPostBack then BindData() 'Only bind the data on the first page load End If End Sub Sub BindData() Const SQL_CONNECTION_STRING As String = "Server=WA;DataBase=SOLLI;user=sa;password=''" Dim conConnection As New SqlConnection(SQL_CONNECTION_STRING) Dim strSQL As String strSQL = ...

  1. #1

    Default Datagrid control in asp.net mobile web application

    I want to use the datagrid control in an ASP.Net mobile web application
    When I run the following code, I get a blank webpage.
    I have added the datagrid inside the <Device Specific> tag

    Any suggestions. Thanks

    <% Import Namespace="System.Data" %>
    <% Import Namespace="System.Data.SqlClient" %>
    <HEAD>
    <...
    <meta content="http://schemas.microsoft.com/Mobile/Page"
    name="vs_targetSchema">
    </HEAD>
    <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">

    <script language="vb" runat="server">
    Sub Page_Load(sender as Object, e as EventArgs)
    If Not Page.IsPostBack then
    BindData() 'Only bind the data on the first page load
    End If
    End Sub

    Sub BindData()
    Const SQL_CONNECTION_STRING As String =
    "Server=WA;DataBase=SOLLI;user=sa;password=''"
    Dim conConnection As New SqlConnection(SQL_CONNECTION_STRING)
    Dim strSQL As String
    strSQL = "xWEBRSM_SelectInvoices"

    Dim cmdReport As New SqlCommand(strSQL, conConnection)
    cmdReport.CommandType = CommandType.StoredProcedure

    Dim prmSiteID As SqlParameter =
    cmdReport.Parameters.Add("SiteID", SqlDbType.Char, 10)
    prmSiteID.Value = "S000766"

    Dim myAdapter As New SqlDataAdapter(cmdReport)
    Dim ds As New DataSet
    myAdapter.Fill(ds)

    conConnection.Close()
    Datagrid1.DataBind()
    End Sub

    </script>
    <mobile:form id="Form1" runat="server">
    <mobile:ObjectList id="ObjectList1" runat="server"
    LabelStyle-StyleReference="title"
    CommandStyle-StyleReference="subcommand"></mobile:ObjectList>
    <mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
    <Choice
    Xmlns="http://schemas.microsoft.com/mobile/html32template">
    <HeaderTemplate>
    <asp:DataGrid id="DataGrid1" runat="server">

    </asp:DataGrid>
    </HeaderTemplate>
    </Choice>
    </mobile:DeviceSpecific>
    </mobile:form>
    </body>

    TJ Guest

  2. #2

    Default Re: Datagrid control in asp.net mobile web application

    A Correction:
    conConnection.Close()
    Datagrid1.datasource=ds
    Datagrid1.DataBind()

    TJ Guest

Similar Threads

  1. To Control the application
    By palaksha@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 1
    Last Post: November 28th, 12:59 PM
  2. Datagrid and IE Control Toolbar Composite Control
    By King Kong in forum ASP.NET Building Controls
    Replies: 0
    Last Post: December 20th, 06:23 AM
  3. Replies: 1
    Last Post: December 5th, 07:22 PM
  4. Replies: 0
    Last Post: July 21st, 12:52 PM
  5. How to install the Mobile Server Control Center?
    By TimMcConechy in forum Oracle Server
    Replies: 0
    Last Post: December 19th, 02:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139