|
Hi friends,
iam new to .Net Technology,i want some help reg--the task is that ,how can i save the data to XML file and from there to Database and vice versa
Thanx
|
|
|
|
|
Try looking at the Database articles here on CodeProject
Also there is probably an example of doing exactly that as part of the MSDN documentation. You can probably find it searching with Google and putting MSDN as the first key word in your search phrase.
led mike
|
|
|
|
|
You can try this:
DataSet ds = GetMyDataset();
XmlTextWriter xmlFile = new XmlTextWriter (@"C:\TEST.XML", null);
XmlDataDocument xmlDoc = new XmlDataDocument(ds);
xmlDoc.WriteContentTo(xmlFile);
xmlFile.Close();
The code above should take a dataset and write it to a XML file.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello,
I have one .xsl file. It is used to rendered the data from XML and displaying in HTML format. I want to do editing functionlities(add, edit,modify& delete) in a table.Like there is some default values has been displayed. I need to modify the data. Please help me, it is very urgent for me.
Thanks in advance.
The code is like this:
<xsl:template match="row">
<tr style="background-color:#E8E8E8">
<xsl:for-each select="td">
<xsl:choose>
<xsl:when test="./@first">
<td align="left" width="20px"><input name="radio_field" type="checkbox" style="border-color:white;background-color:#E8E8E8;cursor:pointer" onClick="provideAccess();changeBackcolor(this);">
<xsl:attribute name="id"><xsl:value-of select="attribute::name"/></xsl:attribute>
</input></td>
</xsl:when>
<xsl:when test="@last='true'">
<td align="left" width="10px" ><xsl:value-of select="./text()"/></td>
</xsl:when>
<xsl:when test="@editable" ='true' ">
<td align="left" width="20px"><input name="textbox" type="text" style="border-color:white;background-color:#E8E8E8;cursor:pointer" onClick="provideAccess();changeBackcolor(this);">
<xsl:attribute name="id"><xsl:value-of select="attribute::name"/></xsl:attribute>
</input></td>
</xsl:when>
<xsl:otherwise>
<td align="left">
<xsl:choose>
<xsl:when test="position()=last()">
<xsl:attribute name="width">100%</xsl:attribute>
  <xsl:value-of select="./text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pos" select="position()"/>
<xsl:attribute name="width"><xsl:value-of select="//th[position()=$pos]/@w"/>px</xsl:attribute>
  <xsl:value-of select="./text()"/>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>
