Click here to Skip to main content
16,004,927 members
Home / Discussions / Database
   

Database

 
QuestionXquery Pin
Neema Vikas13-Jun-07 1:21
Neema Vikas13-Jun-07 1:21 
QuestionInfragistics hierarchical grid Pin
Revathij13-Jun-07 1:20
Revathij13-Jun-07 1:20 
AnswerRe: Infragistics hierarchical grid Pin
Pete O'Hanlon13-Jun-07 2:17
mvePete O'Hanlon13-Jun-07 2:17 
GeneralRe: Infragistics hierarchical grid Pin
Colin Angus Mackay13-Jun-07 3:11
Colin Angus Mackay13-Jun-07 3:11 
GeneralRe: Infragistics hierarchical grid Pin
Pete O'Hanlon13-Jun-07 3:13
mvePete O'Hanlon13-Jun-07 3:13 
QuestionWeek Calculation Pin
Tauseef A13-Jun-07 0:48
Tauseef A13-Jun-07 0:48 
AnswerRe: Week Calculation Pin
Revathij13-Jun-07 1:52
Revathij13-Jun-07 1:52 
QuestionReturning Column Names Only Pin
Brendan Vogt12-Jun-07 23:34
Brendan Vogt12-Jun-07 23:34 
Hi,

I need to return column names only. My code works, but I am changing the initial column name to something more meaningful, like the ID field I changed to SKU like:

ID AS 'SKU'

Here is my code how I returned back only the column names:

' Create SQL statement
Dim strSQL = "SELECT ID AS 'SKU', ProductName AS 'Product Name' FROM bvc_Product;"
' Create instance of connection and command object
Dim conn As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim command As New SqlCommand(strSQL, conn)
Dim dr As SqlDataReader
Dim i As Integer

' Mark the command as a stored procedure
command.CommandType = CommandType.Text

' Execute the command
conn.Open()
dr = command.ExecuteReader(CommandBehavior.SchemaOnly)

For i = 0 To dr.FieldCount - 1
Response.Write("Column: " & dr.GetName(i).ToString() & "<br />")
Next

My problem is is that I need the result to return the original field name, and the new field name, in this case I need it to return ID and SKU, and ProductName and ProductName.

How do I do this?

Can someone please advise?

Regards
ma se
AnswerRe: Returning Column Names Only Pin
Harini N K13-Jun-07 1:58
Harini N K13-Jun-07 1:58 
AnswerRe: Returning Column Names Only Pin
Pete O'Hanlon13-Jun-07 2:16
mvePete O'Hanlon13-Jun-07 2:16 
QuestionData Recovery - After Drop a table and creating the same table Pin
adnanrafiq12-Jun-07 22:57
adnanrafiq12-Jun-07 22:57 
AnswerRe: Data Recovery - After Drop a table and creating the same table Pin
Krish - KP13-Jun-07 0:49
Krish - KP13-Jun-07 0:49 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
adnanrafiq13-Jun-07 2:20
adnanrafiq13-Jun-07 2:20 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
Pete O'Hanlon13-Jun-07 3:40
mvePete O'Hanlon13-Jun-07 3:40 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
adnanrafiq13-Jun-07 9:19
adnanrafiq13-Jun-07 9:19 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
Krish - KP13-Jun-07 17:39
Krish - KP13-Jun-07 17:39 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
Krish - KP13-Jun-07 17:31
Krish - KP13-Jun-07 17:31 
GeneralRe: Data Recovery - After Drop a table and creating the same table Pin
adnanrafiq13-Jun-07 22:04
adnanrafiq13-Jun-07 22:04 
QuestionProcedure for Column and Table variable Pin
Elena200612-Jun-07 21:54
Elena200612-Jun-07 21:54 
JokeRe: Procedure for Column and Table variable Pin
Harini N K12-Jun-07 22:25
Harini N K12-Jun-07 22:25 
GeneralRe: Procedure for Column and Table variable Pin
Elena200612-Jun-07 22:36
Elena200612-Jun-07 22:36 
GeneralRe: Procedure for Column and Table variable Pin
Harini N K12-Jun-07 22:43
Harini N K12-Jun-07 22:43 
QuestionPlease Solve this SQL Query Pin
Care Career12-Jun-07 18:01
Care Career12-Jun-07 18:01 
AnswerRe: Please Solve this SQL Query Pin
Krish - KP12-Jun-07 18:19
Krish - KP12-Jun-07 18:19 
QuestionSQL query returning zero row in MySQL 5 Pin
Guffa12-Jun-07 8:57
Guffa12-Jun-07 8:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.