473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

code to select columns stsrting with same letter

please tell the code to select all the columns starting with same letter in asp.net using vb actually my query is working in sql server but i want to know the syntax which works in .net using vb
Jun 26 '07 #1
1 887
shweta123
692 Expert 512MB
Hi,

You can try this code,

con.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;password=;Initial Catalog=Pubs;Data Source=."
con.Open()

da = New OleDbDataAdapter("Select * from Authors", con)

da.Fill(ds)
Dim col(10) As DataColumn
Dim i As Integer = 0
For Each c As DataColumn In ds.Tables(0).Columns
If UCase(c.ColumnName).StartsWith("A") Then

col(i) = c

i = i + 1
End If
Next
con.Close()


Is it the same thing you are looking for?
Jun 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Taper Litwater | last post by:
after selecting from two table like so- select table1.column, table2.column from table1, table2 ... What is the correct syntax to access the individual table data? With one table I would...
9
by: Martin | last post by:
Hi there, I've been looking far and wide on this one. I'm looking for a way to select from columns where the columns have a certain pattern! Example: Instead of doing: SELECT q1, q2,...
1
by: alexqa2003 | last post by:
got a table with (class, name, exam, score) fields. To find max(score) for exam that starts with letter 'm' grouped by class and name,did: select max(score) from #temp where exam like 'm%'...
7
by: CharlesEF | last post by:
Hi All, I have run into another problem that is eating my lunch. Should be simple but I am having one heck of a time. Please look at this SELECT statement: SELECT FROM States WHERE ] =...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
0
by: Ryan Liu | last post by:
In a listview, I found it is pretty nice I can type a letter or more letter quickly to select the NEXT item which begin with that letter(s). But seems the first row, even not high lighted, always...
6
by: lawrence k | last post by:
The following function is way too slow. If anyone has any suggestions about how to speed it up, I'd be grateful for them. We have to call this function 36 times on one page, and I think each time...
4
by: sade | last post by:
I want to select a column if data starts with a specific letter OR else to select from another column instead. Something like replacing columns. For example: 1st row to read columns ID, NAME if...
10
by: sara | last post by:
Hi - I have a report that is 14 columnar sub-reports (Line up: Position- holders in each of our 14 locations - Manager, Assistant Manager, Receiving, Office, etc). I output directly to PDF...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.