Forms Data Controls :: Trying To Use A Couple Columns From SqlDataSource In Code Behind?
Jan 29, 2010
Basically, what I want to do is to get all my data in 1 statement and then pull data from that into a GridView. I already have the columns that I want displaying in the GridView, but now I want to insert a footer row in between the header row and all the datarows, that contains a couple columns that will be the same for every row in the GridView. So something along the lines of this:
I have a gridview that loads with a new datasource on button click event. On the gridview (which is located in a table columm incidentally) are 2 columns, a descriptor and a checkbox. The problem is that after postback, the column widths change, the checkbox column expands and the other column contracts. Is there a way to keep the gridview column sizes the same after postback?
I have set a couple of my DetailsView fields to readonly=true. In Update mode the fields are readonly but in Insert mode they are not readonly. What do I do to set it to readonly or blank (no field for entry)?
in asp.net page user able to select gridview Columns, and it will hide remaining columns and that selection done by check box with column list bellow is Image link , what exactly I am looking for [URL] it look bellow after selection of column done [URL]
I searched on this all morning, but I'm still not sure. If I create a session variable to pass some data between a couple of pages, does that variable time out after it reaches the timeout period set on IIS, or will it persist for the entire time the user keeps a session alive? For example, session variable is used shortly after login and then never again. Susy uses other pages for two hours and keeps session active. Did that first session variable die after 20 minutes, or is it still there 2 hours later?
I am developing web-app in .NET for 5 months (and enjoying it =)) and I am reading 3 books, all of them teachs at least 2 methods for acessing data: ADO.NET and SqlDataSource object.
I am used to work with ADO.NET method because I feel that even if it needs coding by hand, I can separate the SQL routines from the page and I can customize database routines better.
For now I am using DataReader mode because the application and the database is on the same server and there is only 1Gb RAM available so there is no advantage using DataSet on this moment.
Am I thinking this right? There are some things with SqlDataSource that I don't know how to do it well...
I have a routine that inserts a record on a table then gets the ID of this record using SCOPE_IDENTITY() function of SQL Server, than it uses this ID to insert another record on another table. Because I use a one-to-many relationship on multiple tables...
How can I work this situation using SqlDataSource object, is it even possible?
I have a table with articles. Every article has a column named category which value is either 1 or 2 On my landingpage the article headers are displayed as hyperlinks. All the articles with category 1 will be displayed in a repeater control on the left side of page and all the articles with category 2 will be displayed in another repeater control on right side of page. I know I can bind the repeaters to two different sqldatasource controls with different SELECT statements. But I wonder if I can do this by only using one sqldatasource control, and if this is better and proper way of doing it. If so, do I create a (datatable?) and do the sorting there?
i designed a gridview to update, delete the records using sqldatasource, (there is no code in my aspx.cs file) but i dont know how to add the new row the gridview. so that if the table is empty then i cant add / update / delete the data.
how to Add new record on gridview using SQLDatasource without any code behind code?
i am facing a minor problem but can't find out its syntaxi have listview, and inside the template i have 2 labels, in design time i bind 1 label to one column thatis 'type' and depending upon this type i want to bind other labels to different columnsif type is question than 2 label will have to show data of question columnif type is job than 2 label will have to show data of job, so on........how to accomplish this,in databinding event handler i can check the value of typebut i want to know the syntax of binding 2 label in run time, with different fields using EVAL
I am using Visual Web Developer (VWD)and I dragged in i.e created a Gridview. In the codebehind of the page, I will like to declare an sqldatasource and get data from a database using the sqldatasource and then bind the sqldatasource to the Gridview. PS: I know how to drag-in an sqldatasource and attach it to the gridview using VWD but this time, I want to do this declaratively in the codebehind.