DataSource Controls :: Condition We Should Use The Datareder Instead Of Datatset?
Jun 25, 2010
in .net we have the facility of choosing both disconnected and connected mode to fetch data from database.But I am confused when should I use datareader?
im doing a shopping cart for my website. And i want to do a conditional statement to check if the custname and productcat is inside the shopping cart then i'll only insert/update the quantity of the product he purchased.
here's my code:
Protected Sub btnAddToCart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddToCart.Click
Select (datediff(day,db_TargetDate,getdate())) from tbl_abc
in select statement only i wanted only those record in which datedifference is less than 5.
declaration of variable & then conditional checking is not wanted me because i wanted result is into select statement only & not using print statement.
I have a SqlDataSource connected to database and use a parametrized query to fetch out data.Query has got a very large varchar field on which i have to perform a search.To make search, i have 2 combobox and a textbox organized in this way
MAIN CATEGORY (combobox)-> CATEGORY TYPE(combobox) -> MODEL(textbox).
Based on main category choose, category type is filled from database. At last, it's added a "nothing" combobox item.Now i should search into big varchar field adding category type condition but, if nothing is specified, i should make identical search like all combobox value are selected. How should i, in your opinion, make this using SqlDataSource?
To write a join query with or condition. It means a query has two inner join, here it is possible to fetch the records, if one inner join is true and other is false. I got a record when only two join conditions are true.
I've been experimenting with using EF (asp.net 3.5 sp1) with a master detail page. Using northwind as the database, I'm simply trying to have categories as master and products as detail. I have read everything I could find on the net about the where condition and it still fails with this error as soon as I click the select link in the master grid:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: A property with name 'CategoryID' does not exist in metadata for entity type 'WebAppEF01.Products'.
What strikes me is that the CategoryID column is not exposed by the EF model. That's been rolled up into the navigation element 'Categories' I suppose...but on the surface this seems to create the problem I've running in to. I've tried turning off the autogeneratewhere clause but didn't have success. The code for this page follows below.
I have an asp.net application that uses validation controls on textboxes. However, if the user enters a value in txtFieldA, then I want to disable the validation controls on txtFieldB and txtFieldC.
I have a date base with a table named 'movies'. I want to take information on my database. I use a SQLDataSource. For my presentation, I use a repeater. Here is my code :
[Code]....
But if for exemple, 'champ1' is empty in my database, i don't want to print it in the result of my query ! But i can't arrive ...
In my grid I have three fields: Action date, type name and TypeId. I want to make the Edit linkbutton disabled when the type name is either 'Accepted date' or 'Received Date'. I can do it if there is one condition by the following code, but I can not pass both.
I have a gridview that is being populated off of a query that has joins in it. It works fine. However, I want to display one record of all information but then blank out all colunmns accept 1 for the other 3 records that it is picking up. In other words, right now, all three records have duplicate info in them accept this one column. can this be done? Can I somehow blank out other columns based upon what is in the single column? This is all being done in a gridview. I realize it would do a master detail type scenario but I want all of this information to display without someone having to click on a field or anything.
I have a gridview bound to object data source & in its item template i have some labels and one image control and I have a [Status] column in database that store either true or false in bit format . now what i want is if value in status column is true then image control's ImageUrl property should use image ~/images/Show.jpg and if it have false value then it should show ~/images/Hide.jpg.
currently i am using this code it works fine but i think there must be some good better way to achieve this goal. here is the code that i m using
I have one asp.net gridivew where i have written some code and bind it.. itz working fine now my requirment is when ever any gridview row which conatin column 3rd zero(0) i want to hide tht row ..
I have to write this code to blink particular rows of gridview based on some conditions I found below link which actually does blink but after we click the row. URL...I need that the row should blink as soon as the web page loads.I also tried using the jquery as in below link but it is also giving error as.URL...
I am using Datalist to bind userdetails which contains department name. With RepeatColumns="2" & RepeatDirection=" Horizontal". Now i want to check a condition while binding.for Example; If i am binding with 5 users having 3 users with same department and remaining 2 users with different departments then i want to show 1st 3 users having same department in two rows and remaining to users in next two rows.
In my asp.net+vb web with access database in a gridview i used the following code
Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then If (e.Row.DataItem("TEN") > 24) Then e.Row.ForeColor = Drawing.Color.Red
[Code] ....
The above code is working in my sqldatabase web but not working in access database web...