Click here to Skip to main content
12,077,753 members (49,039 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB SQL-Server VB.NET
Public Function GetCustomer(ByVal pDealerCode As String, ByVal pCusCode As String) As Customer
       Try
           Dim str As String
           str = "Select * From Customer"
           Dim Dr As SqlDataReader
           If Not (m_daDataAccess.ExecuteQuery(str, Nothing, Dr)) Then
               Return Nothing
           Else
               If (Dr.HasRows) Then
 
?????????????????????
???????????????
?
 
               End If
 
           End If
       Catch ex As Exception
 
       End Try
 

   End Function

I want to that on this place "???????" i write such as query
ALL COLUMN NAME RETURN As A Variable

what should I do..
Posted 26-Apr-13 1:30am
saimm727

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

If you mean "How do I get the name of all the columns in an SQL table?" then try this:
SELECT column_name FROM information_schema.columns WHERE table_name = 'Customer'

If you don't then what do you mean? (And please, don't SHOUT - it doesn't encourage people to want to respond)
  Permalink  
Comments
RedDK 26-Apr-13 14:27pm
   
SELECT * FROM INFORMATION_SCHEMA.COLUMNS answers my question, tyvm.
OriginalGriff 26-Apr-13 14:29pm
   
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160212.1 | Last Updated 5 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100