471,348 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

WriteToXML function ???

Dear all,

I have a dataSet based on one table object of 6 columns, with the last
columns which allows to get null field.
Then this dataset is bind to a datagrid.
All columns are readonly except the last one for which I have autorise null
field.
Then I am able to enter some text through datagrid inside this last column,
for a particular row.

SO far so good.
After this I am able to send the content of the dataset to XML file susing
the WriteToXML function. When file is generated, I notice that the last
column of my dataset table is not written inside generated XML file

I have checked the dataset structure which is suppose to be send to file,
and I can see my last colum in its structure

Why this last column is not written to XML file ?
When editing directly a cell inside a datagrid, does the change is directly
apply to the dataset table as it is bind ?

thnaks for your help
regards
serge
Jul 21 '05 #1
3 2071
Hello,
Can you please show the code statement which you were using to write
DataSet to Xml.

Cheers :)
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***
Jul 21 '05 #2
Here is the function
======================

Public Function WriteToXMLLog(ByVal dsView As DataSet) As Boolean

'---------------------------------------------------------------------
' Name : WriteToLog
' Purpose : Write string to log file
' Param : sData, string to be written
' Return : true is succeed

'---------------------------------------------------------------------
Dim m_objds As DataSet

Try

m_objds = dsView

'- retrive file path
m_sFilePath = m_sOrgLogFilePath & "\" & m_objds.DataSetName

'Select Case m_LogFileType
' Case LogFileFormat.Csv : m_sFilePath = m_sFilePath &
"\Csv"
' Case LogFileFormat.Xml : m_sFilePath = m_sFilePath &
"\Xml"
'End Select

If Dir$(m_sFilePath, FileAttribute.Directory) = "" Then
MkDir(m_sFilePath)
m_objds.WriteXml(m_sFilePath & "\" & m_sFileName)

Catch exc As IOException
m_ObjMessageInfo.Severity = TraceLevel.Error
m_ObjMessageInfo.Number = 2
m_ObjMessageInfo.Message = "WriteToLog()"
m_ObjMessage.DisplayMessage(m_objAssembly, m_ObjMessageInfo,
m_ObjMessage.TypeMessage.ErrorMessage)

Catch exc As Xml.XmlException
m_ObjMessage.DisplayExceptionInfo(m_objAssembly, exc)

Catch exc As Exception
m_ObjMessage.DisplayExceptionInfo(m_objAssembly, exc)

End Try
End Function
"Maqsood Ahmed" wrote:
Hello,
Can you please show the code statement which you were using to write
DataSet to Xml.

Cheers :)
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***

Jul 21 '05 #3
I found it out.
It was require to use the writeshema mode of Xml

"Maqsood Ahmed" wrote:
Hello,
Can you please show the code statement which you were using to write
DataSet to Xml.

Cheers :)
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net

*** Sent via Developersdex http://www.developersdex.com ***

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by domeceo | last post: by
5 posts views Thread by phil_gg04 | last post: by
2 posts views Thread by laredotornado | last post: by
2 posts views Thread by sushil | last post: by
3 posts views Thread by serge calderara | last post: by
8 posts views Thread by Olov Johansson | last post: by
3 posts views Thread by Beta What | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.