-6
我想檢索具有藝術家列的up_song表中的arist名稱的記錄, 和1.Lata Mangeshkar 2.Lata Mangeshkar,sunidhi chuhan 3.Mohit chuhan,Ashaji ,Lata Mangeshkar。SQL查詢WHERE字符串LIKE字段
song.aspx
string lata = hlinklata.Text;
hlinklata.NavigateUrl = "DisplayList.aspx?name=" + lata;
Displylist.aspx
lblheader.Text = Request.QueryString["name"];
String sql = "SELECT title, song_id, movie_name, size FROM up_song WHERE artist LIKE '%"+ lblheader.Text +" %' ";
adpt = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
adpt.Fill(ds, "title");
var last6Uploaded = ds.Tables["title"].AsEnumerable().OrderByDescending(r => r.Field<int>("song_id"));
foreach (DataRow row in last6Uploaded)
{
int songID = row.Field<int>("song_id");
HyperLink hl = new HyperLink();
hl.ID = "hyperlink" + songID;
string title = row.Field<string>("title");
hl.Text = title;
hl.NavigateUrl = "Downloadpage.aspx?name=" + title;
hl.ForeColor = System.Drawing.Color.White;
Paneltitle.Controls.Add(hl);
Paneltitle.Controls.Add(new LiteralControl("<br>"));
}
最新消息你的問題? – vijay 2013-03-03 08:34:56
問題是什麼或者你得到的錯誤 – 2013-03-03 08:35:10
問題是什麼?對我來說似乎很好...... – 2013-03-03 08:35:41