473,799 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataTable Select

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 (dt.Select("log inname='"+this. txLoginName.Tex t.ToUpper()+"'" ).Length>)
{
// Do Somthing
}

DaveL

Sep 15 '08 #1
4 5821
On Sep 15, 11:21*am, "DaveL" <dvs_...@sbcglo bal.netwrote:
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 (dt.Select("log inname='"+this. txLoginName.Tex t.ToUpper()+"'" ).Length>)
{
* * // Do Somthing

}

DaveL
The Select method returns an array of DataRows. It won't work in your
'if' statement.

-Rusty
Sep 15 '08 #2
it works just fine in my if statement
I Reference the Returned array length at the end of the if

example works just fine

if (dtRows.Select( "Name <>'"+txName.Tex t.Trim().ToUppe r()+"'").Length >
0)
{
Console.WriteLi ne("Found");
}
else
{
Console.WriteLi ne("Not Found");
}
Console.ReadKey ();
I still dont know how to upperCase the Name Column in the Select
DaveL


"rustylee" <ru************ @gmail.comwrote in message
news:bb******** *************** ***********@b30 g2000prf.google groups.com...
On Sep 15, 11:21 am, "DaveL" <dvs_...@sbcglo bal.netwrote:
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 (dt.Select("log inname='"+this. txLoginName.Tex t.ToUpper()+"'" ).Length>)
{
// Do Somthing

}

DaveL
The Select method returns an array of DataRows. It won't work in your
'if' statement.

-Rusty
Sep 15 '08 #3
On Sep 15, 12:10*pm, "DaveL" <dvs_...@sbcglo bal.netwrote:
it works just fine in my if statement
I Reference the Returned array length at the end of the if

example works just fine

* * if (dtRows.Select( "Name <>'"+txName.Tex t.Trim().ToUppe r()+"'").Length >
0)
* * * * * * {
* * * * * * * * Console.WriteLi ne("Found");
* * * * * * }
* * * * * * else
* * * * * * {
* * * * * * * * Console.WriteLi ne("Not Found");
* * * * * * }
* * * * * * Console.ReadKey ();

I still dont know how to upperCase the Name Column in the Select
DaveL

"rustylee" <rusty.lee.2... @gmail.comwrote in message

news:bb******** *************** ***********@b30 g2000prf.google groups.com...
On Sep 15, 11:21 am, "DaveL" <dvs_...@sbcglo bal.netwrote:
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 (dt.Select("log inname='"+this. txLoginName.Tex t.ToUpper()+"'" ).Length>)
{
// Do Somthing
}
DaveL

The Select method returns an array of DataRows. *It won't work in your
'if' statement.

-Rusty
Sorry, somehow the formattting on my display tricked my eyes. Please
accept my humble apologies.

I will assume you are querying against a database. Would it be
possible to construct the query in your code to perform the
"uppercasin g" in the query:

string commandText = "SELECT UPPER(Name)...F ROM..."

-Rusty
Sep 15 '08 #4
Thats what i'll have to do, if i can't figure out how to
uppercase the column in the Datatable object

Making a trip back to the database is prob a better idea

Thanks
DaveL
Ps. No worries , i see stuff not there or there all the time
thanks again

"rustylee" <ru************ @gmail.comwrote in message
news:64******** *************** ***********@i20 g2000prf.google groups.com...
On Sep 15, 12:10 pm, "DaveL" <dvs_...@sbcglo bal.netwrote:
it works just fine in my if statement
I Reference the Returned array length at the end of the if

example works just fine

if (dtRows.Select( "Name <>'"+txName.Tex t.Trim().ToUppe r()+"'").Length >
0)
{
Console.WriteLi ne("Found");
}
else
{
Console.WriteLi ne("Not Found");
}
Console.ReadKey ();

I still dont know how to upperCase the Name Column in the Select
DaveL

"rustylee" <rusty.lee.2... @gmail.comwrote in message

news:bb******** *************** ***********@b30 g2000prf.google groups.com...
On Sep 15, 11:21 am, "DaveL" <dvs_...@sbcglo bal.netwrote:
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
(dt.Select("log inname='"+this. txLoginName.Tex t.ToUpper()+"'" ).Length>)
{
// Do Somthing
}
DaveL

The Select method returns an array of DataRows. It won't work in your
'if' statement.

-Rusty
Sorry, somehow the formattting on my display tricked my eyes. Please
accept my humble apologies.

I will assume you are querying against a database. Would it be
possible to construct the query in your code to perform the
"uppercasin g" in the query:

string commandText = "SELECT UPPER(Name)...F ROM..."

-Rusty
Sep 15 '08 #5

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

Similar topics

5
2256
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the DataTable first and I then want to roll through the DataTable while in memory checking for errors and then commit the rows to my database table (btw this is in ASP.NET). Is it possible to have data in a datable before attaching at DataAdapter? I'm a...
5
10092
by: Stefan Turalski \(stic\) | last post by:
Hi, I'm wondering if there is a way to send a method parametrs by ref when DataTabel is a type of this value ? I done some sort of select over DataTable columns, just by removing them froma table is each of them isn't on a stirng, but right no I have to do it in a wat of: 1. passing DataTable to method (lets call it SelectOverDataTabel) 2. declare a local (in SelectOver...) DataTable, inicialize it with my value
3
5907
by: nandan | last post by:
Hi, Has any one ever compared the performance of calling a DataTable's Select method with a stored procedure doing the same thing? My point is: dataRows = DataTable.Select(filter) is better or Passing paramters to stored procedure? The datatable holds about 500-700 rows at any given time. If I select one of the approaches the business logic will go into respective layers.With dotnet in picture what would be a good approach
4
2577
by: Kris Rudin | last post by:
I am displaying a table of information on a web page, using an asp:table that I populate dynamically. On this page I give the user the options to group the rows by certain fields, and/or filter the contents on certain fields. The grouping/filtering is "remembered" for each user via a cookie. The problem is works like this: User A applies a filter on Project Manager. User B filters by Department. User B groups by Project Manager (NOTE -...
0
3169
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these datacolumns do not trigger their expression when other columns from which the expressions are derived are updated. Below is a basic example of what I am doing. User enters values into an asp.net form and clicks a button. Retrieve dataset from...
2
8979
by: JohnR | last post by:
Sorry if this is has an obvious answer, but I can't find it... I am using a datatable.select to obtain the rows in a datatable that meet certain criteria. My question is this: for each of the datarows that are returned to me as a result of the datatable.select how can I determine their index in the datatable.rows collection? For those interested in why, it is because the index in the datatable is the same as the index of the same row...
7
14999
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:
6
28331
by: Pete Wittig | last post by:
Hi, I have a DataTable and I want to get a subset of the rows within it. I use the Select method to get my subset and the results are in a DataRow. I want to put those Rows back into a DataTable. I've tried a few variations of the following but no rows are every imported into the datatable: DataRow datrow = ds.Tables.Select("PersonID = " + id); DataTable dt = new DataTable();
1
5742
by: Maxwell2006 | last post by:
Hi, I am working with strongly typed datatables. What is the most efficient way to build a new DataTAble based on the result of DataTable.Select? At this point I use a foreach loop to do the work manually. I am looking for an automated way. Thank you, Max
6
3206
by: fniles | last post by:
I am using VB.NET 2005 and Access database. My program uses a timer that kicks in every 1 min to read from a database and copy the dataset table to a datatable. This database is in a class called clsStat.vb. Then I pass this class to a thread. Each thread will call a function inside the clsStat.vb to do a "Select" of the datatable. Every day around the same time this function that does the select of the databale gets errors like so:...
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
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 we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.