My grid is not display on net

Discussion in 'ASP .Net Web Controls' started by hussain abbas, Jun 2, 2004.

  1. hello
    can n e one tell me if i m runing my project on locally so my grid is showing data but when i upload my page on net so it have'nt show my datagrid wut will be the problem ..hers my code is ..
    plz reply at this address
    Public Class Custome
    Inherits System.Web.UI.Pag
    Dim myConn As OleDbConnectio
    Dim DBRead As OleDbDataReade
    Dim DBComm As OleDbComman
    Protected WithEvents VAlidataName As System.Web.UI.WebControls.RequiredFieldValidato
    Dim strSQL As Strin
    #Region " Web Form Designer Generated Code
    'This call is required by the Web Form Designer
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent(
    End Su

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Ini
    'CODEGEN: This method call is required by the Web Form Designe
    'Do not modify it using the code editor
    InitializeComponent(
    End Su
    #End Regio
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
    'Put user code to initialize the page here..
    GetConnection(
    FillCompanyCombo(
    LockFields(
    If Not Page.IsPostBack The
    BindData(
    End I
    End Su

    Sub GetConnection(
    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("\newsasia\Database\NewsAsiaNET.mdb"
    myConn = New OleDbConnection(strConn
    myConn.Open(
    End Su

    Sub BindData(
    '2. Create the command object, passing in the SQL strin
    Const strSQL As String = "SELECT CustomerID,customername, Address, City,zip,Phone, Email FROM customers
    DBComm = New OleDbCommand(strSQL, myConn
    'Set the datagrid's dastasource to the datareader and databin
    DBRead = DBComm.ExecuteReader(

    dgPopular.DataSource = DBRea
    dgPopular.DataBind(
    DBRead.Close(
    End Su
    hussain abbas, Jun 2, 2004
    #1
    1. Advertising

  2. most likely. your grid doesn't have data in it so it doesn't show up. put a
    check before you bind to the grid to check for data

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "hussain abbas" <> wrote in message
    news:...
    > hello
    > can n e one tell me if i m runing my project on locally so my grid is
    > showing data but when i upload my page on net so it have'nt show my
    > datagrid wut will be the problem ..hers my code is ...
    > plz reply at this address
    > Public Class Customer
    > Inherits System.Web.UI.Page
    > Dim myConn As OleDbConnection
    > Dim DBRead As OleDbDataReader
    > Dim DBComm As OleDbCommand
    > Protected WithEvents VAlidataName As
    > System.Web.UI.WebControls.RequiredFieldValidator
    > Dim strSQL As String
    > #Region " Web Form Designer Generated Code "
    > 'This call is required by the Web Form Designer.
    > <System.Diagnostics.DebuggerStepThrough()> Private Sub
    > InitializeComponent()
    > End Sub
    >
    > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Init
    > 'CODEGEN: This method call is required by the Web Form Designer
    > 'Do not modify it using the code editor.
    > InitializeComponent()
    > End Sub
    > #End Region
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > 'Put user code to initialize the page here...
    > GetConnection()
    > FillCompanyCombo()
    > LockFields()
    > If Not Page.IsPostBack Then
    > BindData()
    > End If
    > End Sub
    >
    > Sub GetConnection()
    > Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;data
    > source=" & Server.MapPath("\newsasia\Database\NewsAsiaNET.mdb")
    > myConn = New OleDbConnection(strConn)
    > myConn.Open()
    > End Sub
    >
    > Sub BindData()
    > '2. Create the command object, passing in the SQL string
    > Const strSQL As String = "SELECT CustomerID,customername, Address,
    > City,zip,Phone, Email FROM customers"
    > DBComm = New OleDbCommand(strSQL, myConn)
    > 'Set the datagrid's dastasource to the datareader and databind
    > DBRead = DBComm.ExecuteReader()
    >
    > dgPopular.DataSource = DBRead
    > dgPopular.DataBind()
    > DBRead.Close()
    > End Sub
    >
    Alvin Bruney [MVP], Jun 3, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TGVv?=

    Data Grid will not display

    =?Utf-8?B?TGVv?=, Apr 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    406
    Steven Cheng[MSFT]
    Apr 20, 2004
  2. Girish
    Replies:
    4
    Views:
    641
    Patrick.O.Ige
    Jul 19, 2005
  3. =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=

    How to transfer a value from an Invisible Grid to an visible Grid

    =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=, Oct 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    445
    =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?=
    Oct 17, 2005
  4. Danny Tuppeny

    Grouped grid? Or grid within datalist?

    Danny Tuppeny, Oct 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    473
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Oct 27, 2005
  5. sed_y
    Replies:
    0
    Views:
    953
    sed_y
    Feb 15, 2012
Loading...

Share This Page