Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I mean, i want to combine 2 records into 1 column in datagridview vbnet?
Posted
Updated 11-Jun-13 6:25am
v3
Comments
Surendra Adhikari SA 11-Jun-13 7:51am    
This question is not clear ? did you want to display data in one column from another column?
what is your actual problem ?
No one can solve your question in this form although there are thousands of user online in codeproject every moment.
dedet masri yuni 11-Jun-13 10:59am    
I mean, how to display 2 different table data field, 1 in the same cell in datagridview vbnet?,
what this question is understandable, tanks
CHill60 11-Jun-13 11:15am    
It's simply not clear what you mean. Do you want to concatenate the column data?
dedet masri yuni 11-Jun-13 11:38am    
yes i want to combine 2 records into 1 column
CHill60 11-Jun-13 11:42am    
You need to use the Reply links next to a post otherwise the poster does not get notified that you are trying to respond. Use the Improve question link to post the code that you are using to populate the datagridview as the method of combining the columns will depend on how you populate the control (line by line or by databinding)

1 solution

A DGV can only display data from a single table, so, you have to build a single table out of your two tables. You would normally do this with a SQL SELECT query with a JOIN clause.

Also, the DGV cannot combine two fields into one, so, in the same SQL SELECT query, you have to concatenate these two fields together.

I HIGHLY suggest learning the SQL SELECT syntax to accomplish this.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900