.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Using a row's visibility as a condition for formatting.

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
how can i use whether a row is hidden or visible as a condition for formatting another row if I am only hiding based on a text box?

View Complete Post

More Related Resource Links

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

Tab container rendered with visibility:hidden - This was reported over three years ago.



Here is (more) code that demonstrates the issue.  If the control in the host page is removed the tab control renders correctly.  Otherwise it is rendered with the visibility attrubute set to hidden as reported in the above link.  Is this broken or am I doing something wrong?



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="S2.aspx.cs" Inherits="S2" %>
<%@ Register Src="~/SelectorPatternControl.ascx" TagName="TestControl" TagPrefix="sam" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
        <cc1:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></cc1:ToolkitScriptManager>

date formatting


I have a 3 field table in sql server express and one of the columns is a date.

I'm trying to pull that in and publish to a gridview, but when I do it comes in with the date and minutes and seconds, etc.

How can I format that so that I only publish MM/DD/YYYY?

thanks in advance 

how to multiple condition in if statement in asp.net C#



i am using if condition to find out a time

if(time=="08 AM)


response.write"shift A";


but problem is how can i put multiple condition in if like

if(time=="06 AM" and "08 AM" and "07 AM")

On page loading or executing all CSS flags are ignored and website is plain without formatting


 My problem is whenever i execute my app the first page that loads is the login page pointed to by my web.config file forms authentication, this page is meant to show CSS formatting for the info i am displaying but it is not. Any help with this problem would be great. A cut and paste of my problem is shown below as you can see there is no CSS.

jsfdnjldfngjfg here it is

Account Login
User Id:
Forgot Password?

I have inserted all the link as in:




CLR Inside Out: Formatting and Parsing Time Intervals in the .NET Framework 4


Learn about enhanced TimeSpan formatting and parsing features coming in the .NET Framework 4, and some helpful tips for working with TimeSpan values.

Ron Petrusha

MSDN Magazine February 2010

Remove HTML formatting


Anyone know how to remove html-formatted-string to plain text programatically?

I want to get the same result as if i ctrl+a in a browser's page and then ctrl+v in a notepad.

I was googled how to strip html string, but didn't find the good result.

Removing tag using regex: "<(.|\n)*?>" causes some problems:

* The html-table is not nicely converted to tabbed plain text. It produces *crazy* table in plain text.

* the html-alternate-image lost

* the list ( <ul> & <ol> ) is not conveted well. No numbering or bullets in plain text

cache condition always return flase


Hi i got a function that first insert cache object in dataset and then check if its empty then query the database otherwise just get record from the dataset of cache object.

Now the problem is, the condition

If DSEktronID Is Nothing Then '

always return false even when i run the application first time? Any ideas?

   Public Function GetEktronID(ByVal UrlAlias As String, ByVal source As Object) As Integer

Dim application As HttpApplication = DirectCast(source, HttpApplication)
Dim context As HttpContext = application.Context
Dim DSEktronID As New DataSet()
Dim da As SqlDataAdapter
Dim dt As DataTable
Dim EktronId As Integer

DSEktronID = CType(context.Cache("firmEktron"), DataSet)

If DSEktronID Is Nothing Then ' If empty
context.Response.Write("inside if")
Dim conn As SqlConnection
conn = New SqlConnection(ConfigurationManager.ConnectionStrings("GAConnectionStringDev").ConnectionString)

da = New SqlDataAdapter("select content_id, Alias FROM [tbl_MobileTodayLookUP]", conn)

DSEktronID = New DataSet()
da.Fill(DSEktronID, "Ekt

Reading/writing Word documents - keeping formatting


I've done some reading about reading from and writing to a Word doc. The reading from worked without issue:

string strPath = "Test.doc";
FileStream fStream = new FileStream
    (strPath, FileMode.Open, FileAccess.Read);
StreamReader sReader = new StreamReader(fStream);
string text = sReader.ReadToEnd();

But of course this is just a string, without any formatting information included. Writing to the document using a StreamWriter worked, but I received errors when opening the document.

I've also read that trying to perform actions on an Office document on a server without the Office products installed on it can result in mayhem. I'm working on a MVC application that will allow users to upload documents to the server, work on them, save their work and email it around. That doesn't specifically require the need to read/write programmatically, but for certain application functions I do need this. Any helpful suggestions are appreciated.

condition Select query

Hi All.Greetings.I have 1 table.Table 1ID | Name  | Sex       |  DateofBirth1   | abc    | Female  | 19802   |abc2   | Female  |20083   |abc3   |Male       |19854   |abc4   |Male      | 2009I want to see if age is greater then 3 year it will adult girl or adult boy. and If age is less then 3 year then it will be child girl or child boy.I have Output like thenName | Sex         |abc    | Adult girl |abc2  | child girl  |abc4  | child boy | etc.....How to write condition query to get my result.Thanks in Advance.

Execute SSIS Package PART based on Some Condition

Hello, Is it possible to execute part of the Package based some condition? (Like If var1 = true, then execute this block). If Yes, what control flow I should use. Please advse. I will have a Package Variable and if that variable is True then some part should execute. REst all should execute every time the package is called. Like if I will have "2 Sequence Container" in my control flow, the first one should execute every time, but 2nd one only if the variable value = True. Thanks, Prabhat

Issues in adding OR condition in MDX

Hi , I have 2 set of conditions which i want to apply OR on. But getting error Query (11, 8) The OR function expects a string or numeric expression for the argument. A tuple set expression was used. Is there a way i can apply OR condition on tuples. Please suggest with ideas, thanks

The condition of creating assembly for external access permission?

To create an EXTERNAL_ACCESS or UNSAFE assembly in SQL Server, one of the following two conditions must be met: 1. The assembly is strong name signed or Authenticode signed with a certificate. This strong name (or certificate) is created inside SQL Server as an asymmetric key (or certificate), and has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission (for external access assemblies) or UNSAFE ASSEMBLY permission (for unsafe assemblies). 2. The database owner (DBO) has EXTERNAL ACCESS ASSEMBLY (for EXTERNAL ACCESS assemblies) or UNSAFE ASSEMBLY (for UNSAFE assemblies) permission, and the database has the TRUSTWORTHY Database Property set to ON. The two conditions listed above are also checked at assembly load time (which includes execution). At least one of the conditions must be met in order to load the assembly. This is a explanation on msdn.I think if only one of these condition is met,it will work. But after I do the first condition,I still can not create an assembly with EXTERNAL_ACCESS permission except SET TRUSTWORTHY on. should the two condition be met?  

Sharepoint: In Calculated Column, Code with multiple "IF" condition does not work.

Implemantation:  Calculate expected resolve date exclude "Saturday" and "Sunday"  based on Priority and Severity.Columns are:1. Priority:2. Severity:3. Raised on: Date record createdCode: Below is the code which contains multiple "If" conditions. For quick undersatnding, i separated major If condition. Below code does not work and sharepoint gives me Sytax error message. =IF(OR(Priority="Critical",Severity="Critical"),IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+3,[Raised on]+1),     IF(OR(Priority="HIGH",Severity="HIGH"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+4, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+4,[Raised on]+2)) ,   IF(OR(Priority="MEDIUM",Severity="MEDIUM"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+5, IF(TEXT(WEEKDAY([Raised on]+3),"dddd")="Saturday",[Raised on]+5,[Raised on]+3)) ) ,   IF(OR(Priority="LOW",Severity="LOW"), IF(TEXT(WEEKDAY([Raised on]+1),"dddd")="Saturday",[Raised on]+6, IF(TEXT(WEEKDAY([Raised on]+2),"dddd")="Saturday",[Raised on]+6, IF(TEXT

Workflow 3.5 Activity property is null in condition and nowhere else

I have an activity that has properties that look something like this (they're set up as proper dependency properties, I just kept it simple here): public List<MyType> TypeList { get; set; }public Int32 Index { get; set; }public MyType SelectedType { get; set; } and an execution that just does this: SelectedType = TypeList[Index]; TypeList and Index are values that I set from other activities. I don't set SelectedType to anything in the activity properties, I just let it get set in the execution. Now I know for a fact that SelectedType is getting set properly, I can even point another activity to it and print out some values from it. So I'm quite positive that there's nothing wrong with that activity. However, I have an if activity with a condition that looks like this: ((MyActivity)GetActivityByName("activity1")).SelectedType != null and it evaluates to false (meaning it evaluated SelectedType as null). I'm pretty sure that that activity cast is correct (I do things like that all the time), and if it weren't wouldn't I get a null reference exception when trying to access SelectedType? So I'm pretty sure I'm not doing anything wrong here, but for some reason SelectedType is coming up null in that condition and no where else. It's almost as if the condition is being evaluated before the activity is being run, but the activity comes well before the condi

Receive/Delete Multiple FTP Files based on condition using SCRIPT(VB) TASK

I am trying to receive and delete multiple FTP files from a remote FTP server using Script task Below is the code   Dim FTPConnMgr As ConnectionManager FTPConnMgr = Dts.Connections("FTP Connection Manager") Dim FTPClientConn As FtpClientConnection = New FtpClientConnection(FTPConnMgr.AcquireConnection(Nothing)) Dim FileTimeStampNew As String = "20100913021807" Dim remoteFileNames(0) As String remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "*" & FileTimeStampNew & ".*" 'Below hardcoded FileName works good. But the problem is there are lots of file in the FTP folder that I dont want to receive 'remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "Company_alpha_Full_20100913021807.xml" Dim localPath As String = Dts.Variables("FtpLocalDirectory").Value FTPClientConn.Connect() FTPClientConn.ReceiveFiles(remoteFileNames, localPath, False, False) FTPClientConn.Close() Dts.TaskResult = ScriptResults.Success End Sub End Class If i specifically mention the RemotefileNames this works fine but, when I say *.* it executes succefully but doesn't receives the file. Please advice how to receive multiple file based on a variable BR, AWM

Hiding and showing the columns depends upon the filter condition

H,   We developed around 70 ssrs reports for our new application.Its like,all the report names are menrioned in the left hand side and if we click it,.Net calls the SSRS reports and shows the filters in the top of Right hand side.   We will select some filters there and then 'GO', it will fetch records. The issue now is, assume we have 6 columns in the report and depends upon the selection in the filter area, the columns should vanish.is it possible?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend