Showing posts with label paramter. Show all posts
Showing posts with label paramter. Show all posts

Monday, March 26, 2012

Parameter entered has the wrong format.. you must be ....me!

Hi

I have the problem that the below defined paramter gets entered in the database as a interger. the Field in the DB is a nvarchar(5) and the controll that suplies the value is a TextBox

this is the parameter definition:
<asp:ControlParameterControlID="tbComment"Name="Comment"PropertyName="Text"Type="String"/>

Why do I get this error, why does ASP to whant to make an integerfrom this text field? When putting a interger value in the textbox all works well and the data gets posted to the database.

I use aSqlDataSource with automatic generated script.

look forwart to a solution

walter

Do you use a stored procedure or ...? make sure the parameter (comment) is not passed to a parameter of type int.

Friday, March 23, 2012

Parameter Available Values

If I have a paramter that has query based available values, how do I get it to use a connection string specified in another paramter to do the query?

The scenario is that I have one set of reports that pull from a number of databases that have identical schemas and each serve a different customer. i need to be able to somehow populate the valid values with the right data from the appropriate database at runtime.

Nevermind, I found it.

I just had to populate an array of ParameterValues with just the connection string and then do a call to GetReportParameters, that made sure that the other parameters had the data that they needed.