"Marina" <mzlatkina@hotmail.com> wrote in message
news:uJ85rX8qDHA.3256@tk2msftngp13.phx.gbl...
> All you did was create a DataGrid object in memory. You never actually
added
> it to the page's controls collection.
>
> "Saber S" <soleimani@parstech.net> wrote in message
> news:ORSsvb7qDHA.2304@TK2MSFTNGP11.phx.gbl...
> > I'm very new to ASP.Net and it is my first code. I'm using Visual
> > Studio.Net.
> > When I run this code I see a blank page in browser (pasted at the end of
> > this email)
> > what's wrong?
> >
> >
> > Public Class WebForm1
> >
> > **CENSORED!!** (default vs.net codes without change)
> >
> > Dim connect As New
> > System.Data.OleDb.OleDbConnection("Provider=SQLOLEDB.1;Password=;User
> > ID=saber;Initial Catalog=persiantools;Data Source=localhost;")
> > Dim SQLstr As String = "SELECT * FROM polltable "
> > connect.Open()
> > Dim myDataAdapter As New System.Data.OleDb.OleDbDataAdapter(SQLstr,
> connect)
> > Dim myDataSet As New DataSet
> > myDataAdapter.Fill(myDataSet, "polltable")
> > DataGrid1 = New DataGrid
> > DataGrid1.DataSource = myDataSet.Tables("polltable")
> > DataGrid1.DataBind()
> > connect.Close()
> > End Sub
> > End Class
> >
> >
> >
> > <THE RESULT I GET>
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML>
> > <HEAD>
> > <title>WebForm1</title>
> > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > <meta name="vs_defaultClientScript" content="JavaScript">
> > <meta name="vs_targetSchema"
> > content="
http://schemas.microsoft.com/intellisense/ie5"> > > </HEAD>
> > <body MS_POSITIONING="GridLayout">
> > <form name="Form1" method="post" action="WebForm1.aspx" id="Form1">
> > <input type="hidden" name="__VIEWSTATE"
> > value="dDw....CENSORED!..9KeoZNvUDg==" />
> >
> > </form>
> > </body>
> > </HTML>
> >
> >
>
>