Archive

Archive for January, 2013

DataReader to XML

January 19, 2013 Leave a comment

code snippet to convert reader to XML

reader = comm.ExecuteReader();

DataTable dataTable = new DataTable();
dataTable.Load(reader);

//convert the datatable to xml
StringWriter xmlWriter = new StringWriter();

dataTable.WriteXml(xmlWriter);

Categories: ASP.NET Tags: ,

Get Inserted Row Values SQL

January 3, 2013 Leave a comment

We can get the column value just inserted using this query

INSERT

INTO users(name_)

OUTPUT

Inserted.name_

VALUES

(‘bob’);

It will return the value corresponds to the column “name_”