none
Login as Database User RRS feed

  • Question

  • I am using Linq2Sql in my Domain Service(WCF RIA Services) and am able to create a connection to SQL Server with an initial catalog and am able to fetch, etc.

    The database has a user (not the SQL login) who is mapped to a SQL login. How do I use this database user for my CRUD operations from my Domain Service after I establish the connection to the server?

    This post does cross a little into SQL Server domain but I thought it would be more appropriate to ask here since I am using Linq2Sql to access database.

    Thanks.

    Friday, October 8, 2010 11:36 PM

Answers

  • Hi

    I hope you are aware of the basic processes like making DataContract. And Querying the Database at RunTime.

     

    Just some tips to keep in mind.

    VM needs to have permission to access the Database if it is a secured database.

    Keeps the trace active so that we can see the error being genrated latter on.

     

    Soecify the connection string in app.config of the application which is hosting.

     

     

    Other then these points all and every thing will be same for accessing the database or making a simple query


    Thanks Priyank Piyush
    • Marked as answer by liurong luo Friday, October 15, 2010 7:41 AM
    Tuesday, October 12, 2010 8:41 AM

All replies

  • I am not that familiar with RIA but  I suppose there is a connection string stored somewhere on the server side, perhaps in app.config.

    Miha Markic [MVP C#] http://blog.rthand.com
    Tuesday, October 12, 2010 6:46 AM
  • Hi

    I hope you are aware of the basic processes like making DataContract. And Querying the Database at RunTime.

     

    Just some tips to keep in mind.

    VM needs to have permission to access the Database if it is a secured database.

    Keeps the trace active so that we can see the error being genrated latter on.

     

    Soecify the connection string in app.config of the application which is hosting.

     

     

    Other then these points all and every thing will be same for accessing the database or making a simple query


    Thanks Priyank Piyush
    • Marked as answer by liurong luo Friday, October 15, 2010 7:41 AM
    Tuesday, October 12, 2010 8:41 AM
  • Adding your machine on which service is hosted is the database user. In case of webSevices. So please Give this machine rights
    Thanks Priyank Piyush
    Tuesday, October 12, 2010 8:44 AM