-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: BalajiKrishnan
Message 1 in Discussion

Hi All,   I am generating tree using XML... It is working in my machine where the code 
is developed...... (the tree is generated) but when i access the same url in the 
clients machine,the tree is not generated.   what could be the problem.....?   pls 
help me....asap.     thanks in advance   Balaji.     Code :  
public bool createTree(string strDim, string strCategoryID, out string strErr) 
{ 
try 
{ 
string strTable="tblElement"; 
string strElement, strFullPath; 
security objSecurity = new security(); 
DataTable tblElement = objSecurity.getGrantedElement(strDim,strCategoryID, strTable, 
out strErr); 
objSecurity = null; 
if(tblElement.Rows.Count<1) 
{ 
strErr = "1"; 
return false; 
} 
if(strErr == "") 
{ 
string strXmlFileName; 
strXmlFileName = ConfigurationSettings.AppSettings["XMLDimPath"].ToString(); 
strXmlFileName = strXmlFileName + "\\" + strDim + "_" + strCategoryID + ".xml"; 
FileInfo flInfo = new FileInfo(strXmlFileName); 
if(flInfo.Exists) 
{ 
return true; 
} 
string delimstr = @"\"; 
char[] delim = delimstr.ToCharArray(); 
string[] split = null; 
int intIndex = 0; 
XmlTextWriter myXmlTextWriter = new System.Xml.XmlTextWriter 
(strXmlFileName,System.Text.Encoding.UTF8); 
myXmlTextWriter.Formatting = Formatting.Indented; 
myXmlTextWriter.WriteStartDocument(true); 
myXmlTextWriter.WriteStartElement("TREENODES"); 
for(int j=0; j<tblElement.Rows.Count; j++) 
{ 
DataRow drow = tblElement.Rows[j]; 
string strValue = drow[0].ToString(); 
strFullPath = strValue; 
strElement = strFullPath.Substring(strFullPath.LastIndexOf("\\")+1); 
split = strValue.Split(delim, strValue.Length); 
int intlength = split.Length; 
if(intIndex == intlength || intIndex == 0) 
{ 
if (intIndex != 0) 
{ 
myXmlTextWriter.WriteEndElement(); 
}  
myXmlTextWriter.WriteStartElement("treenode", null); 
myXmlTextWriter.WriteAttributeString("text", strElement); 
myXmlTextWriter.WriteAttributeString("NavigateURL","showelement.aspx?ElName=" + 
strFullPath); 
strValue = drow[0].ToString(); 
split = strValue.Split(delim, strValue.Length); 
intlength = split.Length; 
intIndex = intlength; 
} 
else 
{ 
strValue = drow[0].ToString(); 
strFullPath = strValue; 
strElement = strFullPath.Substring(strFullPath.LastIndexOf("\\")+1); 
split = strValue.Split(delim, strValue.Length); 
intlength = split.Length; 
for(int i = intIndex; i >= intlength; i--) 
{ 
myXmlTextWriter.WriteEndElement(); 
} 
 
myXmlTextWriter.WriteStartElement("treeNode", null); 
myXmlTextWriter.WriteAttributeString("text", strElement); 
myXmlTextWriter.WriteAttributeString("NavigateURL","showelement.aspx?ElName=" + 
strFullPath); 
 
strValue = drow[0].ToString(); 
split = strValue.Split(delim, strValue.Length); 
intlength = split.Length; 
intIndex = intlength; 
} 
} 
myXmlTextWriter.WriteEndElement(); 
myXmlTextWriter.Flush(); 
myXmlTextWriter.Close(); 
return true; 
} 
else 
{ 
return false; 
} 
}

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to