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


Post New Web Links

Optional Parameters - Not taking values when supplied

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
 
All, I have a report that takes 2 optional parameters, one int and one datetime. My data tab is set up as follows: CommandType = Text, Parameters has Parameters.Value etc. for both. Report Parameters are allowed NULL value, Default Value is NULL, datatypes are Integer and Datetime as well. This only runs when the parameters are not supplied values, when I enter a date, it does not take it into account, same for the int value. I have run the proc manually to verify that the query is set up correctly, it seems like the values are not being passed? Any help debugging this would be helpful. Thanks.


View Complete Post


More Related Resource Links

Optional named parameters work pretty well

  
Rob has found a use for dynamic: http://blog.wekeroad.com/2010/08/06/flexible-parameters-with-csharp Yay! Let's celebrate! Well, I was a little puzzled because I don't think it quite adds up in the specific example he chose (although please see no aggressiveness here: Rob's a friend; peace!). The idea is to have the same flexibility that a dynamic language can offer in terms of evolution of an API. Here's his original Ruby example: def my_method(args)   thing_one = args["thing1"]   thing_two = args["thing2"] end my_method :thing1 => "value", :thing2 = Time.now The idea, which is quite common in dynamic languages, is that instead of passing a list of predetermined parameters in a specific order, you...(read more)

Silverlight 4.0 Optional & Named Parameters

  
Named & optional parameters are a new C# language feature coming up with .NET FX 4.0 and guess what. it's in Silverlight 4 as well! Optional parameters will come very useful when defining complex APIs where you would usually have to provide several overloads for the same method for it to make sense to wide variety of usages. Let's take a look at this basic example:public void PositionWindow(bool isTopMost, double left = 0, double top = 0, double width = 800, double height = 600){Window window = Application.Current.MainWindow; window.TopMost = isTopMost;window.Left = left; window.Top = top;window.Width = width;window.Height = height;} isTopMost is the only parameter that's required, all other parameter specify their default value, which makes them optional. But what if you wanted to provide the size only and leave the position to be set to defaults? Enter named parameters. The same method above can be called also with:PositionWindow(isTopMost:true, width: 600, height: 200); // named parametersPositionWindow(true, width: 600, height: 200); // naming is optional when positioned rightPositionWindow(true, height: 200, width: 600); // order doesn't matterPositionWindow(height: 200, width: 600, isTopMost: true); // ... even with the required parameters Simple ... Cheers:)

