While DataSets hold a lot of data, sometimes you want to keep track of information about the DataSet itself. You could store information about the dataset in some variable (e.g. the last time you checked the DataSet for changes) but it makes sense to me to store that information with the Dataset itself through its extended properties.
To add an extended property to a DataSet, you go the DataSet's ExtendedProperties collection and add a name and a value. This example adds a property called LastChecked to the ExtendedProperties collection with the current date and time:
Dim ds As New DataSet
ds.ExtendedProperties.Add("LastChecked", DateTime.Now)
To retrieve your extended property, just pass the name back to the DataSet's Item method. When you retrieve an item from this collection it comes back as an Object, so you'll need to convert the value when you retrieve it:
Dim stDate As String
Dim dtDate As DateTime
stDate = ds.ExtendedProperties("LastChanged")
If String.IsNullOrEmpty(stDate) = True Then
dtDate = DateTime.MinValue
Else
dtDate = Convert.ToDateTime(stDate)
End If
If dtDate < DateTime.Now AndAlso
ds.HasChanges = True Then
'... process DataSet
End If
This Blog is about some useful link and some interview question in.Net. I am trying to give some useful information to you .
Thursday, 21 July 2011
Use of using keyword in C# (.Net)
here are three use of using keywords
1. using directive to use to import namespace in C# class
2. Create a using directive to use the types in a namespace withough having to specify that actual namespace (i.e. using directive creates an alias).
3. To automatically close and dispose any object references implementing the IDisposable interface
A using directive does not give you access to any of the various namespaces that might be nested in the namespace that you specified.
A user defined namespace is referring to any namespace you have created in your code.
Example For 2nd Point:
// using keyword
using System;
using CSF = SomeMain.Resource.ForCSharp; // alias
namespace SomeMain.Resource
{
public class MyClass
{
public static void Something()
{
//empty
}
}
namespace ForCSharp
{
public class MyNestedClass
{
public static void MyMessage()
{
System.Console.WriteLine("CSharpFriends!");
}
}
}
}
public class TestUsing
{
public static void Main()
{
CSF.MyNestedClass.MyMessage();
// pauses output window
Console.ReadLine();
}
}
Example 3rd Point:
using (SqlConnection cn = new SqlConnection(connectionString))
{
// do something
}
is the same as:
SqlConnection cn = new SqlConnection(connectionString)
try
{
// do something...
}
catch
{ }
finally
{
cn.Dispose();
}
1. using directive to use to import namespace in C# class
2. Create a using directive to use the types in a namespace withough having to specify that actual namespace (i.e. using directive creates an alias).
3. To automatically close and dispose any object references implementing the IDisposable interface
A using directive does not give you access to any of the various namespaces that might be nested in the namespace that you specified.
A user defined namespace is referring to any namespace you have created in your code.
Example For 2nd Point:
// using keyword
using System;
using CSF = SomeMain.Resource.ForCSharp; // alias
namespace SomeMain.Resource
{
public class MyClass
{
public static void Something()
{
//empty
}
}
namespace ForCSharp
{
public class MyNestedClass
{
public static void MyMessage()
{
System.Console.WriteLine("CSharpFriends!");
}
}
}
}
public class TestUsing
{
public static void Main()
{
CSF.MyNestedClass.MyMessage();
// pauses output window
Console.ReadLine();
}
}
Example 3rd Point:
using (SqlConnection cn = new SqlConnection(connectionString))
{
// do something
}
is the same as:
SqlConnection cn = new SqlConnection(connectionString)
try
{
// do something...
}
catch
{ }
finally
{
cn.Dispose();
}
Sunday, 17 July 2011
Web sevices ISS 7.0
http://www.asp.net/general/videos/how-do-i-create-and-call-a-simple-web-service-in-aspnet
2 http://www.codeproject.com/KB/aspnet/IIS7ASPNet.aspx
3.http://krismanohar.com/blog/?p=34
http://www.dotnetfunda.com/forums/thread3683-how-to-host-webservice-in-iis7-.aspx
2 http://www.codeproject.com/KB/aspnet/IIS7ASPNet.aspx
3.http://krismanohar.com/blog/?p=34
http://www.dotnetfunda.com/forums/thread3683-how-to-host-webservice-in-iis7-.aspx
Friday, 3 June 2011
Some More
http://venkataspinterview.blogspot.com/2008/10/aspnet-forms-authentication-related.html
http://peterkellner.net/2010/06/18/wcf-service-in-managed-windows-service-vs2010-2/
http://dotnet-question-answer.blogspot.com/search?updated-max=2007-01-07T05%3A28%3A00-05%3A00&max-results=20
http://kakaprogramming.blogspot.com/ GOOD ONE...
http://valuetype.wordpress.com/2011/06/01/237/
http://www.neuronasoft.net/
http://www.careerride.com/ASPNet-Questions.aspx
http://peterkellner.net/2010/06/18/wcf-service-in-managed-windows-service-vs2010-2/
http://dotnet-question-answer.blogspot.com/search?updated-max=2007-01-07T05%3A28%3A00-05%3A00&max-results=20
http://kakaprogramming.blogspot.com/ GOOD ONE...
http://valuetype.wordpress.com/2011/06/01/237/
http://www.neuronasoft.net/
http://www.careerride.com/ASPNet-Questions.aspx
Friday, 27 May 2011
WCF WebCast
http://www.dasblonde.net/2007/06/24/WCFWebcastSeries.aspx
http://beyondrelational.com/blogs/dhananjaykumar/archive/2011/02/11/walkthrough-on-creating-wcf-4-0-service-and-hosting-in-iis-7-5.aspx
http://beyondrelational.com/blogs/dhananjaykumar/archive/2011/02/11/walkthrough-on-creating-wcf-4-0-service-and-hosting-in-iis-7-5.aspx
Subscribe to:
Posts (Atom)