SQL to XML & XML to SQL
-
Hi all I am trying SQL to XML means i want to store SQL table records in XML And Again XML to SQL Can any one give me an idea Than Q
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
-
Hi all I am trying SQL to XML means i want to store SQL table records in XML And Again XML to SQL Can any one give me an idea Than Q
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
What database server are you using? Is it SQL Server
-
What database server are you using? Is it SQL Server
Hi THX for reply Yes it is SQL server
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
-
Hi THX for reply Yes it is SQL server
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
Now, can you provide an example of what is it that you want?
-
Now, can you provide an example of what is it that you want?
In sql server i have an table called "WW" That table records i want to copy to XML file (WW.xml) I done the SQL to XML like this Dim dsn, sqlEmp As String dsn = "Provider=SQLOLEDB;server=;uid=;pwd=;database=Test" sqlEmp = "select * from WW" Dim connection As New OleDbConnection(dsn) Dim command As New OleDbDataAdapter(sqlEmp, connection) Dim dsCustomers As New DataSet command.Fill(dsCustomers, sqlEmp) dsCustomers.WriteXml(Server.MapPath("WW.xml")) It will transfer all the records to XML file Now i want to this XML file to transfer to SQL server New Table How can i do this
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
-
In sql server i have an table called "WW" That table records i want to copy to XML file (WW.xml) I done the SQL to XML like this Dim dsn, sqlEmp As String dsn = "Provider=SQLOLEDB;server=;uid=;pwd=;database=Test" sqlEmp = "select * from WW" Dim connection As New OleDbConnection(dsn) Dim command As New OleDbDataAdapter(sqlEmp, connection) Dim dsCustomers As New DataSet command.Fill(dsCustomers, sqlEmp) dsCustomers.WriteXml(Server.MapPath("WW.xml")) It will transfer all the records to XML file Now i want to this XML file to transfer to SQL server New Table How can i do this
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
Hi Friend, I Envisage the has two Columns. Private Con As SqlConnection Private Com As SqlCommand Private DSET As DataSet Con = New SqlConnection("Your Connection String") Com = New SqlCommand("Insert Values(@ID,@Name )", Con) '/*** If the TWO column are String Type ***/ Com.Parameters.Add("@ID", SqlDbType.VarChar, 5) Com.Parameters.Add("@Name", SqlDbType.VarChar, 50) DSET = New DataSet() DSET.ReadXml("WW.xml") Dim R As Int32 Con.Open() For R = 0 To DSET.Tables(0).Rows.Count - 1 Com.Parameters("@ID").Value =DSET.Tables(0).Rows(R)(0) Com.Parameters("@Name").Value =DSET.Tables(0).Rows(R)(1) Com.ExecuteNonQuery() Next Con.Close() With Regards, Pandian S
-
Hi Friend, I Envisage the has two Columns. Private Con As SqlConnection Private Com As SqlCommand Private DSET As DataSet Con = New SqlConnection("Your Connection String") Com = New SqlCommand("Insert Values(@ID,@Name )", Con) '/*** If the TWO column are String Type ***/ Com.Parameters.Add("@ID", SqlDbType.VarChar, 5) Com.Parameters.Add("@Name", SqlDbType.VarChar, 50) DSET = New DataSet() DSET.ReadXml("WW.xml") Dim R As Int32 Con.Open() For R = 0 To DSET.Tables(0).Rows.Count - 1 Com.Parameters("@ID").Value =DSET.Tables(0).Rows(R)(0) Com.Parameters("@Name").Value =DSET.Tables(0).Rows(R)(1) Com.ExecuteNonQuery() Next Con.Close() With Regards, Pandian S
Hi THX for reply Plz can u chk u this what wrong here It is giving this ERROR ------ Declare "@code" Dim Con As OleDbConnection Dim Com As OleDbCommand Dim DSET As DataSet Con = New OleDbConnection("Connection String") Com = New OleDbCommand("Insert into ww Values(@Code,@Month))", Con) Com.Parameters.Add("@Code", OleDbType.VarChar, 200, "@Code") Com.Parameters.Add("@Month", OleDbType.VarChar, 200, "@Month") DSET = New DataSet DSET.ReadXml(Server.MapPath("WW.xml")) Dim R As Int32 Con.Open() For R = 0 To DSET.Tables(0).Rows.Count - 1 (ERROR) Com.Parameters("@Code").Value = DSET.Tables(0).Rows(R)(0) Com.Parameters("@Month").Value = DSET.Tables(0).Rows(R)(1) Com.ExecuteNonQuery() Next Con.Close() -- modified at 2:00 Wednesday 16th August, 2006
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf