i'm trying to check for an empty cell in a gridview.
On the RowDataBound event I tried the following:
- if (String.IsNullOrEmpty(e.Row.Cells[2].Text.Trim()))
- if (String.IsNullOrEmpty(e.Row.Cells[2].Text))
- if (e.Row.Cells[2].Text == "")
None of them worked.
I'm using boundfields. I can't use a TemplateField with a label because I need to check for other stuff for that column in the RowDataBound event by doing e.Row.Cells[2].Text - that only works if I use boundfields.
this is my sql query and its work fine in my code but it only check ParentDeptID IS NULL it not working when ParentDeptID field is empty how can i check it
("select DeptID,DeptName,(select count(*) FROM HrDept " _ & "WHERE ParentDeptID=sc.DeptID) childnodecount FROM HrDept sc where ParentDeptID IS NULL ", _ objConn)
I need to be able to hide or disable a multitude of items (detailsviews, gridviews) when an SqlDataSource returns no rows. So if the page is reposted and no rows are selected, all the controls would be disabled.
I need to be able to check programatically if a SqlDataSource contains no rows, and make a Placeholder visible if it does contain rows, and invisible if it doesn't. I seem to be able to return the affected rows using SqlDataSource1_Selected, but turning the placeholder invisible never works.
turning the placeholder off and on depending on whether the data source contains rows?
I have a asp.net page that has several SqlDataSources defined that feed data into some graphs. The problem is that the graph product does not handle "no data" very well, and throws an error. I'd like this to handle the situation more gracefully-- so I need to check whether the SqlDataSource returned data or now before rendering the graph (and if not, just post a message saying "No Data" or something).
Is there an easy way to check if the data source returned data, and do this if/then without a bunch of code behind?
How can i check if dataset is emty some thing like follows
if dataset=emty then msgbox("NO table") else .... End if I am importing excel files from root folder, when file not there then message should apeear to avoid collapsing application.
Code: ry Dim strExcelConn As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ExcelConnection1").ToString() Dim dbConn As New OleDbConnection(strExcelConn) Dim strSQL As String
I have a gridview with two bound fields. On clicking a button i want to display the values in first row of gridview in two textboxes. But if gridview cell is empty i am getting the text in textbox to which the value of cell is given as -' 'i know my problem will be solved if i use the template fields instead. But i want a solution while maintaining the bound fields ,if any.
I have problem to check "if the file is success deleted".This is the algorithm, if sqldatasource deleted success then ---show message or other action---end if
How do I check if my value is empty AND Isnull? I need to check for both, using ISNULL is not enough because the data can change just so that it is empty.
In this test application, I am filtering by two ControlParameters. As you can see in the first codeblock, both parameters have a default value of %. This code works great. However, in the second code block, please note that the Default Values are eliminated. The second code block works as long as neither Textbox's text is blank. For some reason, when .NET evaluates the filter expression and inserts "" into the expression, it seems to bug out and case none of my results to be filtered.
I am able to verify this behavior by setting the defaultvalue="" for each ControlParameter.Obviously I have found a workaround, but I would like to know why the FilterExpression breaks down when an empty string is provided.
Code Block 1:
<asp:SqlDataSource ID="Customer_Data" runat="server" ConnectionString='<%$ ConnectionStrings:connectionString %>' SelectCommand="SELECT Station, StoreFront, CustomerID as CustID FROM vStations" [code]...
Now I know this works.. but what is the right way to have this? I don't want to be checking something twice instead of just having it written out once.
When I click on the Alphabets it will show the details of a player...however, when that particular letters has no details of the player..I want to show."No results can be found"..Is there anyway to do it?
I have set the value of an int parameter to the attribute of a textbox.The textbox can be empty or null, how to check whether the parameter is empty or null?
I have a detailsview with an update button one of the update fields is a checkbox which when is checked I want to automatically update a date field of when the checkbox was checked, am I going the right way with this code....... as I am getting a number of errors
Dim i As Integer For i = 0 To detailsview2.Rows.Count - 1 Step i + 1 Dim row As GridViewRow = GridView1.Rows(i) [code]....
i have a UP and DOWN buttons ouside a gridview and a checkbox inside the templated field .I will check the checkbox to sleect a row , after that if i click on UP button the checkbox above the selected checkbox should be selected.
same with when i click on DOWN button the checkbox below the selected checkbox should be selected.
I have a check box in the grid.IF IsChecked has a value checkbox should be checked else not.Should i check the check box in the ItemDataBound event or will it get checked automatically.
I have a grid view with two columns...one column has a no. like (123) and a check box....which user can checked or unchecked......all I need to do is that I need to disable the man handling of that check box......rather I would like to see a seperate grid view with the same no. of rows as of the first and in this gridview I may allow to type in or scan the no. and if this scanned or typed number matches any no. in the first gridview number then the corresponding check box should be checked/unchecked.