i want to know the xml

Posted by Subhadip under ASP.NET on 3/18/2011 | Points: 10 | Views : 1224 | Status : [Member] | Replies : 4
i want to know how to insert record into database using XML in ASP DOT NET?????




Responses

Posted by: Prabhakar on: 3/18/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down

Hi Subhadip,,

Check this link it's a use full for u
http://www.w3schools.com/aspnet/aspnet_xml.asp

Best Regard's
Prabhakar

Subhadip, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 3/18/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

read xml file dataset Readxml File

Mark as Answer if its helpful to you

Subhadip, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 3/18/2011 [Member] Bronze | Points: 25

Up
0
Down
Please try this out...

protected void btnSubmit_Click(object sender, EventArgs e)  

{
String strXMLdata = string.Empty;
XmlReader xmlr = null;
using (SqlConnection conn = new SqlConnection(ConnString))
{
//open the xml file and assign the data in the file to a string
using (FileStream xmlStream = File.OpenRead(Server.MapPath("~/App_Data/Data.xml")))
{
strXMLdata = new StreamReader(xmlStream).ReadToEnd();
}

//inserting xml data to SQL
SqlCommand cmd = new SqlCommand("INSERT INTO rgn_Xml (XMLdata) VALUES(@XmlData)", conn);
cmd.Parameters.Add(@XmlData ", SqlDbType.Xml);
cmd.Parameters["@XmlData "].Value = strXMLdata.Trim();
conn.Open();
cmd.ExecuteNonQuery();
}
}


Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Subhadip, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vforvijay on: 3/18/2011 [Member] Starter | Points: 25

Up
0
Down
hi..
Try this link..
http://vbdotnetaddict.blogspot.com/2011/02/how-to-insert-xml-data-into-sql.html

Subhadip, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response