5 Replies - 630 Views - Last Post: 09 May 2011 - 08:36 AMRate Topic:

URGENT! Loading items from access database

Posted 09 May 2011 - 12:21 AM

Hi everyone , i really need help with this one..i'm very noobish..here it goes,i've got access database connected to my project,i can read,write and delete records in it..what i need now is when i select one item from combobox (which is connected to table "clanovi"(members) and it loads their name and surname which is the first column of that table..now when i select one item from that combobox i need other info of members their adress,email,city etc to display in seperate textboxes..

this is the function that my friend made for me..it connects to the single table in database,in this case to table "clanovi" ..i really need some help with this.. thanks in advance

Replies To: URGENT! Loading items from access database

Re: URGENT! Loading items from access database

Posted 09 May 2011 - 07:12 AM

What do you need help with? Is there an exception or error? If so what, and where? What have you tried? You sound like you have identified all the pieces and actions - work through those step by step and see what you can come up with!

Just a gentle reminder that DIC doesn't hand out code. We want to help you learn to be a fuller and more rounded developer! Try and let us know!

Re: URGENT! Loading items from access database

Posted 09 May 2011 - 07:18 AM

just as you said i read it over and over and found it out..now i have one last problem and then my project is finished..i should hand it to school by friday... i have a checked list box where i select terrain1,terrain2,terrain3 etc..
and when i click on a button all rows from table "reservations" where culumn terrain is matching checked items should be displayed somewhere..where should that be?what is the easiest way? i thought with datagridview but i get error Unable to cast object of type 'System.String' to type 'System.Windows.Forms.DataGridViewCell'. ..what are the other ways for displaying that data and without any data binding please..thanks

Re: URGENT! Loading items from access database

and when i click on a button all rows from table "reservations" where culumn terrain is matching checked items should be displayed somewhere..where should that be?

I have no idea where that should be. That depends on how you want it displayed. In a series of textboxes, a grid, colored icons, or what not.

Quote

what is the easiest way?

That depends on above

Quote

i thought with datagridview but i get error Unable to cast object of type 'System.String' to type 'System.Windows.Forms.DataGridViewCell'. ..what are the other ways for displaying that data and without any data binding please..thanks

Re: URGENT! Loading items from access database

Posted 09 May 2011 - 08:36 AM

You would accomplish it in small steps.

Plunk a grid down.
plunk down a button
Make a new method.
tie the method to the button click event
make a sql select statement for yoru terrain information using a 'where' clause utilizing the drop down information in the check box list.
make a generic dataset
make a sql adapter using the sql statement and a connection string to your database.
fill the dataset from the adapter.
set your grid's datasource to the dataset's first table.