DataSource Controls :: Number 1 Working As The Same As Number 2?

Apr 22, 2010

any one know why are the following two give me different result? they should both give me no results as the value I give is not available. however, number 1 give me many results, and number 2 works as expected. I'd like the number 1 working as the same as number 2.

1. DECLARE

@SearchMCat nvarchar,
@SearchTitle nvarchar,
@SearchDesc nvarchar
SET @SearchMCat = 'fjiewo;jafoia'
SET @SearchTitle = 'fryere'
SET @SearchDesc = 'fdsfdsafae33'
SELECT ArticleCategory.CategoryDisplayName, Article.AudioPlaybackTargetTabID, Article.VideoPlaybackTargetTabID, Article.StartTime, Article.DateAdded, Article.Body, Article.Synopsis, Article.Title, Article.ArticleHasAudio, Article.ArticleHasVideo, Article.createdBy,
Article.RatingTotal, Article.RatingCount, Article.ArticleID, ArticleCategory.CategoryName
FROM ArticleCategory RIGHT OUTER JOIN Article ON ArticleCategory.ArticleCategoryID = Article.MasterCategory
WHERE (ArticleCategory.CategoryName LIKE '%' + @SearchMCat + '%') or (Article.Title LIKE '%' + @SearchTitle + '%') or (Article.Body LIKE '%' + @SearchDesc + '%')

2.

SELECT ArticleCategory.CategoryDisplayName, Article.AudioPlaybackTargetTabID, Article.VideoPlaybackTargetTabID, Article.StartTime, Article.DateAdded, Article.Body, Article.Synopsis, Article.Title, Article.ArticleHasAudio, Article.ArticleHasVideo, Article.createdBy, Article.RatingTotal, Article.RatingCount, Article.ArticleID, ArticleCategory.CategoryName
FROM ArticleCategory RIGHT OUTER JOIN Article ON ArticleCategory.ArticleCategoryID = Article.MasterCategory
WHERE (ArticleCategory.CategoryName LIKE '%' + 'fdsafdsafdsa' + '%') or (Article.Title LIKE '%' + 'fffaery' + '%') or (Article.Body LIKE '%' + 'fdas3r43ffdsa' + '%')

View 4 Replies


Similar Messages:

Name Or Number Search In Textbox While Entering The First Letter Or Number Charactor Or Number?

Feb 2, 2010

I am using the asp.net and framework 2.0 with Ajax enable web.i have a text box and when user will enter "a" or number in this will search the name started from "a" character or number if he or she enter the number basically we can say live-search.

Employee search: Textbox.In this text box she/he will enter the first character of name or first number of employeeno and according to the a character name will search in list.

View 1 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

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 :: 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

Forms Data Controls :: Format Phone Number Not Working?

Jan 6, 2010

I have been attempting to find a solution for my phone number formatting problem for 2 hours now and I am not getting any closer. My 10 digit phone number is stored as a varchar(14) without any formatting (just 10 digits).

Here is the code to format the phone number in a gridview:

[Code]....

why the formatting won't work? It just displays the 10 numbers with no formatting.

View 8 Replies

Forms Data Controls :: DDL Not Working For 1500 Number Of Items?

Feb 4, 2011

I experience a strange issue with DropDownList today.

It is bind to SqlDataSource which produce about 1500 item. SqlDataSource working properly and no mistake in SQL.

When i bind it to a DropDownList, first item automatically selected on load. But if i try to select other items, DDL never renders. Width of DDL shrinks to zero. But if i use UP and DOWN arrows, i can go through items which appears on the first line of DDL. Shortly, DDL never render a LIST of data for me as it is supposed to do.

If restrict the data as "SELECT TOP 100 SupplierName blabla..", the DDL works properly. Is there any data limit in DDL? 1500 line is massive for DDL?

With the same SqlDataSource, ListView control is working succesfully.

Here is my ASPX

[Code]....

View 3 Replies

C# - Dynamically Append Number To PDF Or Make Submit Button Change Its URL Based On That Number?

May 4, 2010

I'm serving up PDFs from a SQL db and presenting them in the browser. I'm trying to figure out a way to embed a number in the PDF dynamically so that the recordID for that PDFs SQL record is available to me when the user submits the XML form data. The user hits the submit button on the form and the form submits its XML data to my submission page. If there is some way of changing the submission URL on the fly then I could do a query string to pass my self the recordID. I'm not generating the PDF in code, its being created by hand and then uploaded to my site.EditUser is given a link someServer.com/pdfLink.aspx?formID=5 they go there and that pages pulls a PDF from the DB and displays it. This pulls up acrobat in browser full size so my aspx page isn't in control of submitting the completed form, Acrobat is. The user fills out the form and hits the submit button in the form. This submit button was set up at form design time to point to another page someSite.com/pdfSubmit.aspx The submit button posts the XML data to that page and I can process it. I need the recordID in the query string for the someSite.com/pdfSubmit.aspx page. To do this I would need to modify the PDF to either add the recordID and query string to the submit button's submit URL, or embed it in the PDF else ware. The big question is how do I modify the PDF just before I display it via someServer.com/pdfLink.aspx?formID=5 to do either of these two options.

View 3 Replies

DataSource Controls :: Get Max Number Of A Column?

May 17, 2010

could some one help me how can i get max number of a column in sqlserver2005.

actually in my column records are,

1,2,3A,3B,3C LIKE this format.

so how can i get max numer i.e 4 here.

View 21 Replies

DataSource Controls :: How To Get The Serial Number

Jun 7, 2010

