alpha paging and data grid??

B

Brian Ciarcia

Can someone please tell me why this is not working??? I used a sample
that I found and it works great with the pubs database, however, as
soon as I change it to the live database, it dies.. I know that all
the columns are there and are correct.. thanks in advance

Source Error:

Line 31: Cmd.Fill(ds,"Attys")
Line 32: MyDataGrid.Datasource=ds.Tables("Attys").DefaultView
Line 33: MyDataGrid.DataBind()
Line 34:
Line 35: End Sub

Stack Trace:


[HttpException (0x80004005): A field or property with the name
'l_name' was not found on the selected datasource.]
System.Web.UI.WebControls.BoundColumn.OnDataBindColumn(Object
sender, EventArgs e) +350
System.Web.UI.Control.OnDataBinding(EventArgs e) +66
System.Web.UI.Control.DataBind() +26
System.Web.UI.Control.DataBind() +86
System.Web.UI.WebControls.DataGrid.CreateItem(Int32 itemIndex,
Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object
dataItem, DataGridColumn[] columns, TableRowCollection rows,
PagedDataSource pagedDataSource) +169
System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean
useDataSource) +1411
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)
+49
System.Web.UI.WebControls.BaseDataList.DataBind() +23
ASP.alpha_aspx.BindData() in
C:\Inetpub\wwwroot\PepeHazard\teststuff\alpha.aspx:33
ASP.alpha_aspx.Page_Load(Object Source, EventArgs E) in
C:\Inetpub\wwwroot\PepeHazard\teststuff\alpha.aspx:17
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
 
A

Alvin Bruney [MVP]

probably the best place to start with this is to read the exception message
and see what it says the problem is. Have you tried that?
 
B

Brian Ciarcia

I can see that it says 'l_name' was not found on the selected
datasource. After that, I have no clue what the rest means. I have to
apologize. I am very new to .net and unfortunately am forced to learn
this all on my own. l_name is a valid field in the database, and I
believe I have it bound correctly in my datagrid. I'm not sure what
else i am missing.
 
A

Alvin Bruney [MVP]

the jitter seems to think that there is no l_name in Attys table. that's
where you start. check the spelling, check the case, trim the variable for
blanks
 
B

Brian Ciarcia

Thanks all. It was actually in my SQL script. I fixed it and it works
great now.. thanks for your help
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top