Best practises for data handling RRS feed

  • Question

  • Hi


    what are the best practices for data handling in C# (well, in VStudio in totality). I've been using Borland C++ Builder 6 (BCB) for a while now which works like a charm for data e.g. drag and drop data components that are really data friendly.


    to explain in more detail, let's take the following example (refer to the image attachment):



    to quickly create a data-aware form in BCB all one needs to do is:

    1) drag a connection object of choice and configure it,

    2) drag an ADODataSet object and set its Connection and CommandText properties,

    3) drag a DataSource object for data-aware components

    4) drag all of the data-aware components onto the form, set their DataSource and DataField properties,

    5) then additional on my form, you'll see Insert, Update and Delete. these buttons does the following:

         i) Insert = change the datastate of the ADODataSet to an Insert state

        ii) Update = change the datastate of the ADODataSet to an Update state

       iii) Delete = deletes the currently selected record in the datagrid from the database

       iv) OK = posts the changes to the database

        v) Cancel = change the state of the ADODataSet back to a browse state


    now, all of this functionality can be done with one-liners e.g. for the Insert button ADODataSet1->Insert(), the components does the rest for you!


    I've been playing around with the VStudio compiler I won a while ago but it seems that data-handling is not as simple as in BCB. from the tutorials and guides I've gone through, the majority of people tend to add everything (connections, datasets, datatables etc) in the code and bind these data objects to data-aware components on the form also from the code. could anybody (preferably somebody that knows how Borland handles data) nudge me in the right direction with the best practises in C#?




    Sunday, July 1, 2007 7:43 PM

All replies

  • Hello Johan,


    You can accomplish the same thing in VS.  Take a look at these walkthroughs for examples.



    Sunday, July 1, 2007 7:56 PM
  • ok, but what I need to know, are those best practises? because most books and tutorials I've went through, tend to do all of the data-handling in code and not with the wizard and .xsd


    then another question I've got, is there any way that I can implement a searchable datagrid e.g. in a datagrid (non-editable) when a cell is selected in a specific columnset and the user starts typing, the grid's pointer snaps to the datarow matching the entry if the entry is valid and exists in the dataset


    I'm specifically referring to the way BCB handles data which is much simpler than the MS ways I've seen so far. can MS do the same or will I need to create my own components or buy components to do data handling like BCB does?


    EhLib ( is a fine example of the requirements I have but unfortunately those components are BCB only AFAIK.

    Sunday, July 1, 2007 8:14 PM