Problem with a C# front end for an access database  
Author Message
Timski72





PostPosted: Visual C# Express Edition, Problem with a C# front end for an access database Top

Using Visual C# Express.

Hi there. I have an access database which I am developing a C# front end to. I have started out by creating a dataset from the database and then binding the fields to editboxes on the form. So far so good. However I have certain intsances where I need the user to select a value from a combobox and then save back a calculated value to a different field in the database. E.g the combobox value selected is "1.01 General kowledge" and I want to store "1.01".

The only way I have found to do this is to add two controls to the form, one is my combobox and the second is a databound editbox. When the user makes his selection from the dropdown, I calculate the value I want saved back to the database and then set the .text property on the databound control. To make it even hackier this solution only seems to work if the databound control has its .visible property set to true. If it's invisible it does not work.

Can anyone offer any advice on the best way to go about doing this

Alternativley, does anyone know a way to have a databound control of a certain type, say decimal, but have the combo box display the decimal value and its text description

Thanks



Visual Studio Express Editions5  
 
 
Markku Behm





PostPosted: Visual C# Express Edition, Problem with a C# front end for an access database Top

Hi

You could look this article. Mayby there is something help : http://www.codeproject.com/csharp/scomlistcontrolbinding.asp

Yours Markku


 
 
Timski72





PostPosted: Visual C# Express Edition, Problem with a C# front end for an access database Top

Thanks, that was very helpful :-)