Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
How to use Array.IndexOf() to search a column in a datatable
Ray Sotkiewicz
Jan 2 2011 2:24 AM
1.9k
Reply
I want to search a column in a datatable for a specific value.
In a separate loop I have:
if
(ContainsViaIndex(dataconfig.data.Tables[0].Columns[1], Device0Loop))
{
MessageBox
.Show(
"HOLY CRAP!!"
);
}
And then...
public
static
bool
ContainsViaIndex(
DataObject
data,
int
value)
{
return
Array
.IndexOf(data, value) > -1 ?
true
:
false
;
}
My problem (Total noob at this), is how to define what "DataObject data" is...
I am getting the following error in my compiler:
Error 2 Argument '1': cannot convert from 'System.Data.DataColumn' to 'System.Windows.Forms.DataObject' D:\Joystick to FSUIPC converter\TestConsoleForm.cs 672 41 UIPC_SDK_CSHARP
So.. what kind of 'type" should I use?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
While passing data parameter from application getting exception.
memory management and variables