Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 Can you use a select parameter as a field in the dataset?

View previous topic View next topic Go down 
AuthorMessage
StepSte
Member
Member
StepSte

Posts : 4
Join date : 2011-06-05

Can you use a select parameter as a field in the dataset? Empty
PostSubject: Can you use a select parameter as a field in the dataset?   Can you use a select parameter as a field in the dataset? EmptyWed Jun 29, 2011 8:20 am

Does anyone know if it is possible to use a select parameter as a field in the table using SqlDataSource? I have a function that determines edit rights. I can store the value in a hidden field on the page. If I could get that value into the data table the grid uses, I could use it to set buttons in a master/detail grid that uses templates for the edit and delete buttons. I don't want to call the function for every record in the dataset - that could take a while. And dumping the SQLDataSource means coding the update, insert, delete and select statements.

I tried the following, but I get no records and no errors.

SelectCommand="SELECT *, (@Editable) AS Editable FROM[DBO].[vueOrders] WHERE ([OrderId] = @OrderId) Order By OrderDate Desc">
<SelectParameters>
<asp:Parameter Name="OrderId" Type="Int32" DefaultValue="@OrderId" />
<asp:FormParameter Name="Editable" Type="Int32" FormField="Editable" />
</SelectParameters>

Defining the value in the SQL Server query window gives me lots of records.
Declare @Editable Int
SET @Editable=1
SELECT *, (@Editable) AS Editable FROM[DBO].[vueOrders] WHERE ([OrderId] = @OrderId) Order By OrderDate Desc
Back to top Go down
 

Can you use a select parameter as a field in the dataset?

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» How do i select entries from a mySQL database to use as options in a form?
» Why does document.getElementById work without a parameter?
» Procedure or function expects parameter which was not
» Help with adding an image upload field
» Problem when using ORDER BY a date field from MySQL

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: Can you use a select parameter as a field in the dataset? Edit-trash Useless :: Trash-