Wierd case of: Msg 213, Column name or number of supplied values does not match table definition

  
Hi, I'm working on several triggers (that happen after insert or update) in order to log the changes in a different table. They all follow a similar syntax and are working fine, except for this one... I've reduced the next code to the minimum that gives an error, so we can safely assume the other parts of the trigger are working fine. INSERT INTO [Adt].[WardUnitStayLog] SELECT t.* FROM [Adt].[WardUnitStay] t INNER JOIN inserted i ON i.[Id] = t.[Id]; I've used this same syntax (but on different tables) in other triggers, and these are working perfectly fine. The above query provides the next error: Column name or number of supplied values does not match table definition. I've checked both tables for differences in the columns, but to no avail... (I've checked them manually and by outerjoining the information_schema.columns) (I've also checked the order in wich these columns are defined, they match over the two tables) These are the creation scripts for the tables: CREATE TABLE [Adt].[WardUnitStay] ( [Id] [dbo].[Id] IDENTITY(1,1) NOT NULL, [UnifiedUnitStayId] [dbo].[Id] NOT NULL, [WardCd] [dbo].[Cd] NOT NULL, [_FirstAtTm] [dbo].[Dtm] NOT NULL, [_IsReservation] BIT NOT NULL, [_LastAtTm] [dbo].[Dtm] NOT NULL, [_LastBedCd] [dbo].[Cd] NULL, [_LastPhysicianUid]

Parameters and Null Values ..!

  

Hi There,

I was develop an application (ASP.Net) Using (VS.Net C# 2010 & SQL Server 2008)

And I was applying (3-tyer Basics) and I'm not using wizard forever in my application.

The problem is :

When I try to passing the parameters to database, some fields I don't type it

But it's show in database (Empty like "Space") in text fields and (01-01-1900) in date fields

 Although it's must be (Null) .

How I can pass parameters with Null Values for the fields that's not typed  ?

Thanks in advanced 


Unable to set "column settings" of Yes/No (Check Box) values "Required, Optional, Hidden" of content

  

Hi, SharePoint 2010 and I have created a number of site columns of type Yes/No (check box). I have created a number of content types and used these column types but when I try to change the column setting within the content type to "Required, Optional or Hidden" I am unable as the settings are greyed out and I am unable to change them.

Even in the Parent content type I am unable to change this particular type of column value so it isn't an inheritence setting as it's the parent content type. Am I doing something wrong?  

Note - I am recreating a list from a SharePoint 2007 site and I am able to change the setting here, have i configured this incorrectly or was this something that could be done in SP 2007 but not SP 2010.

Thanks fo any help.


Can we pass dimension values as parameters in MDX

  

Hi All,

I am doing something similar to basket analysis and I wrote an MDX to see the trend of purchases over time for a customer. How can I dynamically pass values of customer or product purchased into mdx? In below example how can I change [product].[category] value? Also, can we change the dimension also dynamically?

 

with member measures.x as

Hidden Parameters do not refresh available values

  
I am trying to have preset values for date parameters that the user can override.  I set one parameter that has a list of presets, Last 24 hours, Last Year, Etc.  I then set my date parameters default values based on this selection.

The problem is that this happens once at report load based on the default period selection, but the dates are not recalculated if they change the date selection.

As a workaround, I created an intermediate parameter with an available value based on the period selection, and then based the default value of the date parameters based on this intermediate parameter.  This works perfectly, as long as the intermediate parameter remains visible.  If I set it to hidden (not internal) it seems that it's available values are not set, and thus the chain breaks.  Is there any way around this?

Populate list of values for runtime parameters. SQL server 2008

  

Hi,

I have created a Trial balance report using report builder and have setup runtime filter parameters for GL description. I would like to populate  runtime filter parameter with values from the GL master table (GL00100) enableing users to select  values from the drop down list.

How  can i acheive this task? 

Regards

Vincent

 

 


encoding function parameters and return values when binaryMessageEncoding is used

  

Dear All,

I'm creating simple web service that will accept some parameters (such as customer name and file name) and return content of an xml file as a string and WS client will save it on his side. I'm using custom binding with binaryMessageEncoding and httpTransport. The question is if it is possible to have these input parameters as well as returned xml content binary encoded somehow?

Thanks in advance for your help!


Dzordz

Inserting Property values of class into ParamArray parameters as object()

  

Hi All,

Using the properties as defined in a class, how about can I put them into the ParamArray parameters argument of my function.

The code as follows:

Public Class MyObject

   Public Property Prop1 as string

   Public Property Prop2 as integer

   Public Property Prop3 as Boolean


   Public Sub  AddNewMyObject

        MsSQL_ExecuteNonQuery("StoredProc_AddNewMyObject", ________________?)

   End Sub

End Class


Protected Function MsSQL_ExecuteNonQuery(ByVal storedProc as string, ByVal ParamArray parameters as object())

'Some Code here.

End Function


Please kindly help and advice.

Thank you in advance.


Warmest Regards,

leroylll



"Procedure has no parameters and arguments were supplied." Error

  
Hi all, 
I keep getting a "Procedure has no parameters and arguments were supplied."
Here is the stored procedure and code-behind:
ALTER PROCEDURE [dbo].[c_clinical_services_erp_insert_submission] 


AS

DECLARE @my_err as integer 
DECLARE @id as integer
DECLARE @REC_ID_OUTPUT as integer
declare @award_id as integer
declare @submitter_username as varchar(50)
declare @submit_date as varchar(50)
declare @nominee_name as varchar(50)
declare @nominee_dept as varchar(50)
declare @aop_goals as varchar(50)
declare @reason as varchar(5000)
declare @award_cat as varchar(25)
declare @quest_num as varchar(25)
declare @answer1 as varchar(1000)
declare @answer2 as varchar(1000)
declare @answer3 as varchar(1000)
declare @answer4 as varchar(1000)
declare @answer5 as varchar(1000)
declare @answer6 as varchar(1000)
set @id = 1
SELECT @REC_ID_OUTPUT = @@IDENTITY
set @award_id = 1
set @submitter_username = 'cjose'
set @submit_date = '10/25/10'
set @nominee_name = 'lee'
set @aop_goals = 'test'
set @reason = 'test'
set @award_cat = 'customer service'
set @quest_num = '1'
set @answer1 = 'gfehfds'
set @answer2 = 'gasd'
set @answer3 = 'gfsdfs'
set @answer4 = 'gsdfds'
set @answer5 = 'sdfs'
set @answer6 = 'sdfghs&

Split Parameter and asign comma seperated values to different parameters?

  

Hi All,

I have a paramter field @param that gets passed a comma seperated list of values eg ('Value1','Value2','Value3').

 

What i would like to be able to do is split these values out and assign them to paramters for later use.  So if for example 'Value1','Value2','Value3' was passed i would count the number of values and in this case its 3 so create 3 parameters named

 

@One = Value1

@Two = Value2

@Three = Value3

 

Is this even possible?

 

Many Thanks,

Slash.

 

 

 


Linq: how to share parameters between lambda expressions ?

  
When using Linq to objects, you will quickly feel the need to pass some parameters from a method to another but it's not so easy because each Linq method is not calling the following one. In a Linq sequence, each method is using the result computed by the previous one. So, local contexts are not visible from one method to another.
The compiler is using two technical different ways to let parameters go out of a method.

How to Encrypt Query String Parameters in ASP.NET

  
Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

How to Pass Values Between Web Pages ASP.NET

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

jquery autocomplete multiple values

  

i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?

 


Categories: 
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