使用c#程序从000webhost从数据库检索数据时出错

时间:2015-06-16 08:43:52

标签: c# php mysql

我尝试使用php和c#访问mysql数据库。我编写如下代码,并且出现“Root element is missing”错误。我只是想问为什么?代码是否有效?

C#代码

private void button1_Click(object sender, EventArgs e)
    {
           HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.minzhe-chengyee.comule.com/vieworder.php");
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            StreamReader input = new StreamReader(response.GetResponseStream());

            DataSet dsTest = new DataSet();
            dsTest.ReadXml(input);
            dataGridView1.DataSource = dsTest.Tables[0];
        }

PHP脚本

 <?php

$con=mysql_connect('mysql17.000webhost.com','a2634311_eee2110','fypeee2110');
 mysql_select_db("a2634311_fyp",$con);


 $table=$_POST['table'];
 $name=$_POST['name'];
 $quantity=$_POST['quantity'];


 mysql_query("select * from ordertable");

?>

0 个答案:

没有答案