DataSource Controls :: How To Mack Space Between Columns In Sql Query

Mar 14, 2010

I creat a Family Website and i use Dataset to get Family members from sql databace.

In my databace i have MemberID, Name, MiddleName and Last Name.

I want also return the Member FullName and i use this Query to return the members from database table:

SELECT MemberID, ParentID, Name, MiddleName, LastName, Name + MiddleName + LastName AS FullName

when we have Name="Jon" MiddleName="" Lastname="Smith" it return JohnSmith

my only problem is how can i get space between the Name MiddleName And Last name like "Jon Smith"

View 2 Replies


Similar Messages:

DataSource Controls :: Add Space Between Columns

Mar 3, 2010

I am SELECTING two columns:

SELECT ([FirstName] + [LastName]) AS [FullName], UserID WHERE CustomerID = @CustomerID

I would just like to know if there is a way to add a space between the two columns in the select statement.

This SqlDataSource Binds to a DropDownList so TextValue = "FullName" and DataValue = "UserId"

but of course, the way it is now the fullname is all one word.

View 3 Replies

DataSource Controls :: Replace All Null Value With Space For All Columns In A Table?

Jan 8, 2010

I am trying to replace all null value with space for all columns in a table.

(note: just we have to pass parameter table name "XYZ" result will come aotumaticly, we dont need to bother about column name)

i have done it through C# application. but love to do it through Sqlserver only like using storeprocedure, function.

my C# code is like that

[code]....

View 6 Replies

DataSource Controls :: Unable To Put Space To Dynamic Sql Query?

Jan 20, 2010

i have a query like this and its running correctly

SELECT CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ' ', '') AS BIGINT)
FROM P INNER JOIN PCommunication ON P.ID = PCommunication.ID
WHERE P.Telephone IS NOT NULL AND CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ' ', '') AS BIGINT) > 5000000000
AND PCommunication.TypesID = '7667d187-5fe1-4aaf-9e31-79761561da58'

i am trying to use it with dynamic query like this but its not working

