Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > Datagrid control in ASP.Net mobile application

Reply
Thread Tools

Datagrid control in ASP.Net mobile application

 
 
TJ
Guest
Posts: n/a
 
      05-03-2005

I want to use the datagrid control in an ASP.Net mobile web application
..

IS it possible to use it in mobile applications???

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.SqlClie*nt" %>
<HEAD>
<...
<meta
content="http://schemas.microsoft.com/M*obile/Page"name="vs_targetSchema">

</HEAD>
<body Xmlns:mobile="http://schemas.microsoft.com/M*obile/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_S*TRING)
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("@Sit*eID", SqlDbType.Char, 10)
prmSiteID.Value = "S000766"


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


conConnection.Close()
DataGrid1.DataSource=ds
Datagrid1.DataBind()
End Sub


</script>
<mobile:form id="Form1" runat="server">
<mobile:ObjectList id="ObjectList1" runat="server"
LabelStyle-StyleReference="tit*le"
CommandStyle-StyleReference="s*ubcommand"></mobile:ObjectList*>
<mobileeviceSpecific id="DeviceSpecific1" runat="server">
<Choice
Xmlns="http://schemas.microsoft.com/m*obile/html32template">
<HeaderTemplate>
<aspataGrid id="DataGrid1" runat="server">


</aspataGrid>
</HeaderTemplate>
</Choice>
</mobileeviceSpecific>
</mobile:form>
</body>

 
Reply With Quote
 
 
 
 
Leon
Guest
Posts: n/a
 
      06-24-2005
use objectlist instead
"TJ" <(E-Mail Removed)> ????
news:(E-Mail Removed) ups.com...

I want to use the datagrid control in an ASP.Net mobile web application
..

IS it possible to use it in mobile applications???

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.SqlClie*nt" %>
<HEAD>
<...
<meta
content="http://schemas.microsoft.com/M*obile/Page"name="vs_targetSchema">

</HEAD>
<body Xmlns:mobile="http://schemas.microsoft.com/M*obile/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_S*TRING)
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("@Sit*eID", SqlDbType.Char, 10)
prmSiteID.Value = "S000766"


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


conConnection.Close()
DataGrid1.DataSource=ds
Datagrid1.DataBind()
End Sub


</script>
<mobile:form id="Form1" runat="server">
<mobile:ObjectList id="ObjectList1" runat="server"
LabelStyle-StyleReference="tit*le"
CommandStyle-StyleReference="s*ubcommand"></mobile:ObjectList*>
<mobileeviceSpecific id="DeviceSpecific1" runat="server">
<Choice
Xmlns="http://schemas.microsoft.com/m*obile/html32template">
<HeaderTemplate>
<aspataGrid id="DataGrid1" runat="server">


</aspataGrid>
</HeaderTemplate>
</Choice>
</mobileeviceSpecific>
</mobile:form>
</body>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone4,iPhone3,Ipad,Apple Mobile,Blackberry Mobile,HTC Mobile,LGMobile,Motorola Mobile,Nokia Mobile,Samsung Mobile chen selina C++ 0 07-13-2010 08:53 AM



Advertisments