databinding

Hi
        datagridview.AutoGenerateColumns = False
        datagridview.AutoSize = True
        datagridview.DataSource = _ds.Tables(0)

 How do i bind   a
 
datagridview.column(0) to ds.tables(0).column(1)

meaning

datagridview.column(0).datasource = ds.tables(0).column(1)

thanks
LVL 18
vbturboAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

p_davisCommented:
datagridview.Columns[0].DataPropertyName = something // where something is a property or column in the datasource
0
vbturboAuthor Commented:
davis

Ive already tried this but it throws a exception

dggridNyeRyk.Columns[0].DataPropertyName = _NyeRykkereData.Tables[0].Columns[0].ToString()

{"the Index was out of bounds .
Parameternavn: index"}

but i got 30 columns in the table
0
p_davisCommented:
dggridNyeRyk.Columns[0].DataPropertyName = _NyeRykkereData.Tables[0].Columns[0].ColumnName
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

vbturboAuthor Commented:
still throws

{"the Index was out of bounds .
Parameternavn: index"}

ive filled and inspected the dataset table before the propertyname is assigned.
so i know for sure that there are data present.


0
p_davisCommented:
did you add a column to the datagridview?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vbturboAuthor Commented:
woops ....thanks
0
p_davisCommented:
np -- have fun

P
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.