How can I get the serial number when you add a new row in the table Add time in order to add the number in the second table

I mean I want in same the sqlcommand to insert and get the value of ( serial )..

View 3 Replies

C# - The Number Of Users Online And Number Of Active Session?

Mar 12, 2011

My environment is ASP.Net + IIS 7.0 + Windows Server 2008 + .Net 3.5. I am wondering whether the number of users online and number of active session are the same thing? The other question is, no matter whether they are the same, how to calculate them (i.e. for a given time, what is the number of users online, and related active number of sessions)?

View 1 Replies

DataSource Controls :: SQL Statemet To Retrieve Particular Row And X Number Of Following Row

Jan 22, 2010

how do you retrieve a particular record in a table plus x number of records that comes after it, assuming it is ordered in a particular way?I want to retrieve 3 records, and I want record where Row_A = 2 to be the first record, and the next 2 more records that follows it, assuming it is ordered by Row_A.

View 2 Replies

DataSource Controls :: Error - Number Must Be Either Non-negative

Feb 23, 2010

I had a repeater that will be binded using dataset

[Code]....

and on page load I write this code

[Code]....

it worked very well on my machine , after applying it on the server it give the following error

Server Error in '/' Application.

Number must be either non-negative or -1. Parameter name: millisecondsTimeout Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Number must be either non-negative or -1. Parameter name: millisecondsTimeoutSource Error:

[Code]....

Stack Trace:

[Code]....

View 3 Replies

DataSource Controls :: Max Number In Column Of Datatable?

Jan 27, 2010

i have a column seq_no in datatable. if the column with data 2,4,5 how can i have the max number of the column. C#

View 5 Replies

DataSource Controls :: Convert Day Of Week Number To Day Name?

Jun 1, 2010

I have seen a lot of posts online about converting the date, or day of week to a number (1-7) representing what day of the week it is.Unfortunately, I have a database that I'm trying to import that is using that number, and I need to convert it to the Day of the week Name. Is there an easy way to do this?

View 4 Replies

DataSource Controls :: Storedprocedure, Where Functie Only If The Number Is Not 0?

May 24, 2010

need a Stored Procedure with a where with 23 where items.But if a item is 0 then i should skip that selection.So i need something like the code below, but sadly that doesnt work... And 23x23=529 selections isn't a option for me.

[Code]....

select * from tblMatchData

View 2 Replies

Forms Data Controls :: Line Number On GridView - Container.ItemIndex Not Working

Apr 12, 2010

referring to: [URL] v nice it works.. but i have tried this before in my previous app it works but i just try now <%# Container.ItemIndex &#43; 1 %> but not work ..what is the difrence in these

View 3 Replies

DataSource Controls :: Remove The Number 12 And Remain 11,13 In The Field?

Feb 25, 2010

I have a field that may or may not contain comma.

if the field contain some word and separated by comma

how can i remove specific word in the field.

e.g. the field contain --> 11,12,13

how can i remove the number 12 and remain 11,13 in the field?

View 5 Replies

DataSource Controls :: Retrieve Particular Number Of Records From Table?

Jul 5, 2010

I want to retrieve particular no of records from table with Condition..

my table structure is
QID Question Status
1 ssssss True
2 ssssss True
3 ssssss False
4 ssssss False
5 ssssss False

here i want to 3 questions condition is Status Filed TRUE Questions are must be getting..

View 9 Replies

DataSource Controls :: How To Get The Current Identity Number When Doing Insert

May 20, 2010

The scenario is that I wanna insert a record to the database via INSERT query and I need to user the identity number of this record in the INSERT query.

But I don't know how to achieve this.

Here is my table structure and code for your better understanding.

There are three columns in the Table: categoryID, categoryName, categoryPath. I need the path based on the categoryID which is an identity int column.

Now I used this code to do INSERT:

[Code]....

View 6 Replies

DataSource Controls :: Convert Number To Word In Sql Server?

May 22, 2010

how i canconvert number to word in sql server

like 100.255 = one handerd and 255

like financial bill

View 8 Replies

DataSource Controls :: Inserting Large Number Of Records?

Mar 10, 2010

I want to insert a large amount( approx 7000 records) of data into a table, My scenarios is that i need to check whether the record already exists then it will not insert it. Currently i am using a stored procedure for this which gets called for each record.

IF EXISTS(SELECT 'True' FROM MYTABLE WHERE ID = @ID)
BEGIN

--This means it exists, return it to ASP and tell us

SELECT 'This record already exists!'
END
ELSE
BEGIN

--This means the record isn't in there already, let's go ahead and add it

SELECT 'Record Added'
IF EXISTS(SELECT 'True' FROM [Aadil].[dbo].[SharePointSitesData] WHERE ID <> @ID)

View 11 Replies

DataSource Controls :: How To Count Number Of Rows In Database

Jan 8, 2010

i am using sql 2005 db. i have created a table called attendance where i store employee attendance, i want to separate number of absence for a particular employee and particular month. It have to show number of absence of a particular employee and particular month. Also i have to count no of absence. for eg: if an employee absence for two days for a particular month, it have to display 2 count.. how to do this? also how to write the store procedure for this?

View 4 Replies

DataSource Controls :: SqlDataSource Variable Number Of Parameters

Mar 7, 2011

I should perform a Query like this Select * from produtcts where model like @MODEL Now if model is selected from combobox, it should be Select * from produtcts where model like '%MODEL1%' while, if selected chooise is null, it should be like each element in my combobox. how should i do this (in SqlDataSource)

View 5 Replies







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