开发者

Getting info to display properly in datagridview from database in c#

开发者 https://www.devze.com 2023-03-13 21:40 出处:网络
I have a weird problem on my hand. I am trying to read an oracle database and using some queries to get info back. I have a datagridview with column names already set at the beginning of the program.

I have a weird problem on my hand. I am trying to read an oracle database and using some queries to get info back. I have a datagridview with column names already set at the beginning of the program. Here is an example setup of my datagridview columns

Number   Word   Sentence   Paragraph

Now i am reading a database and selecting its columns named N S P representing Number Sentence and Paragraph respectively. How can i load the results of the query into a datatable and display 开发者_运维问答the contents under my datagridview so the N contents in the database are displayed under the Number column and nothing under word column etc. I can always query by selecting N, S and P one at a time, but i want to load all the data at once.

THanks


You can change the column names in the SQL by writing

SELECT N AS Number, S AS Sentence, ...
0

精彩评论

暂无评论...
验证码 换一张
取 消