</xsl:template>
<xsl:template match="tf">
<input style="font-weight:bold; cursor:pointer; color: #0b3378" >
<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:attribute name="onClick"><xsl:value-of select="@onclick"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="text()"/></xsl:attribute>
</input>
</xsl:template>
</xsl:stylesheet>
<!--
REPRODUCE THE BELOW CONTENTS IN INDIVIDUAL FILES UNDER BODY TAG OF A HTML FILE
<body>
<div id='tableSrc'></div>
<script>
//CONSTRUCT INPUT XML FOR TABLE FROM NE VALUES
inputXML="<tableDfn><caption>Table Heading</caption>";
inputXML+="<tHead>";
inputXML+="<th id='1' w='100' sort='true' order='ascending'>Head1</th>";
inputXML+="<th id='2' w='120' editable='true' type ='text'>Head2</th>";
inputXML+="<th id='3' w='120'>Head3</th>";
inputXML+="<th id='4' w='320'>Head4</th>";
inputXML+="<th id='5' w='120'>Head5</th>";
inputXML+="</tHead>";
inputXML+="<tBody>";
inputXML+="<row><td>one1</td><td>two1</td><td>three1</td><td>four1</td><td>five1</td></row>";
inputXML+="<row><td>one2</td><td>two2</td><td>three2</td><td>four2</td><td>five2</td></row>";
inputXML+="<row><td>one3</td><td>two3</td><td>three3</td><td>four3</td><td>five3</td></row>";
inputXML+="<row><td>one4</td><td>two4</td><td>three4</td><td>four4</td><td>five4</td></row>";
inputXML+="<row><td>one5</td><td>two5</td><td>three5</td><td>four5</td><td>five5</td></row>";
inputXML+="</tBody>";
inputXML+="<tFoot><tf type='button' onclick='alert("add")'>add</tf><tf type='button' onclick='alert("close")'>close</tf></tFoot>";
inputXML+="</tableDfn>";
// INITITIALIZAION OF XML DOM OBJECTS
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
var xslDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.setProperty('SelectionLanguage', 'XPath');
xmlDoc.loadXML(inputXML);
xslDoc.async = false;
xslDoc.load("../common/xsl/table.xsl");
newhtml = xmlDoc.transformNode(xslDoc);
document.getElementById('tableSrc').innerHTML=newhtml;
// TO SORT TABLE CONTENTS
function sortTable(node)
{
var prevNode = xmlDoc.selectSingleNode(".//tableDfn/tHead/th[@sort='true']");
if (prevNode !=null){
var curNode = xmlDoc.selectSingleNode(".//tableDfn/tHead/th[position()="+node.id+"]");
if (curNode.getAttribute('id')==prevNode.getAttribute('id'))
{
if (prevNode.getAttribute('order')=='ascending')
curNode.setAttribute("order",'descending');
else
curNode.setAttribute("order",'ascending');
}
else{
curNode.setAttribute("order",'ascending');
prevNode.removeAttribute("sort");
prevNode.removeAttribute("order");
}}
else
curNode.setAttribute("order",'ascending');
curNode.setAttribute("sort","true");
var newhtml = xmlDoc.transformNode(xslDoc);
document.getElementById('tableSrc').innerHTML=newhtml;
}
</script>
</body>
--><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="no" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\..\..\..\..\vjn\LUCENT CIT Project\Working\1830_Local\web\table" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="yes" name="Scenario2" userelativepaths="yes" externalpreview="no" url="..\inputXML.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->
|
|
|
|
|
Hello Guys
I m newbie at XML and has to work with Veda XML,
Anyone of us has ever worked with this Veda Advantage : Please give some Guidelines to start with it.
I have to do following
-1st. Connection
-2nd. Test Connection[Ping]
-3rd. Transfer Data For Verification
-4th. Received Response and Extract it and store values.
-5th. If there is error in between then solve.
but don't know the Exact And Correct Way to start with It.
Anyone.......... who knows or have ever worked on VEDA.. PLEASE HELP.
SOS...SOS...SOS
Believe Yourself™ :->™
|
|
|
|
|
So I guess this didn't work:[^]
VedaXML Developers Centre We provide you with all the technical information you need to integrate our services into your business systems using the VedaXML information channel. If you need more information on how VedaXML can save you time and money please refer to our VedaXML overview or contact us.
led mike
|
|
|
|
|
Hi Mike
Thanks for reply
<blockquote class="FQ"><div class="FQA">led mike wrote:</div>We provide you with all the technical information you need to integrate our services into your business systems</blockquote>
Are u working for VEDA?????
Actually me and my team is working on this task(Mentioned in previous post),
we are trying to ping, but we are not getting where and what we are doing wrong.
I have a Verification code and access pwd.
Can you please check where we are going wrong?
Here is my code written in C# for PING and the later one is for receive the response.
This is button click on which it goes for PING
<code>
#region XML Click
protected void Button1_Click(object sender, EventArgs e)
{
string username = txt_username.Text;
string pwd = txt_pwd.Text;
string request = "<code>"
+ " <message type="REQUEST"> "
+ "<access> "
+ "<access-code>" + username + "</access-code> "
+ "<access-pwd>" + pwd + "</access-pwd> "
+ "</access> "
+ "<service> "
+ "<service-client-ref>ASUT99991</service-client-ref> "
+ "<service-code>PING</service-code> "
+ "<service-code-version>V00</service-code-version> "
+ "<service-data></service-data> "
+ "</service> "
+ "</message> ";
string response = getReply(request);
Response.Write(response);
}
#endregion
</code>
---------- And this one is for reply ----------
<code>
#region getReply
public string getReply(string strReq)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(txt_url.Text);
StreamWriter writer = null;
request.Timeout = 1000000000;
request.Method = "POST";
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
string postData = "openagent&xml=" + strReq;
//string postData = strReq;
request.ContentLength = postData.Length;
request.ContentType = "text/xml";
try
{
//Create a write to send the data stream to the server
writer = new StreamWriter(request.GetRequestStream());
//Write to server
writer.Write(postData);
}
catch (Exception exc)
{
string str = exc.Message;
}
finally
{
writer.Close();
}
string str1 = "";
try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
XmlDocument xmldoc = new XmlDocument();
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
str1 = reader.ReadToEnd();
reader.Close();
}
}
catch (Exception ex)
{
string st = ex.Message;
}
return str1;
}
#endregion
</code>
<div class="ForumMod">modified on Wednesday, February 13, 2008 12:59 AM</div>
|
|
|
|
|
Gandalf - The White wrote: Can you please check where we are going wrong?
I'm confused. Have you tried using the VedaXML Developers Center for help? It wasn't helpful and that's why you are asking here on CodePRoeject?
led mike
|
|
|
|
|
There is nothing to be confused! Obviously we have checked(Many times).We can't depend only on this forum.
Actually we were trying from 3 days for that, What have u thought we won't take reference from VEDA?
The link that u have posted earlier that has been check many times before u have post.
I thought u can do something, That's why I have asked u for check.
But at last it is working without anyone's help.
Thanks for taking interest.
The only problem was on there side in terms of starting of service, Code was perfect.
Believe Yourself™ ™
|
|
|
|
|
Gandalf - The White wrote: but don't know the Exact And Correct Way to start with It.
Gandalf - The White wrote: he only problem was on there side in terms of starting of service, Code was perfect.
So you don't know where to start but you are finished and the code was perfect. Apparently "start" doesn't mean what I thought it did.
led mike
|
|
|
|
|
|
Hi all,
I am using this code to retrive the Viewsource content of page(Page content will be showed in XML).
It was working well. But now I face one problem , the XML contain any special hexadecimal value then it display an error
Function GetXML(ByVal strTypeId As String) As String
Dim xmlRef As New MSXML2.XMLHTTPClass
Dim strUrl As String="Test.Asp"
Try
Console.WriteLine(strUrl.Trim)
xmlRef.open("GET", strUrl.Trim, False)
xmlRef.send()
GetXML = xmlRef.responseText
GetXMLDoc(-1)
'http://msdn2.microsoft.com/en-us/library/k1y7hyy9(vs.71).aspx
If xmlRef.statusText = "OK" Then
Return GetXML
Else
'Return GetXML = "False"
End If
Catch ex As Exception
'Return GetXML = "False"
End Try
End Function
Error : "'?', hexadecimal value 0xFFFF, is an invalid character."
Hw to solve this one
Thanks
Dana
|
|
|
|
|
Hi,
I have some simple XML and I want to convert the elements into strings.
My XML looks like this:
<ErrorDetail xmlns="mydomain.com/errordetail.xsd">
<RegVal AX="1" BX="2" CX="3" DX="3"</RegVal>
<RegVal AX="4" BX="3" CX="5" DX="4"</RegVal>
<RegVal AX="5" BX="4" CX="6" DX="5"</RegVal>
<ErrorDetail>
So I want to get the elements out into an array of strings like this:
strings[0] = "<RegVal AX="1" BX="2" CX="3" DX="3"</RegVal>";
strings[1] = "<RegVal AX="4" BX="3" CX="5" DX="4"</RegVal>";
strings[2] = "<RegVal AX="5" BX="4" CX="6" DX="5"</RegVal>";
But I want to do this using an XmlTextReader I think but I have not had success yet.
Can anyone help? Thanks
|
|
|
|
|
Hi,
I have some simple XML and I want to convert the elements into strings.
My XML looks like this:
<ErrorDetail xmlns="mydomain.com/errordetail.xsd">
<RegVal AX="1" BX="2" CX="3" DX="3"</RegVal>
<RegVal AX="4" BX="3" CX="5" DX="4"</RegVal>
<RegVal AX="5" BX="4" CX="6" DX="5"</RegVal>
</ErrorDetail>
So I want to get the elements out into an array of strings like this:
strings[0] = "<RegVal AX="1" BX="2" CX="3" DX="3"</RegVal>";
strings[1] = "<RegVal AX="4" BX="3" CX="5" DX="4"</RegVal>";
strings[2] = "<RegVal AX="5" BX="4" CX="6" DX="5"</RegVal>";
But I want to do this using an XmlTextReader I think but I have not had success yet.
Can anyone help? Thanks
|
|
|
|
|
babaa wrote: I want to do this using an XmlTextReader I think but I have not had success yet.
Why not? What have you tried?
No one is going to do your work for you. Post what code you have already written, identify where you are having a problem and someone might help.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
as answered before to your question :
the XmlNode.InnerXml property is probably what you are looking for.
|
|
|
|
|
I haven't used XML all that much so I'm unaware of it's performance limitations. How many nodes can I store before an apparent performance slowdown occurs. The XML file is being used for a standard windows app.
may your code be error free.
(okay, maybe two lines.)
|
|
|
|
|
7
performance slowdown of what? Oh right performance yeah I know exactly what you mean.
led mike
|
|
|
|
|
worldofwarcraft.com web page xml and xsl
sample xml and xsl
Boya - Badana - Tadilat ve Tamirat Isleri Bir Yudum Kahve Molasi (Coffee) Dügün Nisan ve Gelinlik (wedding)
Google Reklamlarinizi Sadece Siz Yönetin Elektrik Proje Tesisat Projesi Çizimi Illere Göre Nakliyat Firmalari Istatistik
http://www.evdenevenakliyatbul.com
|
|
|
|
|
Well, what is your question? Just a bunch of retard nothing in your post...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i have a lookup in sharepoint and it fill with number for example the content of that is 1 2 3 4 5 ...
now i want it contain some time 1 sometime 2 and ..
i want filter it.
can i do this in sharepoint designer with javascript and how?
|
|
|
|
|
Hi,
I know it's available in VB.Net, but it appears that it's not available in C#.
I haven't done a lot of research into LINQ To XML, so i'm not sure about that, but does anyone know the rationale behind the decision to not include it in C#?
Cheers
T
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hi All,
can i embed a file (xml or pdf) within an XML file ?
thanks
|
|
|
|
|
Ayman Mashal wrote: can i embed a file (xml or pdf) within an XML file ?
Yes
led mike
|
|
|
|
|