DataGrid etc does not display when using VS.NET server controls

This thing is driving me nuts! I know you should be able to do it with code but I want to be able to drag a dataadapter onto a page, set up the dataset from that and bind it to a datagrid without writing a line of code. Everytime I do it whether I am using a remote SQL Server or a local MSDE for the datasouce all I get is a blank page. The source contains the form and the __VIEWSTATE and that is it.

If I add in the pageload codebehind datagrid1.databind() then I get the column headings and that is all.
Any ideas?
Regards,
DaveB
0
TheScream
12/23/2002 12:22:27 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

6 Replies
727 Views

Similar Articles

[PageSpeed] 51

You always have to call DataBind, that's for sure.

If you are getting the column headings, but no data, then make sure your SQL statement is correct. If the SQL statement was invalid, then you wouldn't have even gotten that much. Your query is probably valid, but there are no rows that match your search criteria (in the "WHERE" clause).
Blog: http://weblogs.asp.net/LeftSlipper/
0
eilon
12/23/2002 1:51:05 AM
Ahhh... it looks like the VS stuff doesn't fill the dataset. Why is that? It does EVERYTHING else for you.... or did I boo-boo?

Thanks for the hints.
0
TheScream
12/23/2002 9:57:15 AM
Well first, don't expect VS to start writing your apps for you - it just makes it easier. But how about showing what code you have in your .aspx files and in your codebehind file?
Blog: http://weblogs.asp.net/LeftSlipper/
0
Eilon
12/23/2002 5:34:20 PM
I've same problem, the result I get is just a blank page.

I'm very new to ASP.Net and it is my first code. I'm using Visual
Studio.Net.
Code Behind:

Public Class WebForm1
**CENSORED!!** (default vs.net codes without change)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
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>

0
noghte
11/15/2003 10:42:27 PM
To noghte

find the file in
C:\WINNT\Microsoft.NET\Framework\v1***\aspnet_regiis.exe
use the command: aspnet_regiis.exe -u ---> to uninstall current asp.net version.
use the command: aspnet_regiis.exe -i ---> to install current asp.net version.
HTH

Sushila Bowalekar Patel
Visual ASP/ASP.NET MVP
http://weblogs.asp.net/sushilasb
0
SushilaSB
11/15/2003 10:44:28 PM
Thanks SushilaSB,

But the problem was easier than what I thought!
People in a usenet answered me I've to put:

Page.Controls.Add(control as object)

at the end of CodeBehind.
And in this example:

Page.Controls.Add(DataGrid1)

Thanks Again :)
0
noghte
11/15/2003 10:57:35 PM
Reply:

Web resources about - DataGrid etc does not display when using VS.NET server controls - asp.net.presentation-controls

Want to preview our new DataGrid for Xamarin.Forms?
tl;dr Zumero.DataGrid is a Xamarin.Forms control for displaying data in rows and columns. If you would be interested in testing and previewing ...

Mad King DataGrid
This post is about scrolling in WPF and the egocentric DataGrid control. I’ll give the project background but if all you’re interested in is ...

Stack Overflow
Stack Exchange log in - careers - chat - meta - about - faq Questions Tags Users Badges Unanswered Ask Question Top Questions interesting 295 ...

Microsoft Silverlight - Wikipedia, the free encyclopedia
Microsoft Silverlight is an application framework for writing and running rich Internet applications , with features and purposes similar to ...

Flash Builder Plug-in for SAP Netweaver Gateway - Adobe Labs
Search Navigation Labs Home Wiki Home Technologies Alchemy Blueprint Camera Profiles and DNG Profile Editor Cirrus ColdFusion 10 DNG Codec Fireworks ...

Casaba Security » Products » X5s Testing Tool For Finding XSS Vulnerabilities
Security analysis, consulting, development and testing partners who understand your business strategy.

CodeGuru - Microsoft developers related ideas, articles, tips, tricks, comments, downloads, and so much ...
CodeGuru is where developers can come to share ideas, articles, questions, answers, tips, tricks, comments, downloads, and so much more related ...

Caliburn Micro: WPF, Silverlight, WP7 and WinRT/Metro made easy.
A small, yet powerful framework designed for WPF, Silverlight and WP7. It implements a variety of UI patterns for solving real-world problems. ...

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 11 Jul 2012

license-discuss@opensource.org: 11636: first draft of license proliferation committee report
FYI,the first draft report of the OSI's License Proliferation Committee.To join the OSI's license proliferation discuss email list, send anemail ...

Resources last updated: 1/17/2016 3:28:02 AM