Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid Lost

Status
Not open for further replies.

BiniamTek

IS-IT--Management
May 16, 2003
22
0
0
US
I have just upgraded my system from VS .NET 2002 to 2003. When I run my Web App that reads and displays data into a DataGrid from a SQL server, the DataGrid is no longer there.

I had deployed my 2002 file and even the is not longer displaying the DataGrid.

Did the upgrade mess up with IIS?

Please help.

Thanks.
 
Do you mean that your datagrid is no longer visible in the designer, or just doesn't appear when rendering in the browser?

D
 
It is visible in designer but lost at run time (in Browser). I believe that the Database is not accessed and I do not know why or how to fix it.
 
Have you stepped through the code to make sure that you're getting the data properly?

D
 
Did you see if .NET IDE removed your Me.SqlConnection.ConnectionString = "YOUR CONNECTION STRiNG"
under the #Region " Web Form Designer Generated Code " preprocessor directive? It is continually removing mine everytime I click on the datagrid or datalist, which causes my datagrid not to appear at runtime.
 
Just an aside:

you probably shouldn't be storing the connection string there anyway. Typically, they're best stored in:
- web.config
- encapsulated in a class
- available as a constant declared in a module

If you place it in the web form designer code region, not only can freaky stuff like what you described happen, but you can only access it from that page, meaning you'd have to re-declare it for each aspx page you have.

hth

D'Arcy
 
I agree and mine is stored in the web.config
I am using it as:
Code:
Me.SqlConnection.ConnectionString = Application("gLeedsDataSource")
, but the IDE keeps removing it.
 
ksbrace

I think what you need is a service pack from microsoft.com for datagrid/data loss.

Mine is also in Web.config and it is not removed.

I just solved my problem by redoing the whole project again with copy/paste of all my WebForms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top