Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在GridView和DetailsView中绑定相同的数据。为什么我没有获得详细信息视图的输出? 1.网格视图,我使用了下面的代码,得到了正确的输出。。 2.我通过更改详细信息视图的ID使用了相同的代码。但是我没有得到输出_C#_Asp.net_Visual Studio 2010 - Fatal编程技术网

C# 在GridView和DetailsView中绑定相同的数据。为什么我没有获得详细信息视图的输出? 1.网格视图,我使用了下面的代码,得到了正确的输出。。 2.我通过更改详细信息视图的ID使用了相同的代码。但是我没有得到输出

C# 在GridView和DetailsView中绑定相同的数据。为什么我没有获得详细信息视图的输出? 1.网格视图,我使用了下面的代码,得到了正确的输出。。 2.我通过更改详细信息视图的ID使用了相同的代码。但是我没有得到输出,c#,asp.net,visual-studio-2010,C#,Asp.net,Visual Studio 2010,恐怕这个问题听起来很简单。但是我们将非常感谢您的帮助。您能在.aspx文件中为数据列表编写代码吗? 您是否在数据列表中使用Eval语句? 没有回答这个问题,但您的代码是一个SQL注入攻击,正在等待发生。User2.Text:“bobby';drop table studentlogin;-”@TIm Medora..感谢您的回答..我刚刚检查了“SQL注入”在wiki中..我知道我的sql语句的编码很差。但我目前处于初级阶段。我只是在尝试学习。我很快就会改进我的编码。嗨,托马斯..我将尝试使用参

恐怕这个问题听起来很简单。但是我们将非常感谢您的帮助。

您能在.aspx文件中为数据列表编写代码吗? 您是否在数据列表中使用Eval语句?

没有回答这个问题,但您的代码是一个SQL注入攻击,正在等待发生。User2.Text:“bobby';drop table studentlogin;-”@TIm Medora..感谢您的回答..我刚刚检查了“SQL注入”在wiki中..我知道我的sql语句的编码很差。但我目前处于初级阶段。我只是在尝试学习。我很快就会改进我的编码。嗨,托马斯..我将尝试使用参数化语句学习。但是你能不能解释一下我目前的问题。@Thomas:小Bobby Tables?我爱那孩子D(+1用于及时xkcd参考)
protected void Button1_Click(object sender, EventArgs e)

  {

        da = new OracleDataAdapter("select* from studentlogin where name='" + User2.Text + "'", con);

        da.Fill(ds, "studentlogin");

        GridView1.DataSource = ds.Tables["studentlogin"];

        GridView1.DataBind();


    }
 protected void Button2_Click(object sender, EventArgs e)

    {

        da = new OracleDataAdapter("select* from studentlogin where name='" + User2.Text + "'", con);

        da.Fill(ds, "studentlogin");

        DetailsView1.DataSource = ds.Tables["studentlogin"];

        DetailsView1.DataBind();


    }