If you want to pass table in form of XMLin asp.net

1st build xml data and pass it....
dt.TableName = "MyData";
using (StringWriter sw = new StringWriter())
            {
                dt.WriteXml(sw);
                result = sw.ToString().Replace("NewDataSet", "DocumentElement");
            }

2nd in proc you can get by select ...
 SELECT  cast(colx.query('data(Column1) ') as nvarchar(max)) as Column1,     
   cast(colx.query('data(Column2) ' )as nvarchar(max)) as Column2,     
   cast(colx.query('data(Column3) ' )as nvarchar(max)) as Column3    
   into #Temp from @MyData1.nodes('DocumentElement/MyData') as Tabx(colx)


Comments

Popular posts from this blog

How to create RSS Feed in Asp.Net

Auto generate change scripts in SQL Server Management Studio SSMS for tables

HOW TO Use the NumericUpDown Control