Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2005 XML Problem

Status
Not open for further replies.

Mham2k

Programmer
Jun 1, 2007
12
US
1. All of this stuff I am doing worked GREAT on my local...
2. My host is GoDaddy...
3. Sql Server 2005 ASP.Net 2.0 FrameWork
4. Problem...
- It always returns nothing in my XML... Doesn't Error Out at all
- I have Response.Write the results they are blank.
- I am using this in a stored procedure
- - 'SELECT * From dbo.TT_1 For Xml Raw' to return a string of XML
- There is one Record in the Table
- My query is coded in C#
private string GetXml()
{
// string procname = xmlIn.DocumentElement.Attributes[0].Value;
string procname = "SP_Get_TT1_Home";
string conn = "Data Source=************" +
"Initial Catalog=******;" +
"User ID=*****;" +
"Password=*******";
SqlRequests Proc = new SqlRequests();
XmlDocument xmlDoc = Proc.Procedure(procname, conn);
Response.Write(xmlDoc);
try
{
xmlDoc.RemoveChild((XmlNode)xmlDoc.DocumentType);
}
catch { }
return xmlDoc.OuterXml;
}
- It calls this part in my SQL request Object.
public XmlDocument Procedure(string qCommand, string qConnect)
{
SqlConnection Connect = new SqlConnection(qConnect);
Connect.Open();

SqlCommand pCmd = new SqlCommand("dbo." + qCommand, Connect);
pCmd.CommandType = CommandType.StoredProcedure;
//pCmd.Parameters.Add("@TableName", SqlDbType.NChar);
//pCmd.Parameters["@TableName"].Value = procValue;
pCmd.ExecuteNonQuery();


XmlReader prdr = pCmd.ExecuteXmlReader();

XmlDocument xmlDoc = new XmlDocument();
while (prdr.Read())
{
xmlDoc.Load(prdr);
}
Connect.Close();
prdr.Close();
pCmd.Dispose();
return xmlDoc;
}
- Please help I need this done by monday. I just dont understand why it is returning blank. It makes no sense to me when it all worked on my local.
 
It was GoDaddy's Raggidy Servers. They were using Sql 2005 Express instead of the standard version. When I called them none of them knew which one it was all they could tell me was 2005. So after I searched a little more I noticed the limitations of express.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top