none
Dynamic ADO.NET DataSource. RRS feed

  • Question

  • Well I am not sure if this question is in the correct forum.  so let me know if i have to put this question on another thread.


    Well this is what i want to achieve.

    I am using .NET 3.5  and currently I am generating .XSD files (Typed DataSets and TableAdaptor)  to connect to SQL Database.

    I have a small WinForms DataEntry application which allows user to enter customer information data.  what i want to do is
    when user is in office application should connect to SQL database directly by using a normal ConnectionString.
    but if user is out on field then application should be able to connect via WebService.

    What is the best way to achieve this.?

    Regards


    Tuesday, February 9, 2010 6:27 AM

Answers

  • Hi Mike
    Sorry to say that you have not understood my question.

    If i am in my office and connected to my network, I DON'T want to use WebService.
    If i am connected to my network I want to use regular way to connect to my database.

    Its only when i am outside office,  on Field, I want  application to understand and connect to webservice to receive and send data.

    Regards

    ofcourse you can switch the method application tries to connect DB. At first point try to connect DB server(when ur @ office ntwrk), give a timeout period, if you passed that period probably ur not able to make connection to Db in private netwrk. At this point goto webservice call. i just added how to make webservice call from Form application!.

    Thanks Mike --------Please mark as answer if it is useful----------
    Wednesday, February 10, 2010 5:04 PM

All replies

  • Create a WebService and write a method to handle your database calls inside Webservice. In In request , map your DB parameters, take the response of your Webservice and convert it to a DataSet.

     

    you need to add reference to your webservice in Form application. Once you done, you can call webservice methods just like calling a method in a class .

     

    --------------------------------------------------------------------------------

    Thanks Mike --------Please mark as answer if it is useful----------

    Wednesday, February 10, 2010 12:11 PM
  • Hi Mike
    Sorry to say that you have not understood my question.

    If i am in my office and connected to my network, I DON'T want to use WebService.
    If i am connected to my network I want to use regular way to connect to my database.

    Its only when i am outside office,  on Field, I want  application to understand and connect to webservice to receive and send data.

    Regards
    Wednesday, February 10, 2010 3:45 PM
  • Hi Mike
    Sorry to say that you have not understood my question.

    If i am in my office and connected to my network, I DON'T want to use WebService.
    If i am connected to my network I want to use regular way to connect to my database.

    Its only when i am outside office,  on Field, I want  application to understand and connect to webservice to receive and send data.

    Regards

    ofcourse you can switch the method application tries to connect DB. At first point try to connect DB server(when ur @ office ntwrk), give a timeout period, if you passed that period probably ur not able to make connection to Db in private netwrk. At this point goto webservice call. i just added how to make webservice call from Form application!.

    Thanks Mike --------Please mark as answer if it is useful----------
    Wednesday, February 10, 2010 5:04 PM