473,378 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Select string as a column name in datatable?

Hi,

I have problem using the string I declared in selecting the column in my
datatable.
Please could you tell me am I doing something incorrect?
Here is my code:

Dim myString As String

Dim dv As DataView = New DataView(dsDataSet.Tables("myTable"), _
" '" & myString & "' = '" & otherString & "'", "",
DataViewRowState.CurrentRows)

It compiles without problem,
but when I run it, It returns nothing from my dataview.

Can anyone help please, many thanks
Nov 21 '05 #1
3 1053
missed type.

the 1st line should be:

Dim myString As String = "Name"
Nov 21 '05 #2
Solved.

case closed.

Nov 21 '05 #3
Jonhathan,

Although I often make instructions where other would use more lines, I never
do that with the dataview. Splitsing it up in three lines makes that much
less error sensitive.

dim dv as new dataview(mytable)
dv.sort = "mysort"
dv.rowfilter = "mysort = 1"

I hope this helps?

Cor

"Jonathan" <Jo******@discussions.microsoft.com> > Solved.

case closed.

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Luc | last post by:
I am using Visual Studio 2003 and am getting lousy performance after using a datatable select and then trying to assign a value to a column of the row that was found: DataTable dt = new...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
0
by: Vagabond Software | last post by:
I posted this problem earlier and now have more information. I use the DataTable Select method to get find the most recent "LastModified" date in a table of similarly named files. I then use the...
12
by: Doug Bell | last post by:
Hi, I am having problems trying to create a (temporary) DataTable from a selection from a DataGrid (dgOrders). dtOrdDetails is declared as a Public DataTable Sub is: Dim stFilter as String...
7
by: wk6pack | last post by:
Hi, How do I check datatable.select(filter) in the following: for each dtrow in datatable.select(filter) .... next I've also tried:
11
by: MurdockSE | last post by:
Greetings. My Situation: // I have an .xml file that I am reading into a dataset in the following code - DataSet ds = new DataSet("MyDataset"); ds.ReadXml(@"c:\data\"+cmyxmlfilename);
4
by: tshad | last post by:
How do I tell DataAdapter that Column 2 and 3 are string and not integer? Following is the example data that comes from the .csv file FEDERAL TAX,1084,0000 COREHCR,1084,0000 CLIENT P,1084,0000...
4
by: Massimo | last post by:
Hi to All, i'm using C# in .NET 2.0 and i have a DataTable A with a column of type TimeSpan used to store HOUR info. I'm trying to filter my DataTable A selecting only rows that have the column...
4
by: ArunDhaJ | last post by:
Hi, I've to filter rows from DataTable Select There is a column named "Phone" which contains values in the following format: (901) 789 1234<BR>(901) 789 1235<BR>(901) 789 1221 I need to...
4
by: DaveL | last post by:
how to uppercase a table columen in datatable select //dt is a Datatable i Need to uppercase control.text and table column data i dont know how to set loginname to upper case if...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.