DataSource Controls :: Cannot Sort String With Negative Sign On The Left In SQL Server

Jan 21, 2010

I have encountered a problem about "order by" sorting in SQL. As some of the items (strings) in a dropdown list contain negative sign on the left, it is surprising for me that the SQL server cannot sort the items in an alphabetical order and as a result I was forced to set the property value (IsSort = False) of the Ajax ListSearch, which slow down the searching speed a lot. Below are examples of two of the string items with a negative sign on the left.

View 6 Replies


Similar Messages:

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 :: How To Put A Greater Than Sign In An SqlDataSource

Feb 26, 2010

What is the best way to put a Greater than sign in an SqlDataSource

The code will run but it is underlined with an error "Attribute values must be enclosed in quotation marks."

Sample code looks like this...

SelectCommand="Link.Section, Link.PostDate.....

WHERE...

and (PostDate <= GetDate()) and (isnull(postremove, getdate()) >= getdate()))">

View 2 Replies

DataSource Controls :: Left Or Right Justifying Text File

Mar 9, 2010

I am using sql to create a table from stored procedures and then streamwriter in vb.net to create a text file based on the sql table. Where and how do I control the right or left justification of the records in the text file?

View 1 Replies

DataSource Controls :: SQL Left Select Not Pulling Records?

May 12, 2010

The DoctorGen Table has primary key DocId and Doctors has Keys set on DocId and MemId. I want to get all records from DoctorGen where UserID = @UserId even if there are no matches in the Doctors Table. I'm not getting any records.

[Code]....

View 13 Replies

DataSource Controls :: How To Left Justify And Pad My Output On Select

Jul 7, 2010

I am reading a column value from the database. The field is defined as 30 charswide. If the vale read is less than 30 chars, I need to pad it on the right side withblanks. So that the value when written to a text file will appear to be left justified.How can this be done? I know how to right justify like below. But how do I left justifyand pad on the right side with blanks?Right(LTRIM(RTRIM(CustomerNum) + SPACE(30)),30) As CustNum -- This right justifies.This will NOT left justify so I am stuck :LEFT(SPACE(30) + LTRIM(RTRIM(CustomerNum)),30) As CustNum -- This WIL NOT justify as I wish

View 2 Replies

DataSource Controls :: Left And Right Outer Join In C# Using Linq?

Apr 20, 2010

How to use Left and Right Outer Join in C# using Linq with Eg.

View 2 Replies

DataSource Controls :: Left Join With Entity Framework?

May 17, 2010

how to do this query in EF1:

[Code]....

View 3 Replies

DataSource Controls :: Left Join 2 Data Tables?

Jan 29, 2010

I have 2 different datatables. 2 datatables from 2 different servers.

My first datatable is this:

SELECT DISTINCT a.name, a.create_date, a.Modify_Date, a.Object_Id
FROM dbname.sys.objects a

and my 2nd datatable is the same, but from a different server connection string

SELECT DISTINCT b.name, b.create_date, b.Modify_Date, b.Object_Id
FROM dbName.sys.objects b

Basically, I want to compare which procedures are on one server and not the other (dev and prod)

So after I have my 2 datatables i want to create a data relationship on the name and then do a left join to see whats in a and not b.

View 1 Replies

DataSource Controls :: Linq To SQL Return All Results / Wild Sign?

Feb 2, 2010

I've been reading around, and it sounds like this is somewhat common, though I'm missing something.

I have my filtering rerouted to my codebehind via DataGridSource_Selecting event handler per

http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx

I have a set of controls on my page, Start Date, End Date, User, Status

Start and End Date are expected to always contain a value

User and Status I want to also have an 'All' option, where in it would return all results/not filter.

One method I can think of using for this, is the put the queries in a If scenario, where

if(user == All), use linq query B
if(user != All), user linq query A

where linq query A contains the filtering on Users, and linq query B does not.

What I have so far is

[Code]....

What I need

[Code]....

where User == ??,

can the control that populates that contain a wild card option as well? ie *, so that if user == Name, it filters on Name, or if user == *, it returns all?

View 2 Replies

DataSource Controls :: How To Split String In SQL SERVER

Apr 25, 2010

I have tried to break the below string like

DECLARE
@strFilterCond Varchar(Max)
set @strFilterCond=''
SET @strFilterCond=' ISNULL(Cast(EmpID as Varchar(1500)),''Undefined'') = ''000012946'' AND ISNULL(Cast(EmpName
as Varchar(1500)),''Undefined'') = ''Abosch, Karen'' AND ISNULL(Cast(tblEmployees.JobLookupID as Varchar(1500)),''Undefined'') = ''Undefined'' '

The Result String are like:

ISNULL(Cast(EmpID as Varchar(1500)),''Undefined'')
= ''000012946''
ISNULL(Cast(EmpName as Varchar(1500)),''Undefined'')
= ''Abosch, Karen''
ISNULL(Cast(tblEmployees.JobLookupID as Varchar(1500)),''Undefined'')
= ''Undefined''

I am unable to Break the string. break this string in sp. I do not know how to loop through the string.

View 2 Replies

Forms Data Controls :: Sort Date (in A Datalist) Which Is In String Format?

Feb 18, 2011

I have created a class file which gets me the state codes,license numbers and the expiration dates for the same.

I fetch the expiration dates in string format.

Each customer can have many licenses.

I have changed the format of the date (initially appearing as YYYY/MM/DD 00:00:00 when retrieved from database) to MM/DD/YYYY.

