i have a gridview with one column as commandfield-select. now where and how to code the select ? i mean to make an action when this 'select' commandfield is clicked?
I have SQLDataSource for my gridview. By default it works fine but i need to determine a few things before calling my procedure. By this i mean i need to determine a few things about the fields completed and set a flag to determine where the procedure will look.
I found a few examples online on passing parameters in code behind, but cant seem to get them to work. Here is what i tried and cant get results back. When i execute the procedure on the SQL side with the same parameter values, it works, so i know its returning results, so means my values are not being sent or im doing something really wrong. I have some of the lines commented out so the page can load and display for now.. but i need to get it working with custom parameters and flags.
I have a DetailsView control with a SelectMethod and two select parameters wich one of the parameters is a control parameter, The parameters are not passed to objectDatasource's select method, the objectdatasource has been defined as follows:
I'm trying to allow my users to select a record from their list of attendees and edit it using a details view positioned below the GridView. The issue I'm having is when I run the code I get my error message and no data is displayed in the DetailsView. Error Message is:
DataBinding: 'System.Data.Common.DataRecordInternal' does not contain a property with the name '10002'.
I want to have a dropdownlist in the footer row of a gridview. The dropdownlist must be populated with an stored procedure that receives a parameter and has a select. Is that posible?? I think yes but I having problems with the parameters.
[Code]....
The exception says incorrect sintax... but I've changed the procedure for something very simple to solve the problem like select 'hello' or select 1, 'hello' and I'm getting the same problem...
The drop down list is used to determine what search criteria will be used to find an invoice. I tried to set the Select method in the switch statement. I don't understand how to set the Select Method and the select parameters programmatically though . I tried a few different ways but can't make the compiler happy. My ODS is in scope in the code behind. I'm not able to access it's properties though. The BAL resides in a separate project that is a ClassLibrary. I also have a using statement for the ClassLibrary project in the code behind.
When I want to get the output values its okay but I also want returning a table as a result data.But Datareader has no rows.is it possible if I want a returning query result and multiple output values togather ?I wrote a test above.I can get output values as sqlparameters. But Datareader attached to a Gridview is empty.can you detect whats wrong here and it doesnt return a query result.So stored procedure is not standart or ı am doing something wrong.this doesnt raise any exception.but not returning any data.
I am using the following code to select data which appears between 2 dates:
string query = "SELECT (name, date) FROM date where tableinfo BETWEEN @date1 AND date2";[code]....
Now the above code is working fine. The only problem is that the date in the date column of the gridview is not in the proper format. What can i do in order to change the format of the date in the gridview. If the format of the date is changed in the databse itself I may be able to use the above SQL query.
In the past, I've created a GridView where users can click a linkButton control to fire a select command, and in the code behind, I had some code to work out what row had been selected.
I am doing a library application. I am using a formview control to display and edit the details of an existing borrower.
What I wish to do is to allow the user to enter the borrower barcode into a textbox and select the details of the borrower corresponding to the barcode.
At present I have kept the textbox and a button outside the formview. Once the user enters the barcode in the texbox and clicks the button, the data is displayed in the formview control.
Now, my doubt is that is there a way to keep the textbox inside the formview control itself and use the value(Which should be user input) for selecting the details?
How can we programmatically select a row in GridView control based on the datakey.That means, I know the Primary key of the row which I want to select. So how would I select that particular row?P.S. I dont want to select it based on Index.
i'm using the code below to select multiple rows in a gridview using a checkbox, how do I modify the code in a "select all" button click event to select all the rows by checking the checkboxes in all the rows? How do I also clear all the checkboxes using sa "Clear" button click event?
I am trying (unsuccessfully) to pre-select a radiobutton control (within a DetailsView control) based on a value found in a database.
There are only two values: "Yes" and "No". A field in the database has one of the values in it and I want the correct item selected when the record is displayed in Edit mode.
All my other record fields are displayed correctly--this is the only one giving me issues. I am using vb.