Click here to Skip to main content
15,907,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello

I am developing an application using a datagridview in C#, I am supposed to retrieve data from the database(Access) and put in in the first column of the datagridview?, and store data in the other columns in the database (the user puts in the other 2 columns)? I dont know how to use the datagridview ? I have written and used a lot of code I have found on internet but nothing works for me


Help, tips, code, please is very appreciated

Bye
Posted

1 solution

To retrieve the data from database,first we have to establish the connection with the database...we can establish the connection to database by using sqlconnection,dataadapter,dataset,sqlcommandbuilder objects...in the sqlconnection we have to specify the server name and the database that we are using...for example if we are using our personal system we can specify server name as localhost...


another way is drag a gridview...in the top we will have an right hand directed arrow symbol..select it...in it choose the data source...in it select new datasource..later select database..later select microsoft sqlserver database..in it select the database by browsing...and thus we can display in grid view
 
Share this answer
 
Comments
peprocki 24-Sep-10 23:43pm    
can you post some code or a link? of course I have searched in google

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