In order for me not to be the women of those who are so miserable, decided to I most think the most need and master not good things to share, everyone is to KTV right, even if do not know, you have not eaten pork has not seen pig run, is it, so, Beau for everyone repeatedly this KTV
Set up the KTV song interface, and then to achieve is the singer song, click on the form of the Load event to write the following code:
Private voidFrmzhu_load (Objectsender, EventArgs e) { //read the picture path in the MyResource table and put it into the ImagePath variable stringsql ="Select Resource_path from Resource_path where resource_id=1"; SqlConnection Con=NewSqlConnection (SQLHELPER.STR); SqlCommand com=NewSqlCommand (Sql,con); Con. Open (); Ktvutil.singerphoto=com. ExecuteScalar (). ToString (); Con. Close (); //Read the singer PathSQL="Select Resource_path from Resource_path where resource_id=2"; Com.commandtext=SQL; Try{con. Open (); Ktvutil.songlu=com. ExecuteScalar (). ToString (); } Catch(Exception ex) {MessageBox.Show ("System resource Error!"+Ex. Message); } finally{con. Close (); } }
View Code
Into the region query is not the next query you, in order to narrow the scope of the query, right, so use the following things
if(lvtwo.selecteditems[0] !=NULL) {lvtwo.visible=false; Lvthree.location=lvtwo.location; Lvlb.dock=DockStyle.Fill; Lvthree.size=lvlb.size; Lvthree.visible=true; Singid= Convert.ToInt32 (lvtwo.selecteditems[0]. TAG); while(Dr. Read ()) {//put the singer's avatar in the Iamgelist control stringPhotourl = Ktvutil.singerphoto +"\\"+ convert.tostring (dr["Singer_poto_url"]); IMASINGERNAME.IMAGES.ADD (Image.FromFile (Photourl)); //Add a singer to the ListViewListViewItem List=NewListViewItem (); List. Text= Convert.ToString (dr["Singer_name"]); List. Tag= Convert.ToString (dr["singer_id"]); List. ImageIndex=ImageIndex; LVTHREE.ITEMS.ADD (list); ImageIndex++; } Dr. Close (); }
1th Step
Private voidLvthree_click (Objectsender, EventArgs e) {SqlConnection con=NewSqlConnection (SQLHELPER.STR); StringBuilder SB=NewStringBuilder (); Sb. AppendFormat ("Select Song_id,song_name,singer_name= '"+lvthree.selecteditems[0]. text+"', Song_url from Song_info where singer_id="+convert.toint32 (lvthree.selecteditems[0]. TAG) +""); Fslgeyu Eyu=NewFslgeyu (); Eyu.name=sb. ToString (); Eyu. Previous= Execute.singer;//specifies that the returned form is song by singerEyu. Show (); //This . Close ();}
2nd dynamic .
Beau thought it was suddenly the man's,,,
It's the next time we meet.
Games and games or games