I have a very starange problem. I am trying to access a value from a datatable by specifying the column on the datarow but it keeps saying
"Column 'BitValue' is not cantained in table 'Fields'"
But it clearly is. All other columns work fine and I can reference it by number but not by name. - FieldsDS = FieldsSqlFactory.ExecuteQuery()
-
FieldsDS.Tables(0).TableName = "Fields"
-
-
Dim AdditionalField As OrderingSpecificField
-
Dim C As Integer = 0
-
While C < FieldsDS.Tables(0).Rows.Count
-
Dim FR As DataRow = FieldsDS.Tables(0).Rows(C)
-
-
'Check For which type of value & Build new Field by passing parameters to constructer
-
Select Case FR("FieldDataType")
-
Case "SpecificFieldDataType.bitValue"
-
AdditionalField = New OrderingSpecificField(FR("ParentId"), FR("FieldIdentifier"), SpecificFieldDataType.bitValue, FR("FieldName"), FR("BitValue"), FR("TextValue"))
-
Case "SpecificFieldDataType.dateValue"
-
AdditionalField = New OrderingSpecificField(FR("ParentId"), FR("FieldIdentifier"), SpecificFieldDataType.dateValue, FR("FieldName"), FR("DateValue"), FR("TextValue"))
-
Case "SpecificFieldDataType.floatValue"
-
AdditionalField = New OrderingSpecificField(FR("ParentId"), FR("FieldIdentifier"), SpecificFieldDataType.floatValue, FR("FieldName"), FR("FloatValue"), FR("TextValue"))
-
Case "SpecificFieldDataType.intValue"
-
AdditionalField = New OrderingSpecificField(FR("ParentId"), FR("FieldIdentifier"), SpecificFieldDataType.intValue, FR("FieldName"), FR("IntValue"), FR("TextValue"))
-
Case "SpecificFieldDataType.cboKeyValue"
-
AdditionalField = New OrderingSpecificField(FR("ParentId"), FR("FieldIdentifier"), SpecificFieldDataType.cboKeyValue, FR("FieldName"), FR("CboKey"), FR("TextValue"))
-
Case Else
-
AdditionalField = New OrderingSpecificField(FR("ParentId"), FR("FieldIdentifier"), SpecificFieldDataType.txtValue, FR("FieldName"), FR("TextValue"), FR("TextValue"))
-
End Select
-
-
'add to Sample's collection of fields
-
SampleFields.Add(AdditionalField)
-
C += 1
-
End While
It is the first case statement that causes problems.
If ANYONE could hepl I would much appreciate it.
2 2555
What database and platform are you using?
Thanks for your reply.
But I got it working.
Stupid error managed to give the column a title of " BitValue" instead of "BitValue". DOH!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John Latten |
last post by:
Hi there,
I have got a problem when adding extra (= dummy) columns to a datagrid.
I have a datagrid that is bound to a datatable. The datatable is filled with data from a SQL Server 2000...
|
by: Robert Schuldenfrei |
last post by:
Dear NG,
After being away from C# programming for a spell, I am trying my hand at
what should be a simple task. I have been hitting my head against the wall
this morning. I have a simple order...
|
by: MattB |
last post by:
I know I can use dataviews and more looping to do this, but I'm
wondering if there's a more elegant or more concise way to do this.
I've got two DataTables with a column called guest_no. I'd love...
|
by: Gene Hubert |
last post by:
I'm using DataTable.ImportRow to move data from one datatable to
another...
Dim dt, dtTarget As DataTable
Dim dr As DataRow
dt = DirectCast(Me.DataSource, DataTable)
dtTarget = dt.Clone...
|
by: JohnR |
last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a
datagridtablestyle defined. I use the datagridtablestyle to change the
order of the columns (so they can be different than...
| |
by: RSH |
last post by:
Hi,
Iam struggling with an application where I am trying to transfer a datarow
from one sql server to another instance of sql server. The schmeas may be
slightly different and I am getting an...
|
by: orenl |
last post by:
I have a DataRow (from DataTable) and i want to get data from a column
name that might not exist.
public static object getObject(DataTable dataTable, int index,
string columnName)
{
return...
|
by: =?Utf-8?B?TWlrZSBE?= |
last post by:
I read the CSV file into a DataTable. This is so I can fix invalid dates
and other data I don't want in the database. Then I use SqlBulkCopy to
insert the data into the SQL database. All the...
|
by: evan1979.2 |
last post by:
I am creating a new boolean column in a MSAccess .mdb database like
this:
Dim Cmd As New OleDb.OleDbCommand("ALTER TABLE m_table ADD boolColumn
YesNo", objConn)
Cmd.ExecuteNonQuery()
, which...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |