Forms Data Controls :: Getting Number Of Queries By The Categoryid

Feb 15, 2011

've made a quiz/score system where a user will go through categories (page by page using querystring) and after submitting his/her score i redirect them to the next page where i show them their score and i also want to show "out of x number of questions".

I've made a query in my dataset:

[Code]....

I get an error about "Cannot implicitly convert type "void" to "object". This is the first time i am trying to use the SQL COUNT so i am almost certain it has something with the way i write it in my BLL, but i cannot figure out why or how to write it as it should. Hopefully you can direct me in the right path?

View 5 Replies


Similar Messages:

Forms Data Controls :: Pass CategoryID Within Same Page?

Feb 26, 2010

On a single page, I had got DetailView & Datalist. Datalist contains Category Image(eg Book Image) and detail view will contain products under them (eg Leaning DOS)and in detail view one by one Books(ie Products- eg Leaning Computer) will be displayed.

I had used Detail view to display Product since Products are to be displayed one by one. Now, my Problem is how can I pass category ID to the detail view onthe same page so that on category click it will display corresponding Products in detail view.

View 3 Replies

DataSource Controls :: Return Number Of Rows Affected For Multiple Queries In One SQLCommand?

Feb 22, 2010

I am accepting query/queries from user (our support team) in a text box where user can enter only one query or multiple queries. I need to display result of all queries entered in the textbox. If it is SELECT statement then result of that statement in grid which is done. If UPDATE/INSERT/DELETE then total number of rows affected which is also done but if only one UPDATE/INSERT/DELETE statement is entered in the textbox.

If user enters 2 UPDATE statements and then a SELECT statement then how can I get number of rows affected for individual UPDATE statements just like SQL Server Qury Analyzer displays messages in its result pane.

e.g.

(6 row(s) affected) -- first UPDATE statement

(4 row(s) affected) -- second UPDATE statement

(16 row(s) affected) -- for SELECT statement (grid will also be displayed along with these messages).

I tried almost everything, SqlDataSource (returns count of first statement only), SqlCommand.ExecuteNonQuery and DataAdapter.Fill (returns count of last statement only).

View 3 Replies

Want A Certain Number Of Queries To Run Only Once Per Session, After The User Logged In?

Jan 30, 2011

I'm building a web application: some pages will be accessible by non logged-in users (demo and sign-up pages) and others will only be accessible by logged-in users (actual application). In the global.asax file, I'm currently handling the session start event by loading some variable from a query that's based on the UserID. What will happen when a non-logged in user looks at a page? I guess my question is really about how to handle the session start event when it's a logged-in user, when it's not and when a user logs in. I want a certain number of queries to run only once per session, after the user logged in.

View 2 Replies

Linq To SQL - How To Get Total Number Of Results When Paging Without Two Queries

Dec 29, 2010

I've got the following LINQ query to my IQueryable service

Dim eventcount = EventService.QueryEvents().Count
Dim eventlist = EventService.QueryEvents().Skip((page - 1) * 5).Take(5).ToList

But I'm wondering if there's a way to do this without making two calls to the database?

View 2 Replies

C# - All Queries Combined Using A UNION, INTERSECT Operator Must Have An Equal Number?

Jan 7, 2010

I have a linq to sql query where I have to perform union two set of records.

And I do not have equal number of fields, so added the null

eg my psuedo code is

[code]....

after googling some hours I came to understand that it is bug in 3.5 framework.

Now I want to retrieve the result.

How do I do thatI tried framing into two seperate iqueryable

var a= first query

var b =second query

ilist result =a.union b

This too results in the same error.

View 3 Replies

Forms Data Controls :: When Casting From A Number The Value Must Be A Number Less Than Infinity

Mar 10, 2011

I get this message when i go to update formview.

View 2 Replies

Forms Data Controls :: When Casting From A Number, The Value Must Be A Number Less Than Infinity

Sep 30, 2010

The following code gives error: "When casting from a number, the value must be a number less than infinity."

<asp:TemplateField HeaderText="DATE" SortExpression="date1">
<ItemTemplate>
<asp:Calendar ID="Calendar1" runat="server"
SelectedDate='<%# Bind("date1") %>' VisibleDate='<%# Eval("date1") %>'>
</asp:Calendar>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="Date1" runat="server" Text='<%# Bind("date1") %>'></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>

The error occurs at the line <asp:Calendar ID="Calendar1"...>

It errors because there are records with null value for date1 when the records are returned from the database.

Is there a way to specify in the .aspx file telling it to ignore null or display null/blank?

View 2 Replies

Forms Data Controls :: How To Insert And Cancel The Queries

Nov 17, 2010

I am a total newbie here. I have generated a web page using Visual Studio 2008. It connects to a database and lets me insert records. On the bottom of the form it automatically pus a link for "Insert" or "Cancel". I need them to be buttons. Is this possible? I don't even know where to begin.

View 4 Replies

Web Forms :: Want The Textbox To Display The CategoryID Of The Selected Dropdownlist CategoryName

Feb 4, 2010

I've a web form with a dropdownlist and textbox. The dropdownlist are categories, and I want the textbox to display the categoryID of the selected dropdownlist CategoryName. How can I do that? The dropdownlist is binded with values from database.

View 7 Replies

Forms Data Controls :: Bind Data Returned From Queries Into Individual Columns In Gridview?

Jul 22, 2010

Is it possible to bind data to specfic columns in Gridview?

I mean, if I send a query to my database and it returns 1 column, then bind that column to the first column in the gridview, then send another query and bind the resulting column from that query to the second column without erasing the data of the first column etc etc.

View 11 Replies

Forms Data Controls :: Display Multiple Queries In Repeater

Apr 20, 2010

i want to display results from multiple queries in a repeater... is it possible? for example, a user searches for a keyword "test" i search 4 different databases for it, and display results from all 4 in one repeater.

View 2 Replies

Forms Data Controls :: Multiple Queries 1 Gridview, Updatable?

Aug 2, 2010

in VB, exactly how would you show only 1 gridview for this type of page example, where a user can fill in multiple options for searching:

Enter first and last name
_______firstname
_______lastname

[code]...

View 2 Replies

Forms Data Controls :: Getting Information From Two Queries And Posting Them In A Datalist?

May 26, 2010

I have a Datalist with 6 elements inside (Labels and Hyperlink)This is in the "results.aspx" page. The process in started by the query stings being sent to the this page:...results.aspx?q=(ItemNameSeached)&cid=(City ID number)I have this bound to an SQL Data Source. My problem is that the ITEM_NAME, ITEM_ID (for the More... link), and the ITEM_BUILDING_ID are in one table in my database; The BUILDING_NAME and BUILDING_ADDRESS are in another table.I have an sql query string working to get the information in the items table but I don't know how to get the Building Information which is on another table. I know the sql query to get the building information (SELECT building_Name, building_address FROM buildings WHERE building_id = @ITEM_BUILDING_ID). My problem is that you can't bound two sql data sources and in the buildings query how do I get the value of the ITEM_BUILDING_ID label into the query.

View 4 Replies

Forms Data Controls :: Datasource Update / Delete Queries For Gridview - Can't Edit

Dec 7, 2010

I have a gridview that pulls data from two tables, CLIENT and PAYMENT. I want to add the edit, delete functions to the gridview for the payment portion of the table, that is to edit or delete the payments but not the client. I've manually enabled the edit, delete functions and input the queries. I've also deleted the textboxes from the templates which draw from the CLIENT table so they cannot be edited. Everything looks good on the surface until I actually go to edit or delete anything, and it has no effect.Here's the structure of the two tables:

CLIENT PAYMENT
ClientID Pk PaymentNumber Pk
FName CLIENT$ClientID Fk
LName PaymentDate
ContactNo NULL PaymentAmount
ArrivalDate PaymentDetails NULL
DepartureDate NULL
CurrentResident

Here's the update query:

UPDATE [PAYMENT] SET [PaymentDate] = @PaymentDate, [PaymentAmount] = @PaymentAmount, [PaymentDetails] = @PaymentDetails WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate
AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails) OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))

Finally, here's the delete query:

DELETE FROM [PAYMENT] WHERE [PaymentNumber] = @original_PaymentNumber AND [CLIENT$ClientID] = @original_CLIENT$ClientID AND [PaymentDate] = @original_PaymentDate AND [PaymentAmount] = @original_PaymentAmount AND (([PaymentDetails] = @original_PaymentDetails)
OR ([PaymentDetails] IS NULL AND @original_PaymentDetails IS NULL))

View 3 Replies

MVC :: How To Display Category Name Instead Of CategoryID

Sep 18, 2010

I have class Item & Category

[Code]....

How can I display Category Name? Do I have to add CategoryName into Item class and bind it on aspx page or is there something similar to Html.DropDownList?

[Code]....

View 2 Replies

Forms Data Controls :: Display The Current Page Number And The Total Page Number In The Report Footer?

Aug 10, 2010

I have a web user control with DataList control in it. In my .aspx page, I have a report header, an empty panel as a place holder, a report footer.In my .aspx.vb file, I'll loop through a list of departments. Within each department, I'll load a label to display the department name and the user control for the data, and add both the label and user control to the panel. So there are two variables:
the number of departments and the number of records in a user control.

