Wednesday, August 12, 2009

Sql query for finding length and ascii values

The Following Query is used for finding length of string in column

and aslo for finding ascii value for one char in spcified column.

select * from tblname len(substring(EmailID,charindex('@',EmailID),25))>23
select * from tblname where Ascii(SubString(EmailID,1, 1))>47 and Ascii(SubString(EmailID,1, 1))<58

This is useful for finding or deleting unnessary rows .

Tuesday, August 11, 2009

XML Reading in Mobile Application

XML reading in mobile application:

The Mobile application will read the xml from online news feeds by using GPRS .
We have to copy following code and give the url following . it will read the xml
and will be displayed at specified field


XmlTextReader m = new XmlTextReader("");
while (m.Read())
{
while (m.Name != "item")
m.Read();
while (m.Name != "title")
m.Read();
string title = m.ReadElementContentAsString();
while (m.Name != "description")
m.Read();
string desc = m.ReadElementContentAsString();
textBox1.Text = desc;
}