---
title: "Vad göra? med: A field or property with the name 'ActivityID' was not found..."
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/152176-vad-göra-med-a-field-or-property-with-the-name-activityid-was-not-found"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "T_Codez"
published: "2006-10-06T09:37:51.000Z"
updated: "2006-10-06T09:45:06.000Z"
replies: 1
views: 708
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/152176-vad-göra-med-a-field-or-property-with-the-name-activityid-was-not-found"
---

# Vad göra? med: A field or property with the name 'ActivityID' was not found...

## #1 — T_Codez, 2006-10-06T09:37Z

Vad göra med detta!? 

```
[B]A field or property with the name 'ActivityID' was not found on the selected datasource. [/B] Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: A field or property with the name 'ActivityID' was not found on the selected datasource.

Source Error: 

 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 	 

Stack Trace: 

 

[HttpException (0x80004005): A field or property with the name 'ActivityID' was not found on the selected datasource.]
   System.Web.UI.WebControls.BoundColumn.OnDataBindColumn(Object sender, EventArgs e) +348
   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) +1408
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +48
   System.Web.UI.WebControls.BaseDataList.DataBind() +23
   TBServer.Region_default11.dropDownAktivitet_SelectedIndexChanged(Object sender, EventArgs e) in Y:\Inetpub\wwwroot\site\region\functions\sch\default.aspx.vb:888
   System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
   System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
   System.Web.UI.Page.RaiseChangedEvents() +115
   System.Web.UI.Page.ProcessRequestMain() +1099
```

Hur kommer jag förbi detta felmess?  Har provat så många varianter nu, så jag knappt vet vad jag heter... Just dont get it!   :bla   :( 

Jag är övertygad om att det är fel på propertyn i datagriden iom att fältet finns i tabellen. Jag har ett ColumnName: Aktivitet och till den har jag ett Datafield: ActivityID  (en integer)

Miljö:
SQL2000
VS2003
Vers. 1.1

Alla uppslag är välkomna

Permalänk: https://www.webforum.nu/p/152176

## #2 — T_Codez, 2006-10-06T09:45Z

Hittade felet...    :birp 

Ibland såräker det med att skriva hit...

hade:
 dt.Columns.Add(New DataColumn("AktivityID", GetType(String)))

som ska vara:
 dt.Columns.Add(New DataColumn("ActivityID", GetType(String)))

\*suck\*
Varför är det alltid de enklaste felen som är svårast att hitta? 

Tack för uppmärksamheten iaf.   :e

Permalänk: https://www.webforum.nu/p/1877758

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/152176-vad-göra-med-a-field-or-property-with-the-name-activityid-was-not-found
