C# window application call PHP code

How does C# code call PHP code. How can the two interact...I am using

Page 1 of 1

2 Replies - 9510 Views - Last Post: 24 August 2009 - 10:00 PM Rate Topic: -----

#1 shalvvwonder   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-August 09

C# window application call PHP code

Posted 17 August 2009 - 09:46 PM

try{
				HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://zhongbaotong.snakesoft.eu/mysql_tunnel.php");
			   
				HttpWebResponse response = (HttpWebResponse)request.GetResponse();
				StreamReader input = new StreamReader(response.GetResponseStream());

				DataSet dsTest = new DataSet();
				dsTest.ReadXml(input);
			   

				int i,j, varTotCol = dsTest.Tables[0].Columns.Count, varTotRow = dsTest.Tables[0].Rows.Count;
				for (j = 0; j < varTotRow; j++)
				{

					for (i = 0; i < varTotCol; i++)
					{
						MessageBox.Show(dsTest.Tables[0].Rows[j].ToString());
					}
				}
		   
			}
			catch (Exception Except)
			{
				MessageBox.Show(Except.ToString());
			}



Is This A Good Question/Topic? 0
  • +

Replies To: C# window application call PHP code

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1660
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: C# window application call PHP code

Posted 17 August 2009 - 10:45 PM

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
  • Post the code you're having problems with
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

Was This Post Helpful? 0
  • +
  • -

#3 shalvvwonder   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-August 09

Re: C# window application call PHP code

Posted 24 August 2009 - 10:00 PM

try{
				HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://zhongbaotong.snakesoft.eu/mysql_tunnel.php");
			   
				HttpWebResponse response = (HttpWebResponse)request.GetResponse();
				StreamReader input = new StreamReader(response.GetResponseStream());

				DataSet dsTest = new DataSet();
				dsTest.ReadXml(input);
			   

				int i,j, varTotCol = dsTest.Tables[0].Columns.Count, varTotRow = 
					dsTest.Tables[0].Rows.Count;

				for (j = 0; j < varTotRow; j++)
				{
					for (i = 0; i < varTotCol; i++)
					{
						MessageBox.Show(dsTest.Tables[0].Rows[j].ToString());
					}
				}
		   
			}
			catch (Exception Except)
			{
				MessageBox.Show(Except.ToString());
			}


I am receiving an error saying "Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 62, position 20." Please tell me where am I going wrong. Thank you in advance.

This post has been edited by shalvvwonder: 24 August 2009 - 10:02 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1