Wednesday, January 11, 2012
Thursday, January 5, 2012
send email through SQL SP
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'WNweb01',
@recipients='DL@abc.com',
@body = @mbody,
@subject = 'my subject here'
@profile_name = 'WNweb01',
@recipients='DL@abc.com',
@body = @mbody,
@subject = 'my subject here'
Friday, December 30, 2011
Thursday, November 17, 2011
this assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded, powershell
see below link. we have to create two config file.
Wednesday, November 16, 2011
xml DeSerialization xsd.exe
good article
-------
below is simple steps using VS 2010
1) open XML file that you want to deserialize in VS 2010
2) from VS 2010 menu > XML > Create Schema
3) It will create schema in you project save somewhere this .xsd file (in project)
4) go to VS command prompt
5) change path to your .xsd file (where you save above .xsd file)
6) type : xsd myschemafile.xsd /c (must you /c)
7) it will generate myschemafile.cs file in same location
8) type following code
using (FileStream xmlStream = new FileStream(@"C:\book.xml", FileMode.Open))
{
using (XmlReader xmlReader = XmlReader.Create(xmlStream))
{
XmlSerializer serializer = new XmlSerializer(typeof(catalog));
catalog deserializedStudents = serializer.Deserialize(xmlReader) as catalog;
foreach (var b in deserializedStudents.book )
{
Console.WriteLine("author : {0}", b.author);
Console.WriteLine("description : {0}", b.description);
Console.WriteLine("genre : {0}", b.genre);
Console.WriteLine("price : {0}", b.price);
Console.WriteLine("");
}
}
}
generate classes from XSD file
To generate the classes from XSD, run the following on the command line
LinqToXsd.exe /Myschema.xsd
Note: download above exe from codeplex
http://linqtoxsd.codeplex.com/
Subscribe to:
Posts (Atom)