none
Windows form application on Oracle RRS feed

  • Question

  • Hi all,

     

    I am quite new to .net. I have been working with Oracle database since I graduated from University. I am currently planning my company’s first .net project which needs to use Oracle as backend database and windows form as front-end. C# is my preferred language and I have done a course plus some self-study so I understand the language concept. Before we start writing a project plan I have a few questions, I would appreciate greatly if you can shed some lights for me.

     

    The application we are trying to delivery is not complex at all, however even small project I want to do it in a right way.

     

    1. I am hoping to have 3-tier architecture but I am also conscious about the time scale, we have relative tight deadline to meet. As an Oracle DBA, I am able to produce packages, store procedures, functions pretty quickly in Oracle. So I think I can write data access layer manually. But I am not sure if I can still take the advantages of dataset Class.

     

    2. If I choose to use DataSet, does it mean I can’t write any PL/SQL code in Oracle. Just had a quick look at the DataSet designer which doesn’t seem to accept any store procedures or functions import from Oracle. Should I try to avoid using DataSet designer to gain more controls?

     

    3. The project requires a lot bulk insert/update. We need to provide some tabular data form interfaces which allow users to update multiple rows of records (probably in disconnected mode, our users used to do this in excel) and submit only once. How can we manage the concurrency? I believe DataSet using optimistic locking mechanism can manage this for us. Does that mean I will be losing the control of my code?

     

    4. Is there a best practise/examples I can follow to develop n-tier application on Oracle. I have been searching through Oracle web site, most of examples are about how to connect/select/update/insert via ADO.net, nothing really from a designer's point of view on separating data access layer, business layer and presentation layer.

     

    Thanks very much for your time and help.

     

    Kind regards,

    Can

     

     

    Friday, October 24, 2008 3:41 PM

Answers

  • The DataSet is only an in-memory cache of data.

     

    It can be a useful place to store the results of queries from your backend database or for staging changes you want to store in your backend database in the client or middle-tier.

     

    Since the DataSet also supports data binding it's usefull when presenting the data in the client windows form.

     

    This Channel 9 video on Building N-Tier Applications may be helpful (regardless of what your backend database is).

    http://channel9.msdn.com/posts/funkyonex/Building-N-Tier-Applications-in-Visual-Studio-2008/

     

    Friday, October 24, 2008 5:24 PM
    Moderator

All replies

  • You could use Oracle Data Provider . this accepts bulk insertion and seems to have better performace, also supports many other features.

     

    http://www.oracle.com/technology/tech/windows/odpnet/index.html

    The site contains many examples, articles and tutorials, to get started using this dll.

     

    You'll have to install the client 11g but the server could be 9.

     

    I recommend you to use Custom Business Objects (Clases) instead of DataSets.

    Friday, October 24, 2008 4:08 PM
  • The DataSet is only an in-memory cache of data.

     

    It can be a useful place to store the results of queries from your backend database or for staging changes you want to store in your backend database in the client or middle-tier.

     

    Since the DataSet also supports data binding it's usefull when presenting the data in the client windows form.

     

    This Channel 9 video on Building N-Tier Applications may be helpful (regardless of what your backend database is).

    http://channel9.msdn.com/posts/funkyonex/Building-N-Tier-Applications-in-Visual-Studio-2008/

     

    Friday, October 24, 2008 5:24 PM
    Moderator
  • Hi Mark,

    Thanks very much for taking time answer my question, the video is very impressive, I guess we probably will go down that route. But the DateSet designer doesn’t seem to like Oracle store procedures or packages, it only accepts tables or views as data source.

    1.If we want end users to CRUD the data through store procedures, can we still use the dataset?

    2.How can we populate ref cursor to a dataset?

    3.What is the difference of designer generated DataSet and manually populated DataSet in terms of usability or binding ability?

    Thanks very much for your time and help.

    Can

    Saturday, October 25, 2008 1:13 PM
  • 1.  Yes, you still can use the DataSet.  You can have the adapter's CUD commands do anything you want and mapping values from DataRow->the command and results of the command back to the DataRow.

     

    2.  I have a vague idea of what the ref cursor is, but *Adapter.Fill / DataSet.Load really just try to get the IDataReader and don't care where the data came from.

     

    3. There should no difference in usability or binding between a designer generated dataSet and a manually populated DataSet.  There is "usability" difference a between typed dataset and an untyped dataset in terms of having helper functions and strong typing in code for all the tables/rows/columns.  However, the designer can generate that typed dataset code regardless of how the structure was generated.

     

    Sunday, October 26, 2008 2:20 AM
    Moderator