Filtering Values In A DataColumn

dotnet framework

    Next

  • 1. question on sql
    Dear all 1.)How can i save the stored procedure in sql 2005 server, into server and NOT in file location 2.)How can create folder in stored procedure to separate categories? 3.)How can view the created date and modify date of stored pro
  • 2. date/time fields
    Hallo, I know a lot has already been told about date/time fields in a database but still confuses me, specif when dealing with SQLserver(Express). It seems that sqlserver only accepts the date in a "yyyyMMdd" format? (difference between Express and MSDE2000A ?) What is the one and only true way to deal with this problem in VB2005: Local settings are Dutch (Belgium) ; thus date is in "dd/MM/yy" (or perhaps dd/MM/yyyy) and time in "hh:mm:ss" dim MyDateVar as string, MyIdVar as Integer dim MyCommand = New Sqlcommand("",Connection) MyCommand.commandtext = "Update MyTable Set MyDatefield = '" & MyDateVar & "' Where MyIdField = " & MyIdVar = SomeIntegerValue MyCommand.executenonquery How to deal with the MyDateVar when: 1. The Variable comes from a textbox knowing that the user puts in dd/MMyyyy In this case there is no need to have the time with it. 2. The date comes from a datetimepicker control (MyDateVar = DtPicker.Value)? 3. The date and time comes from the system MyDateVar= Format(DateTime.Now, "yyyyMMdd") seems to work but Format(DateTime.Now, "yyyyMMdd.hhmmss") gives a runtime error So, any help and/or suggestion on this will be greatly appreciated. Thanks and greetings to all Jerome
  • 3. TransactionScope and DataSets
    Hi, I'm wondering what the official Microsoft recommendation is for handling TransactionScope transactions when using TableAdapters within a DataSet. I have a dataset that various areas of my business logic uses, and at a higher level I'd like to wrap several business functions in a TransactionScope transaction. The problem is, each TableAdapter has an InitConnection method generated that creates a _new_ Connection to the database. If a second connection gets used within the TransactionScope, the transaction will needlessly be promoted to a distributed transaction. My current workaround is to alter the Dataset.Designer.cs generated file manually to change how Connections are created, but that's somewhat painful sin ce the file gets regenerated automatically. Thanks for any advice, Kirk
  • 4. VB.NET - How do I return an AutoNumber from an Insert Statement using the DataGridView
    Hello, I have a Grid in a VB.Net application which I want to return the Primary Key which is an AutoNumber after I insert a record. The Primary Key Number that I get back is not from SQL Express but from VB and it can be wrong. I have a DataGridView that is bound to my table through my TableAdapter. If I go to Insert a row and then cancel it ups the autonumber that I see in VB. Then if Insert a row and save it, the records AutoNumber is not the same as the SQL AutoNumber. I have been trying to return the ID from SQL using @@IDENTITY but with no success. Any pointers would be much appreciated. Phil

Filtering Values In A DataColumn

Postby Neil » Fri, 22 Aug 2003 20:25:46 GMT

Hi,

I have a table which contains a column called iVolume, 
which contains positive and negative integers. I want to 
get hold of the column iVolume and pass it to a method, 
however I only want the positive values in my DataColumn.

I thought I would be able to accomplish this with the 
Expression property but I get the following error:

"Cannot set Expression property due to circular reference 
in the expression"....

I'm not sure what is going on but my code looks like 
below, does anyone have any idea what I'm doing wrong?

DataColumn datacoumnValues = refDataset.Tables
[TableName].Columns["iVolume"];
			
datacoumnValues.Expression = "iVolume > 0";

Filtering Values In A DataColumn

Postby Neil » Fri, 22 Aug 2003 20:44:07 GMT

Ignore this question I have realised my own silly mistake!
reference 

Similar Threads:

1.filtering data view with row filter using boolean value

say i have a dataset called dv

and i have a boolean value i want to filter by "b_DoesWork"

while the column name in the data view that i want to filter on is called 
"Works" how would i filter this since the rowfilter is a string? i tried

dv.rowfilter = "Works = " & b_DoesWork

and get errors back in the IDE that says

Cannot bind to the new value member. Parameter name: value

when I try to set the value of b_DoesWork through a property. what it does 
is sets the b_DoesWork = value when the property is set then updates the row 
filter to be what i stated above... but that error happens... how would you 
go about doing this with a boolean? and technically i will need 5 boolean 
filters on that same row filter in the end... because 5 properties can be 
set boolean wise on this custom control that will be displaying data based 
on the filtered data thanks! 


2.DataColumn.Expression Filter on Child

I have a field in a parent row that needs to be set to the sum of a
field in its children.  That part is easy enough, as follows:

Sum(Child.ColumnName)

However, I need to filter out some of the children rows for the sum.
So what I want is something like this:

Sum(Child.ColumnName) WHERE Child.OtherColumnName = 'Some String'

I get an error which essentially states that there should be an
operand to the right of "Where"

Any ideas?

Kelly Smith

3.DataColumn Select and DataView Filter Expression Problem

I am trying to create a user enterable filter for a 
datagrid that has a little intelligence.  I would like 
the filter to be capable of the following type of matches:

For this application, the datagrid displays a list of 
Parts with PartID as the key.  An example of a PartID is 
12345-B11.  When a user enters a filter value in an 
attempt to reduce the datagrid to similar PartIDs they 
may enter the PartID as 12345B11.  How do I enter an 
DataView.RowFilter(expression) to accomplish this?  The 
obvious expression would be the following (which works 
fine as a SQL Query), but the .NET Framework doesn't 
support the SQL Replace function:

"Replace(PartID, '-', '') LIKE '%XXXXXX%'"

With Query Analyzer, this produces the desired result.  
How do I accomplish this with a DataView?  I would like 
to avoid either 1) Adding a new column to the DataView 
which stores the value = Replace(PartID, '-', '') or 2) 
spin through the DataView copying the desired rows one at 
a time to a new DataTable.

4.How to add a datacolumn which points to another datacolumn

Hi,

I need to add a datacolumn into a datatable which points to another 
datacolumn in another datatable. I have come across this article but 
forget from where.

Anyone help would be very appreciated. Thanks in advance.

5.binding datacolumn to another datacolumn in a datagrid

i have a datatable 'Users' with two columns:
'FriendlyName'
'UserName'

i have a datagrid with two columns that I want to bind with the
'Authors' table:

'FriendlyName' : ComboBox column populated from another datatable with
two columns (DisplayMember = 'Name' which holds a FriendlyName and
ValueMember = 'ID' which holds a UserName)

'UserName' : TextBox column to be populated (readonly) from the 'ID'
(ValueMember') of the currently selected 'FriendlyName'
(DisplayedMember)

The idea is that when you select a friendly name from the ComboBox, the
'Author' table then holds that name in 'FriendlyName' and the
corresponding 'UserName'.

I have the combobox column working and both column in the grid that are
binding, but how do I bind the 'ValueMember' of the current combobox to
the second column which is also bound to the 'UserName' column of the
original 'Authors' table?

6. Datacolumn Value changing method

7. DataColumn's Unique property (applies also to null values?)

8. Get Original-Value of an DataColumn?



Return to dotnet framework

 

Who is online

Users browsing this forum: No registered users and 52 guest