Results 1 to 34 of 34

Thread: [RESOLVED] Using WCF Service to connect between Windows Forms application and SQL Database

Threaded View

  1. #1

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Resolved [RESOLVED] Using WCF Service to connect between Windows Forms application and SQL Database

    gep13 before I saw your last post in my other thread I already thought it was time to start a new thread; besides the other one was getting too bulky. I went ahead and marked that other thread resolved so no one wastes any time looking at it. So now I know I need to use a WCF Service (or some kind of service) to connect between my Windows Forms application and my SQL database.

    So I need to learn about WCF Services. I was looking at this MSDN article

    How to: Define a Windows Communication Foundation Service Contract

    I've never worked with a Console Application before. I'm using Visual Basic not C#. Here's steps 5 to 7 in the article. Step 7 I'm not sure about.

    Attachment 82707

    Step 7. Add an Imports statement for the System.ServiceModel namespace.

    Are they talking about adding it to Module1? So that Module1 becomes like the example at the bottom of the article? If they are talking about adding that to Module1 then that's easy for me to do but if not I don't see how to add that Imports statement for the System.ServiceModel namespace. To make Module1 like the example below would be simple enough.

    This is at the bottom of the MSDN article :

    Example
    The following code example shows a basic interface that defines a service contract.



    Code:
    Imports System
    ' Step 5: Add the Imports statement for the System.ServiceModel namespace
    Imports System.ServiceModel
    
    Namespace Microsoft.ServiceModel.Samples
        ' Step 6: Define a service contract.
        <ServiceContract(Namespace:="http://Microsoft.ServiceModel.Samples")> _
        Public Interface ICalculator
            <OperationContract()> _
        Function Add(ByVal n1 As Double, ByVal n2 As Double) As Double
            <OperationContract()> _
            Function Subtract(ByVal n1 As Double, ByVal n2 As Double) As Double
            <OperationContract()> _
            Function Multiply(ByVal n1 As Double, ByVal n2 As Double) As Double
            <OperationContract()> _
            Function Divide(ByVal n1 As Double, ByVal n2 As Double) As Double
        End Interface
    End Namespace
    Last edited by EntityX; Jul 21st, 2011 at 09:59 PM.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width