@query = 'SELECT CAST(REPLACE(LTRIM(RTRIM(SUBSTRING(P.Telephone, 2, LEN(P.Telephone)))), ''' ''', '''''') AS BIGINT)

View 9 Replies

DataSource Controls :: Advanced SQL Query - Drive Running Out Of Space

Jan 25, 2010

I have a query which is returning records like below which returns a list of tasks with a corresponding task type. there is a task table (wh_task) and a task type table (wh_task_type). What i want to achieve is a count of all the tickets per ticket type. So at the end of the query i will have a total for Administration / Maintenance tasks (1) and a total for Routine Maintenance Tasks (3). ** and all the other types *

There are many different types of task type so I dont want to have to hard code it. Can count all the occurencies of the different ticket types.

Task Name
Task Type
Date Completed
SBS Server C drive running out of space
Administration / Maintenance
16/07/2007 16:03:34
Patching Server(s).
Routine Maintenance
08/01/2009 06:51:56
Patching Server(s).
Routine Maintenance
11/02/2009 10:06:06
Patching Server(s).
Routine Maintenance
04/05/2009 06:53:24

I can also get wh_task_type_id.

Here is my SQL:

[Code]....

View 8 Replies

DataSource Controls :: Change Columns Name After SQL Query ( For Xml Raw)?

Apr 15, 2010

this is my sample script

[Code]....
after execute this script which returns a column name "XML_F52E2B61-18A1...." can I change this column name?like this

select EMPNO AS EmployeeName -- we can use AS to change column name
from EMPLOYEE

View 1 Replies

DataSource Controls :: Sum Data From Two Columns In Different Tables - SQL Query

Feb 9, 2010

I am trying to create an application in which there is a summary of outstanding payments.

One table is Table_Bills.

The other table stores records of Payments made and is called Table_Payments.

In summary i want to show 3 figures - each in separate one field datagridview with a data_source in separate data_adapter:

1) Ammount_Due 2) Amount_Paid 3) Balance.

The first two are no problem but the last is giving me a headache.

I tried this:

SELECT SUM(DHB_New_Jobtable.DayWage) - SUM(DHB_Payments.Ammount) AS Expr1

View 4 Replies

Forms Data Controls :: How To Eliminate Space Between Columns In Gridview

Aug 18, 2010

I set the CellPadding and CellSpacing properties to 0 and BorderStyle to 'None' on my gridview.

I set up a hover event on the row so that the entire row is highlighted on mouse over. When this happens, I can still see a gap between the two columns.Am I missing a property setting here?

View 2 Replies

Forms Data Controls :: Listview Increase Space Between Columns

Jan 9, 2011

I know this might be a trivial question but I can't find how to do it...

I want to increase the space between the columns, there barely is any space, the columns are just very near each other...

View 2 Replies

DataSource Controls :: Removing Duplicates From Two Similar Columns Or Any Other Columns In A Database Schema

Apr 21, 2010

I have two columns first name and last name , that have duplicates, how can i remove the duplicates and only leave the distinct members intact?

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

DataSource Controls :: Insufficient Result Space To Convert Uniqueidentifier Value To Char?

Aug 22, 2010

I've been trying to insert new values while I create a new user with a createuserwizard, but I've been getting this error over and over again:

"insufficient result space to convert uniqueidentifier value to char"

The code that does it is the following:

[Code]....

But when I debug, the error is thrown before reaching the previous code, so I suppose the error is in the SqlDataSource, look:

<asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%&#36; ConnectionStrings:DefaultConnection %>"
InsertCommand="INSERT INTO [User_Personal] ([UserId], [Gender], [ToGender], [StateName], [CityName],

[code]...

View 1 Replies

DataSource Controls :: SqlDataSource And Parameters Query / Trying To Accomplish Is Building Dynamic Query

Aug 22, 2010

1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like

SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.

Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).

2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query

(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).

If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.

View 11 Replies

DataSource Controls :: Update Query Not Working When Using Query Builder To Configure Table Adapter

Jan 15, 2010

[code]...

This query works perfectly on the query analyser.

But when configuring the Table adapter ,I try executing the query and i get 0 rows affected.

What could I be getting wrong in this case.

NB:Existing GalleryID has been supplied.

View 1 Replies

DataSource Controls :: Can't Find Query's / By Right Clicking On Database Created A Query In Server Explorer?

May 17, 2010

By right clicking on my database i created a query in server explorer. But where are this query stored can't find them back. I should aspect that their is a folder query's like there is a folder tables but this isn't the case.

View 10 Replies

DataSource Controls :: How To Convert Sql Query Into Linq Query

Mar 10, 2010

select Groupid,GroupName,onorusername from palgroup where groupid in (select distinct Groupid

View 5 Replies

DataSource Controls :: Accessing FK From A Query Via Entity Query

Jan 21, 2010

I've got a query such as

Dim MediaQuery =
From m
In dB.DOWNLOADS _Where m.ID = id _Select

which returns a record from the database. One of the fields in the record is a FK to another table. I need to read this value to be able to set a dropdown based on the ID but I can't work out how to access it. For a standard record I can just do the following txtTitle.Text = MediaQuery.FirstOrDefault().TITLE

However with the foreign key it doesn't work like that. I've tried drpGroup.SelectedIndex = MediaQuery.FirstOrDefault().DOWNLOAD_GROUPS.ID where DOWNLOAD_GROUPS is the FK field but it returns Object reference not set to an instance of an object. If you're simply wanting to read some values from a single db record in the entitiy framework and one is a foreign key how should I go about getting the value?

View 2 Replies

Show Several Columns In Datasource As Autogenerate Columns In Gridview?

Jan 27, 2011

I have a datasource, which includes many columns, idealy, I need use a gridview to show:

1) first 3 columns: template fields, these fields depends on values in some columns of datasource. I use template fields, hard coded. works fine.

2) the other columns. This is I do not know how to do it. In the data source, there are about 10-20 columns data, each time, the # of columns of the data varies. idealy, I need show each of them as a seperated column in gridview. The entire data source may have 30 columns, but some of them are used in 1), and I only want show these 10-20 columns in gridview. Some columns in data source, I may not use them at all. is there a way to do this? or have to seperate them as a detail view style UI?

View 1 Replies

DataSource Controls :: Ignore Empty Field Because Always Join The Field And Separate By Space

Mar 3, 2010

I wanna join all the field as a new col.

but how can i ignore the empty field because i always join the field and separate by space like the following.

select (field_1+' '+field_2+' '+field_3) as new_col from TABLEA

but if the field is empty, then there is the double space

how can i ensure all the space is one space only.

View 2 Replies

SQL Server :: Truncate, Find The Last Space, Remove Any Characters After That Space, Then Add Some Full Stopseg?

Feb 10, 2011

i'm writing a stored proc and if a field i return is longer then 200 characters, i want to truncate, find the last space, remove any characters after that space, then add some full stopseg:

INSERT INTO @rec(articleid, abstract)
SELECT a.id,
CASE

[code]...

View 4 Replies

How To Replace A Character In A String To Space Or White-space

May 5, 2010

How to replace a character in a String to space or white-space?

View 3 Replies

DataSource Controls :: Add Columns To Table

Jan 21, 2010

I'm trying to add these 4 co,umns to the table as bit type woth a defaut of FALSE. What am I doing wrong here? I get a syntax error near (

create PROCEDURE [dbo].[AddADIFields]
AS
ALTER TABLE dbo.tblTESTS ADD (AI1 Bit 0,AI2 Bit 0,AI3 Bit 0,AI4 Bit 0)

View 2 Replies

DataSource Controls :: How To Create A Constraint For 3 Columns

Jun 4, 2010

I want to create a constraint for 3 columns (A B and C) where if columns B or C are not null, then A cannot be null. And vice versa (i.e., if A is not null, then either B cannot be null, or C cannot be null).I am not very well versed in SQL and would like to know what is the best way to achieve this (e.,g Check constraint, stored procedure, function, trigger)? I'm leaning towards trigger but I'm not 100% sure if that's right nor of how to implement it.

View 3 Replies

DataSource Controls :: No Of Tables And Columns In Database?

Jun 15, 2010

I want to know that how many tables we can have in database and what is the maximum no. of columns.I also want to know the maximum size for each datatype.

View 3 Replies

DataSource Controls :: Columns To Join Tables?

Apr 27, 2010

I need to join some tables to get the matching records. I often have to ask around to see how certain tables could be joined. Is there any way to query the information schema or some thing else to see what columns/values match in certain tables in order to figure out how tables should be joined.

View 4 Replies







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