Now I need to display the current page number and the total page number in the report footer. Is it doable? How? I'm thinking of this approach: declare a page variable count, count the number of department name labels and the number of records in a user control. When the total count reaches a number, such as 20, I'll break the page. This way, I can get the the page current number and the total number of pages. But how to add a page break to an asp.net page?

View 8 Replies

Data Controls :: View Limited Number Of Item From Large Number In Datalist?

Apr 15, 2013

 i want datalist to show only 6-8items ,as these datalist is connected to datasource which has more than 20 items..

like in facebook,we have lots of friends but in friend box only 6 friends is shown and when we click that we go to next page which display all list of friends...

View 1 Replies

DataSource Controls :: Data Retrieving And Checking Queries?

Jul 28, 2010

I'm currently working on a FOREX Live Trading project that I'm implementing.

I already have a database that stores the CURRENCY PAIR, BUY/SELL, PRICE AND QTY.

But I have a huge problem.

Scenario that is:

A person BUYS EUR/USD at a PRICE of 1.29900 @ quantity 100,000. (This will be recorded in the database table)

Then he BUYS EUR/USD at a PRICE of 1.29950 @ quantity 100,000. (This will then be recorded in the database also)

Then he decides to SELL his EUR/USD at a PRICE of 1.31000 @ quantity 200,000 all out. (How can I check from the database if he previously had make a transaction of BUY/SELL, so that I can do my necessary calculations for the P/L Statement)

View 3 Replies

DataSource Controls :: Queries Not Returning Proper Data?

Mar 17, 2010

I am having trouble with queries because they are not returning the data needed, and I am having trouble figuring out why because I only am testing with 2 records.First I want a query to return all records for one customer as follows:

[Code]....

There are two records with the customerID of 1, but it only returns one,next I try to return only one record, the AccountPrimary or customer_contacts.IsPrimary, but when I add " AND customer_contacts.IsPrimary = 'True' "at the end of my query it then returns both records, but only one IsPrimary = True and the Other = False. Is it backwards? I also tried another method and it returned 30 of the same record and I only have 2

View 4 Replies

Forms Data Controls :: Fitting Maximum Number Of Data Items On Screen?

Jan 7, 2010

I want to create a page on which the website's sponsors are displayed. The information about the sponsors is coming from the database via an ObjectDataSource, and I'm retrieving an Image (company logo), the name of the company, and a url to the company's website. Each Image (logo) is of the same height, but of varying width. I want each Item to be formatted so that the Image is on top, and underneath is a centered hyperlink with the name of the company.

This all seems pretty straightforward ... now for my problem: I want to display as many of these on the page as possible. Essentially, start off horizontally and fit as many as possible on each row. A DataList or Repeater with RepeatDirection=Horizontal doesn't quite do what I want as I don't want to have a fixed number of columns.

Is there an easy way to achieve this, or do I have to manually add up the width of each item on an ItemDataBound event, and then somehow move to the next row when the maximum width is reached? In addition I have to deal with the fact that the width of my Item is the maximum of the Image width and the text underneath.

View 2 Replies

Forms Data Controls :: GridView Associate The Number To The Right String Data?

Dec 26, 2010

I have a table that shows datas from a SQL DB. Some of those datas is numeric ( 1,2,3) and in another table I got the name that represents each number.

ex:

1= Goalie
2= Defence

So I did a Class_filters, in which I associate the number to the right string data.

I was wondering how can I do that in GridView? Is it possible?

View 2 Replies

Forms Data Controls :: Limit Number Of Selected Rows In Data Source For GridView?

Apr 30, 2010

I'm sure it was discussed hundred of times, but maybe this time will elucidate some new points )

The question is: do I need to limit number of selected rows in data source for GridView?

When I use paging in GridView does limiting selected rows make GridView work faster?

Now I use ObjectDataSource with Linq in functions.

[Code]....

Does this make sense or I can just use LinqDataSource without thinking of selected rows?

View 2 Replies

Forms Data Controls :: How To Add A Row Number Column

Jan 19, 2011

I have a datagrid that I want to have a column that just lists the row number. Does the data grid have a feature that does this?

View 2 Replies

Forms Data Controls :: Events And Pageload Not Firing After Datagrid Containing Large Number Of Rows Of Data

Sep 6, 2010

I have a datagrid in aspx page.Inside of datagrid i am using around 15 controls such as Button,dropdownlist and text box

controls.Once the datagrid binds then the events in the aspx page not firing.Issue occured when the number of rows greater than 500.The number of rows less then its works fine.

"Platform i am working on ASP.NET1.1"

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved