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

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

CascadingDropDownList and first sql 'where' condition

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :ASP.Net


Is it possible to pass first parameter to webservice via cascadingDropDownList?

i mean lets say we've got method like

public CascadingDropDownNameValue[] GetColorsForModel(

string knownCategoryValues,
string catego

now inside this method we are using following sql expression: select * from A where uid=@UID

how can I pass to cascadingdropdownlist my own initial value of UID? Is it possible?


View Complete Post

More Related Resource Links

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")

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

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

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

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?

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?

place a condition in the RAISERROR

i have a raiserror statement ansd i need to place a condition to not raise the error when specific records exist in the table.   BEGIN RAISERROR( 'TABLE1 records do not exist in refTABLE. Please verify with John.',16,1) END this works ***************************************************** BEGIN iif ((TABLE.TYP_ID) NOT IN (10,20,30,40)) THEN RAISERROR( 'TABLE1 records do not exist in refTABLE. Please verify with John.',16,1) END I need the correct syntax....)

preferred method to choose where to place if condition for query

I have a design problem I could use some help determining how to code this problem.   I have a table with 3 fields, catCode, startDate and endDate. I am having trouble deciding how to query my DB based on the following...   By default a gridview will return all records that match the catCode selected from a dropdown list.   If the user checks a check box, only records are returned where.... startDate <= today AND endDate >= today   How can I apply the If condition to compare when the check box is selected? I used the wizard to build the select statment for the gridview, but I can switch that to a SP if that makes life easier.   Thanks for any and all help and suggestions.  

Q: How to set Condition for the page break

i got two tables in the report and i want to separate them in two pages, so i create a rectangle between them and set page break. However if the first table's content just fit one page and the rectangle goes to the second page, the page break is on and the second page will become a blank page and the second table will go to third page. Any suggestion or clue to cater this issue?

How to use If condition in Joins

Hello, I have three tables in which two are reference tables and one main transaction table. tblRef_ProcedureCode tblRef_MainCode tblTrans_OPCustomer I have two columns in the Transaction table i.e. Proc_Code, Main_Code. I have to get the tariff information against these two codes from the reference tables. I want to join the main transaction table with reference tables on the basis of the following conditions. If tblTrans_OPCustomer.proc_code = tblRef_ProcedureCode.proc_code then get the tariff from tblRef_ProcedureCode (No need to check Main code) If tblTrans_OPCustomer.proc_code <> tblRef_ProcedureCode.proc_code then get the tariff from tblRef_MainCode How could I do this in Join conditions? Many thanks.

asp:TemplateField Visible upon condition in grid view

Hi, Is there a way to show or hide a Template Field within a gridview upon a condition in C#? Thanks! 

i need to display a specific date on a condition

I am trying to display a specific date when a condition exists so i have this case statement but it does not work... ,CASE WHEN @ALTTYPE IN ('INCR','DECR','ADD','FLAG') THEN '09/09/99' ELSE END_DT END AS END_DT
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