使用ASP,.NET C#从DataBase进行视频回溯# [英] Video Retrival From DataBase Using ASP,NET C#

查看:53
本文介绍了使用ASP,.NET C#从DataBase进行视频回溯#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Gridview从SQL服务器中检索视频。如果用户隐藏视频名称,则希望在用户端检索该特定视频。我已经使用按钮检索视频,但现在我想添加视频名称列中的链接以重新获取它。这是mY代码。



I want to retrive video from SQL server using Gridview .And want on the user end if a user cliks on video name it retreive that specific video. I had retrieve the video using a button but now I want to add link in video name coloumn to rertieve it ..Here Is mY code .

 SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["videoConnectionString"].ConnectionString);
    private DataTable GetSpecificVideo(object i)
    {
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT Video, ID FROM video4 WHERE id = @ID", connection);
        adapter.SelectCommand.Parameters.Add("@id", SqlDbType.Int).Value = (int)i;
        DataTable table = new DataTable();
        adapter.Fill(table);
        return table;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(TextBox1.Text);
        Repeater1.DataSource = GetSpecificVideo(id);
        Repeater1.DataBind();
    }
}





请帮我看看如何在Gridview中添加链接而不是使用视频ID。在此先感谢



Please Help me how to add link in Gridview Instead of using video ID. Thanks In Advance

推荐答案

这篇关于使用ASP,.NET C#从DataBase进行视频回溯#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