jacksonohara
New Member
Anyone have a basic example of writing XML data from a string within a class out to SQL database table? This snippet would be much appeciated.<BR><BR>DrewTried this but still can't get it to populate the data:<BR><BR><BR>// Drop Error into the SQL Database for Error<BR> void AddRecord()<BR> {<BR> string sConnectionString = "User ID=sa;pwd=Drew;Initial Catalog=Error;Data Source=(BEPC5045)";<BR> SqlConnection objConn = new SqlConnection(sConnectionString);<BR> objConn.Open();<BR> string sSQL = "insert into Error values ('123')";<BR> SqlCommand objCmd = new SqlCommand(sSQL,objConn);<BR> try <BR> {<BR> objCmd.ExecuteNonQuery();<BR> }<BR> catch (System.Exception e) <BR> {<BR> MessageBox.Show(e.Message);<BR> }<BR> MessageBox.Show("Record Added");<BR> }<BR> }<BR>}