You can use the following code to bind data to a gridview in mobile apps:
In .aspx page:
<mobile:Form id="Form1" runat="server" Paginate="true" >
<mobile:DeviceSpecific ID="mobdevspec" Runat="Server" >
<Choice Xmlns="http://schemas.microsoft.com/mobile/html32template">
<HeaderTemplate>
<asp:GridView ID="GridView1" runat="server"></asp:GridView>
</HeaderTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Form>
In .aspx.cs file:
GridView gv = (GridView)Form1.Controls[0].FindControl("gridview");
// gv.GridLines = true;
SqlConnection con = new SqlConnection("Data Source=WINSERVER;Initial Catalog=sampleDB;User Id=orbtest; password=hyderabad");
con.Open();
string sqlquery = "SELECT * FROM anderson";
SqlCommand command = new SqlCommand(sqlquery, con);
SqlDataAdapter adpa = new SqlDataAdapter(command);
DataTable dt = new DataTable();
adpa.Fill(dt);
gv.DataSource = dt;
gv.DataBind();
con.Close();