Function to Clone DataView with new sort column(s)

I have a filtered DataView and I wanted to search it using different keys that was used for sorting.

Ther is no function out-of-the-box, so I created a helper method

public static DataView CloneDataView(DataView vwSource,string newSort)

{

          return new DataView(vwSource.Table ,vwSource.RowFilter,newSort,vwSource.RowState) ;

}

 

Change NullValue behavior for generated Typed Datasets in Visual Studio 2005.

Update: I found that the issue with similar solution is already discussed in “Setting NullValue property for typed dataset”  blog

In generated Typed Datasets attempt to access field with DBNull value by default throw an exception. It is usually  not convinient, and I prefer to change nullValue annotation to _null,  as it was suggested here

However I didn't find a way to change the default(Anyone knows???).

I have to open each column in desigher and change the  nullValue to _null.

Alternatively I have to open .XSD file in XML editor (rigth mouse click,“open with...“,”XML editor” - no XML Vew tab in VS 2005 as it was in VS 2003) and insert ="_null" to each column.

msprop:nullValue

You cah try global replace

type="xs:string"    to

msprop:nullValue="_null" type="xs:string" 

Note, that you can NOT assign _null to simple types, like int or bool.


It is not very convinient process.

Related request in MS Connect:Allow Null Values to be returned from strongly typed datasets .

Partial classes in .Net 2.0 do not allow to split property into different classes

I've started to use partial classes features and wanted to add set property to the read-only property (with get only) generated by VS.

But it is not allowed, which is fair enough.

So to add “set” functionality I have to create method or property with different name.

«March»
SunMonTueWedThuFriSat
2627281234
567891011
12131415161718
19202122232425
2627282930311
2345678