Hi i want to select data from table using username and DataID DESC, Is that possible?
the reason is that i want the latest data in the table to be shown on top and as well select by username.
I did it but got an error:
String strConnString = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
SqlConnection conntt = new SqlConnection(strConnString);
// SqlCommand cmdd55 = new SqlCommand();
SqlCommand cmd9 = new SqlCommand("SELECT ImageName,ImagePath,UserName FROM Bannertb WHERE UserName =@UserName ORDER BY BannerID DESC", conntt);
// cmdd55.CommandType = CommandType.StoredProcedure;
// cmd5.CommandText = "ProfilePictureDetailsView1";
// cmd5.Parameters.AddWithValue("@OrderDate", DateTime.Today);
cmd9.Parameters.AddWithValue("@UserName", this.User.Identity.Name);
cmd9.Connection = ...
Go to the complete details ...