473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

.NET: Naming convention for a column with "AS" in stored procedure

Hi,

I have a stored procedure that looks like the follows:

-------------------------------------------------------------------------------------
SELECT
ClientName AS 'Client Name',
Location,
ReportInstanceID
FROM
#CORE
-------------------------------------------------------------------------------------

I want to add the stored procedure to my C# code manually as a typed
DataTable. Obviously I'll need to add data columns for the three
columns in the SELECT statement.

Question: Shall I use "ClientName" or "Client_Name" for the first
column? What's the naming convention in .NET for the column names with
"AS" in the stored procedure?

Thanks!

-Emily

Jan 8 '07 #1
2 1233
I would avoid column names with spaces in them like I would a
police officer when driving 80mph in a 55mph zone. They will
haunt you, make your life a living hell, require you to use
square brackets around them when you want to use them and
be a pain in the A** that you have to deal with every single
time you want to touch that table. (Not that I'm bitter.)

If you really, really don't want to use ClientName
(which is the recommended standard), use Client_Name. At least
if you do that, and you're using it for column headers somewhere,
you can replace all underscores, and get a workable column header.

Robin S.
-----------------------------------

"Fir5tSight" <fi********@yahoo.comwrote in message
news:11**********************@i15g2000cwa.googlegr oups.com...
Hi,

I have a stored procedure that looks like the follows:

-------------------------------------------------------------------------------------
SELECT
ClientName AS 'Client Name',
Location,
ReportInstanceID
FROM
#CORE
-------------------------------------------------------------------------------------

I want to add the stored procedure to my C# code manually as a typed
DataTable. Obviously I'll need to add data columns for the three
columns in the SELECT statement.

Question: Shall I use "ClientName" or "Client_Name" for the first
column? What's the naming convention in .NET for the column names with
"AS" in the stored procedure?

Thanks!

-Emily

Jan 8 '07 #2
On 8 Jan 2007 08:35:29 -0800, Fir5tSight wrote:
Hi,

I have a stored procedure that looks like the follows:

-------------------------------------------------------------------------------------
SELECT
ClientName AS 'Client Name',
Location,
ReportInstanceID
FROM
#CORE
-------------------------------------------------------------------------------------

I want to add the stored procedure to my C# code manually as a typed
DataTable. Obviously I'll need to add data columns for the three
columns in the SELECT statement.

Question: Shall I use "ClientName" or "Client_Name" for the first
column? What's the naming convention in .NET for the column names with
"AS" in the stored procedure?

Thanks!

-Emily
Hey Emily,

I think it's up to your personal preference to chose which naming
convention to go. Personally i'd do ClientName, because it's easier to type
:)
--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 8 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: L Mehl | last post by:
Hello -- Our user wants a column in the DataGrid formatted as "%", so that he sees "nn.n%" instead of ".nnn". I have seen mention of StdDataFormat, as in Dim fmtPct1 As New StdDataFormat ...
0
by: marlene | last post by:
Hi There Does anyone know how to create a query or do something in a stored procedure to output one column as the other columns name? The output I want is something like this: ...
72
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and...
15
by: Bobby C. Jones | last post by:
Is there an advantage to either of these methods, or is it simply a matter of style? I used to use the "as" method, but later gave it up for the "is" method as the intent of the code seems a...
17
by: Darek | last post by:
Hi, I have a table, something similar to: create table my_table ( id char(32) not null primary key, num integer not null, code varchar(2) not null, name varchar(60) not null,
5
by: Matt S. | last post by:
I have been using C# 2005 Express to make class libraries for use in another software program. Each version of this software has a different .NET API, so maintaining multiple solutions of the same...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
2
by: R2d2Rabeau | last post by:
Hi, How can I pass values from a List as stored procedure parameters? name= "Smith", age = 21 name="Brown", age =46 name="White", age=28 ... // data added to the List
2
by: kimmelsd33 | last post by:
I need to read a tab delimited text file in vb6, and store the first column, first line of data in a variable. I need to do the same with the last line, first column of data. This should store a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.