Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2003, 12:17 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default Data Binding Problem

Hello All,

   I have created a Stored Procedure to pull back some data that I need. I use a SQLDataAdapter and generate a data set. I then go through the process of binding textboxes to my dataset. However when I run the page I get the error that 'Tables[dbo.' is not a valid indexed expression. I did not change anything, this is the table name created when generating the dataset. ( here is the code from the HTML view

Text='<%# DataBinder.Eval(DsPatientDetails1, "Tables[dbo.CaseManagementCMSGetPatientDetails].DefaultView.[0].HICNumber") %>'

What is the problem?
Can I change the default table name when I create the dataset?

Thanks...


 
Old December 18th, 2003, 12:49 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

dbo.CaseManagementCMSGetPatientDetails needs to be quoted... maybe this works?

Text='<%# DataBinder.Eval(DsPatientDetails1, "Tables['dbo.CaseManagementCMSGetPatientDetails'].DefaultView.[0].HICNumber") %>'


Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 18th, 2003, 12:50 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Just realized, you could use a table index to avoid needing to quote a string inside a quoted string...

Text='<%# DataBinder.Eval(DsPatientDetails1, "Tables[0].DefaultView.[0].HICNumber") %>'


Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 18th, 2003, 01:03 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Well I am using their wizard and that is what they gave me, and it dosen't work. Suprise!..lol

so I stripped off the dbo. and just used the table name.... I didn't get an error, but got no data back ....

So, using your advice and someone else's.. I used Table[0], and that worked.....

the wonderful workings of MS....

Thanks for your help!!!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem data binding DateTimePicker to object Bob Bedell C# 2008 aka C# 3.0 1 October 27th, 2008 06:44 PM
Problem with binding XMl data into nested repeater vishnu108mishra XML 0 November 19th, 2007 03:53 AM
Problem with binding data in Datagrid Samatha ASP.NET 1.0 and 1.1 Professional 6 December 6th, 2006 09:13 AM
Weird Combo Box Data Binding Problem [email protected] VB.NET 1 February 12th, 2005 04:52 PM
problem in binding data vijjum3 General .NET 1 December 29th, 2004 08:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.