Code Flexibility

Dear All;

please i am looking a way to minimize the code in visual basic 2008 specially dealing with a database programing. let me little explain. is there any way to write a common function to get the data back and utilize insted of every form writing a code. for exemple

i have multiple combo box and datagrid and some normal text field like any form. i need to pass the query and if for combo then combo box name and it will fill automatically as per query. same way if i need to fill grid i will do the same. if i need a single value i will send a scaller query and get a single value in define variable.

i think you got my idea its just like a library to support any kind of application designed in vb.net or asp the requiredt language.

 

 

 

Submitted byadminon Wed, 03/25/2009 - 12:02

You came at the right time. I have already finish the Hotel Reservation System using vb.net and I am using this kind of technique. For the meantime I have one for combobox and listview control.

Like for example if you want to fill the combobox with data from the table all you have to do is call this function:

FillCombobox(cboCountry, "SELECT * FROM Countries", "Countries", "Country", "CountryID")

For the datagrid I just use the datagridview control and fill it's data with dataset.

I have also prepared an article on the benefit of using a code snippet in your project. I will transfer it here later on.

Add new comment