Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 699

Gridview doesnt show in IE WHY ???

$
0
0
Gridview will not appear in IE.
Why I do not know. HELP !!!!!
VS 2010 and IE9

ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Create Batch</title>
</head>
<body>
<h1>
Test Create Batch
</h1>
<form id="form1" runat="server">
<div>
Hallo
<asp:GridView ID="GridViewI" runat="server"
RowHeaderColumn="ID" Width="464px" AutoGenerateColumns="False">
<HeaderStyle BackColor="#00CC00" Font-Bold="true" ForeColor="White" />
<Columns>
<asp:BoundField DataField="id" HeaderText="Id" />
<asp:BoundField DataField="code" HeaderText="Parent Code" />
<asp:TemplateField HeaderText="Code">
<ItemTemplate>
<asp:TextBox ID="txtLocation" runat="server" BackColor="#66FFFF" BorderColor="Black" BorderStyle="Ridge" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Halo 2
</div>
</form>
</body>
</html>


ASPX.vb
Imports System.Data
Imports System.Data.SqlClient


Partial Class VBCode
Inherits System.Web.UI.Page

' This method is used to bind gridview from database
Protected Sub BindGridview()

Dim dt As DataTable
' Dim SQL As String = "select TOP 10 itemee.id ID, itemee.code icode,parentitem.code picode" +
' " from itemee,itemee parentitem" +
' " where itemee.item_id=parentitem.id"

Dim SQL As String = "select TOP 10 id, code, status from itemee"



Dim sConstr As String = ConfigurationManager.ConnectionStrings("DBConnection").ConnectionString
Using conn As SqlConnection = New SqlConnection(sConstr)
Using comm As SqlCommand = New SqlCommand(SQL, conn)
conn.Open()
Using da As SqlDataAdapter = New SqlDataAdapter(comm)
dt = New DataTable("tbl")
da.Fill(dt)
End Using
End Using
End Using

GridViewI.DataSource = dt
GridViewI.DataBind()

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
BindGridview()
End If
End Sub

Private Function GridViewI() As Object
Throw New NotImplementedException
End Function

End Class


Thanks Jim

Viewing all articles
Browse latest Browse all 699

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>