I need to display the softwares expired validating it with current date.....
but when i fill the dataset and displaying the data in a label.
suppose i have retrieved 3 softwares but i have already put 10 labels to show first 10 expired softwares
iam getting a error on 4th label as it is empty so wat condition should i mention to overcome this problem...
my sample code----
Dim cmd As SqlCommand = New SqlCommand("select distinct productname from productinfo where expirydate > ='" + localdate + "' ", conn) Dim dalogin As SqlDataAdapter = New SqlDataAdapter(cmd) Dim dtlogin As DataSet = New DataSet() dalogin.Fill(dtlogin) If (dtlogin.Tables(0).Rows.Count > 0) Then lblexpiry1.Text = dtlogin.Tables(0).Rows(0).Item(0) If dtlogin.Tables(0).Rows(1).Item(0) Is Nothing Then td1.InnerHtml = "" Else Label1.Text = dtlogin.Tables(0).Rows(1).Item(0) End If If dtlogin.Tables(0).Rows(2).Item(0) Is Nothing Then td1.InnerHtml = "" Else Label2.Text = dtlogin.Tables(0).Rows(2).Item(0) End If If dtlogin.Tables(0).Rows(3).Item(0) Is Nothing Then td1.InnerHtml = "" Else Label3.Text = dtlogin.Tables(0).Rows(3).Item(0) End If Label4.Text = dtlogin.Tables(0).Rows(4).Item(0) Label5.Text = dtlogin.Tables(0).Rows(5).Item(0) Label6.Text = dtlogin.Tables(0).Rows(6).Item(0) Label7.Text = dtlogin.Tables(0).Rows(7).Item(0) Label8.Text = dtlogin.Tables(0).Rows(8).Item(0) Label9.Text = dtlogin.Tables(0).Rows(9).Item(0) End If
i have a repeator control that is bind to a dataset, one of the field is image path that is bind with <img src tag. Now the problem is so of the articles are with out any image, how can i make sure that <img tag only render when there is an image name exist?
I have gone through all of the forums and couldn't find an answer to my problem, which is:: I need to bind a result from a stored procedure to a label. What I have done so far is to try to use <%# Bind(SP_Result_FIeld_Name)#> and that does nothing. I also tried to assign the results to a string in the code behind, all that did was put the words "TTLCount" in my label. Part of the problem might be that it is pulling from a temp table and the field I'm pulling has an assigned name ( Count(*) as TTLCount)... The rest of my SP is returning to a gridview which works fine. I just need to display the total number returned and the total number of returned that have email addresses. Here is what I have so far::
i am facing a minor problem but can't find out its syntaxi have listview, and inside the template i have 2 labels, in design time i bind 1 label to one column thatis 'type' and depending upon this type i want to bind other labels to different columnsif type is question than 2 label will have to show data of question columnif type is job than 2 label will have to show data of job, so on........how to accomplish this,in databinding event handler i can check the value of typebut i want to know the syntax of binding 2 label in run time, with different fields using EVAL
I am unsure on how to perform this task, what i need to do is make a gallery with tagging. I need this as it is a requirement for the project. Each user will have there own gallery and be able to upload and delete images from there gallery. I already know how to insert and select images from a database. I will then display the gallery using a data repeator with paging, I am sure i can google an article for data repeator with paging.
My challenge is, when the user wants to save a image to there gallery, he must 1st upload the image and then i must some how display the image, when the image is displayed, i will have a text box where they can add tags, this textbox will save in the tag table for that user_id, picture_id and the tag will have an id also. I am unsure on how to do this When he clicks save, i wanna insert the image into the table, and the tag. If he does not click save, then nothing should be saved. Now the 2nd part.
In the data repeator, i want a modal window to popup when they click an image, this modal will have the image and the respective tags that where saved for this image, I am unsure how to this.
I have a repeator control which is displaying the search results and it contains 50 Records.Paging is Enabled for the Repeator control and hence i am able to see 10 records at a time.
Now my requirement is :
When ever the user clicks the browser back button after going to the the Last set of records from the result set (41-50 records) in the Repeator Control,the Page is displaying the First set of Records(1-10).
Expected Result :
Page has to display the Previous result set (31-40) after clicking the browser back button.
I need to set the "Text" property of a label inside a gridview using, I know how to set the label using static value and I also know how to set the label using the "Bind" keyword but I want to do both, something like this:
How to bind repeater control after sorting the values. i got values from database table. i need to bind the repeater with this values but i need to sort values by date values. is it possible to do dynamically or i need to go for store procedure. Also i like to display only 5 results out of my any records.
I have a gridview to which I am binding a database values. My requirement is to bind the values to the gridview by sorting 3 columns as a default sorting with ASC order in one column and descending order in other two.. Can I do it in my .Net code or should I do that in Stored Procedure? If it can be done in .net code Can you tel me how it can be done.
IdApplication ApplicationDesc Permissions 1 User Add 1 User Delete 1 User Update 2 Role Add 2 Role Delete 3 User2 Modify 3 User2 Change
How can i Bind like in nested repeater control
In my Nested repeater control bound i need to Bind the Values like this Formate According Groupwise
User Add Update Role Add Delete User2 Modify Change
In the nested repeater control i taken a label in Header Template i need to bind 3 different values Application Desc once User, Role, User2 and in Item Template i had binded the <%# Eval("Application Desc")%> but i am getting like this all permissions in 1 line
I have a GridView control that has a SQLDataSource.
The GridView provides me with a list of musical artists (from the tblArtists)
In the Grid, I have a field, FKGenreID, that is a Foreign Key value for music Genres.
(An example of the data in that field would be "7", which upon lookup would mean Classical in the tblGenreList table.)
What I'd like to do is add a DropDownList control that looks up the tblGenreList table and populates the DropDownList with the ID and Description from the tblGenreList Lookup table.
Now the tricky part is that if the GridView field (FKGenreID) has a value, then I'd like the corresponding Genre Description to be displayed in the DropDownList
Alternately, if there is no value for FKGenreID in the GridView, then I'd like the DropDownList to show that nothing was selected, but have the list of Genres available.
Most importantly here, when the user makes a selection, I'd like the GenreID (from the DropDownList) to be entered into the FKGenreID field in the GridView field.
My thought is that a gridview record may or may not have a value in the FKGenreID field. Either way, the DropDownList is bound to that field. The DropDownList would display a list ofGenre Descriptions for the user to select from. Upon selection, the GenreID column of the DropDownList becomes the value in for the FKGenreID field in the GridView.
Is this possible?
In case it matters, I'm using ASP.NET 4, Visual Studio 2010, and coding in VB