After retrieving all the licenses pertaining to a single customer, I bind them to a datalist.

Now the requirement is that for each customer, I need to sort the licenses according to the latest expiration date and then display the same.

How can this be achieved ?

View 2 Replies

DataSource Controls :: Dropdown List Binding With Left Space Padding

Dec 25, 2010

i want to add leading space in dropdown list after binding from DB.

for that i used leftpad method but not working.

code are as below

[Code]....

View 3 Replies

URL String Get Cut Off When There Is # Sign?

Jan 15, 2010

I create a fake link for SEO friendly purpose, for exampl:

If I have a link like this:

http://localhost:1846/mycompany/codesByBook/C#_beginner_1001.aspx in an <a></a> tag.

and if I use:

[Code]....

the value is: http://localhost:1846/mycompany/codesByBook/C (rest of the string:#_beginner_1001.aspx is cut off),

So the problem is the # sign, can you let me know how to keep the # sign so the Request.Url.ToString() get the full path?

View 2 Replies

DataSource Controls :: Sql Server String Or Binary Data Would Be Truncated?

Feb 11, 2010

I am using Sql server version enterprise edition 9 on win NT.I have an issue with the stored procedure, when I execute the SP I get an error message "String or binary data would be truncated." In general I know that we get this error when the inserted value is greater than the column length, but in this scenario the SP is failing only the for the section 1 insertion. The same SP contains one more section where we are inserting records in to same table from same source table based on some different condition and it works.I wrote a script in which I copied the section from the SP which has the problem and storing the output of it in an temp table and inserting one by one record using cursors in to the destination table and then it works.I tried with the option SET ANSI_WARNINGS OFF and SET ANSI_NULLS ON, but it did not work. I am sure that it is not failing because of the length of the data inserted.Is there are other configuration that i can set??

View 1 Replies

DataSource Controls :: Sort By Col. In Datatable?

Feb 23, 2010

I have seq no col in the datatable.how can i order by the seq no so that re-arrage the datatable.or other method have the sort function.and then bind to repeater.

View 3 Replies

DataSource Controls :: Cannot Sort The Data

May 21, 2010

I have a column of varchar type, records like DRT1000,DRT1001,DRT900,DRT922....... Records not in proper order..I need to sort this record in descending..

View 4 Replies

DataSource Controls :: Trying To Sort A DataTable, And Not Always Succeeding?

Apr 27, 2010

I am trying to sort a DataTable. If I declare a DataView and use the following approach it works perfectly:

Dim dt As DataTable = getData()
Dim dv2 As New DataView(dt)
dv2.Sort = "surname, name"
dt = dv2.ToTable

I wanted to do this without using a DataView though if possible to reduce the impact on resources. I tried the following approach but it doesn't work. I might be writing the code wrong so

Dim dt As DataTable = getData()
dt.DefaultView.Sort = "surname, name"

View 3 Replies

DataSource Controls :: Datatable Sort In A Particular Order?

Oct 22, 2010

How do I sort a data table based on a particular column which has integer values in ascending order?

I wrote this:

leadtable.DefaultView.Sort = "Id"

But it doesnt seem to work, it displays fine but when i get try to get the values of the sorted datatable in an array they dont come in an sorted ordere Datatble is defined as:view plaincopy to clipboardprint?

View 3 Replies

DataSource Controls :: How To Sort The Records When Using Union

Apr 8, 2010

how to sort the records when using union

View 2 Replies

C# Remove Characters On Left Of A String Up To The #?

Jun 15, 2010

Om C# how can i remove all the characters on the left and the #?

Take this: aaaeeae#http://www.sharepointsite.net/Staff/_w/lawn_JPG.jpg'

And make it this: http://www.sharepointsite.net/Staff/_w/lawn_JPG.jpg'

View 2 Replies

SQL Server :: Convert Result To Positive If Negative?

Oct 25, 2010

i have a select statement below. The result of r1- @r1 may be positive or negative.

i want it to always result as positive, so it is a negative number then it to show the same number as positive. can i do this?

e.g.

r1 = 7, @r1 = 4
r1 - @r1 = 3

but

if r1 = 5, @r1 = 6

r1 = @r1 = -1, but i want this to be 1, because i am trying to work out the difference between the two numbers.

can this be done within a select statement? my select statement is:

SELECT imageurl, (r1 - @r1) AS difference

View 1 Replies

Currency Format String Besides "C" / Convert Negative Amounts?

Sep 8, 2010

Is there another currency format string besides "C"? "C" seems to convert negative amounts like you'd see on a bank statement (e.g. $-10.67 shows up as ($10.67)). The guy here at work doesn't like to see .00 at the end of money so in a gridview I wrote for him I was just dropped the last three characters after I converted the values to .ToString("C"), but one negative value in the bunch breaks that logic.

View 7 Replies

DataSource Controls :: DataTable.select() Wrong Sort?

Feb 11, 2010

I have a little problem with a DataTable.

[Code]....

The values are number but varchar, for example '100', '73', '87'. When i see the data this return 100, 87, 73, when should by 73, 87, 100 how can i sort the data????

View 2 Replies

DataSource Controls :: How To Sort A Textbox1.text On Form

May 6, 2010

How can I cause my query Sort a textbox1.text on my form and I want to use this for my reportview1 laterlater each time i write something in my textbox1.text my reportview1 displays

Example I have:

ID Name Nationality
1 david American
2 Adam indian

if i write "1" only my report shows "david" info

View 2 Replies







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