Accessing MS SQL database with two Windows accounts simultaneously

Hello,
I have ASP.NET web application started under PC\UserName account, and Windows Service Application that runs under Local System Account (NT\System). Both applications should access MS SQL database simultaneously. They are using same connection string:
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\mydb.mdf;Initial Catalog=mydb;User=MyUser;Password=MyPassword;" providerName="System.Data.SqlClient"
/>
The problem occurrs every time when second app tries to fetch data from database. So, app which connects first can fetch data normally, but the other one gets "Login for
MyUser failed" exception every time.
Everything works as expected when i start windows service app under PC\UserName credentials. But the problem is that i have to do that login every time manually, and when User changes password I have to change it in service settings also.
Does anyone know how to solve this problem?
Thanks,
Mladen 

add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\mydb.mdf;Initial Catalog=mydb;User=MyUser;Password=MyPassword;" providerName="System.Data.SqlClient"
Hello Mladen,
You are using a User Instance
of SQL Server and when the first app start this user instance with the MDF in exclusive Access; no other can use this MDF = Single User mode.
Better attach the database file as a regular database, then you can use several connections to access the database.
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • How to access a shared disk with two users account on same Mac

    I am seeking how to share / access at same time with two accounts on a same Mac a disk that is shared with a TC or an AEBS. When a user account is connected to the shared drive and when I switch to the 2nd user this 2nd user cannot access / see the content of the shared drive and it receives an error message. I want to use this shared drive to store some GB of movies I do not want to have on my MacBook Pro SSD but still bring able to access them from the two accounts that are set on my Mac. Just like for an internal drive. I have tried all I could but it does not want to work. How do I do that ? Thanks.

    If you were running this software, the Mac's Bonjour would automatically "discover" The Linux machine.
    http://en.wikipedia.org/wiki/Avahi_(software)

  • Problems syncing photos with two user accounts on one Macbook pro in iPhoto

    Hi, I hope someone can help. I've have a Macbook Pro with two user accounts, my wife and myself. My wife and I both have our own iPhones. We log onto our own accounts and sync perfectly with itunes - so far so good.
    The only issue is we have a shared iphoto 'database'. When each of us go into iPhoto we're looking at the same photo library (i.e we can both see the same photos, events, etc), although we make sure we don't both go in at the same time as I've heard this can cause issues.
    In iTunes if I sync photos from iPhoto to my iPhone it works fine. If I then log out and my wife logs in and tries the same she gets a permissions error. We've worked round this by deleting the photo cache folder, however if this is done on my wifes account, for example and then she logs out, when I log in I get the same permissions error until I delete the photo cache myself - and round and round we go.
    Is there a way that we can setup iPhoto and/or iTunes so we can both sync with iPhoto to our own iPhomes? If its means me 'owning' the iPhoto database and my wife having some sort of read access/view only access, that would be fine.
    We're using the latest version of iTunes (9.2.1) and the iPhone OS (4.0.2) and Snow Leopard (10.6.4)

    Yes I moved the iphoto library to a mounted volume, as suggested in the apple support pages, and it works fine now.
    I also made sure the volume was mounted at log on automatically. The only downside is that I have to make sure may wife doesn't log on and use iphoto whilst I am logged on.

  • Home Share on One Computer with Two User Accounts

    We have one computer in our house with two user accounts. I have an iTunes account and my husband has his own. Due to many moved music files and whatnot, it is very annoying and difficult to try to find songs from his library to add to mine using the Add File (or Folder) to Library link in the iTunes file menu. I am unable to access some of the songs currently in my library because he moved some of his files and my iTunes can't locate them any longer. I was hoping Home Share would solve our problem, but can't get it to work. Is it hopeless for me because we technically only have one computer? Is there an easier way for me to add some of his songs to my library without searching through our five or six different iTunes library folders on multiple hard drives?
    We have both enabled Home Share on our individual user accounts, but do not have the Home Share icon appearing in our iTunes side bar.
    Thanks for the help!

    I was able to get the two iTunes home shares to work on the same machine and "see" each others library as long as I have them both open at the same time (for the Mac, using fast user switching made that very easy). Once the home sharing was working, playing music/movies/etc worked but when I tried to import / drag and drop from one account to the other it acts like it's doing it but then doesn't.
    This may be perhaps unique to me because of my unusual setup, I set my "secondary" account to use the iTunes folder of the other, "primary", account to avoid having two copies of the same thing. Doing it this way meant I didn't have two copies of files on my computer, but it did mean I had to "Import to Library..." the media into the "secondary" account every I added something to the primary. I wonder if giving each account it's own library location would resolve this issue (while unfortunately meaning that the two accounts would each have a copy of all of the music/movies/etc, doubling my drive space usage). I'll update this post if I find out anything more.

  • Cant access My SQL Database on Azure VM from outside source

    I have Word Press running on an Azure Virtual Machine. It uses My SQL. I would like to read the My SQL databasre from an ASP.Net application.  I have opened the 3306 internal TCP port.  I am attempting to read the My SQL database from Navicat on
    my client before I try ASP.Net and I get a Cant connect message. i can access the same database successfully from a local server copy of Navicat.  The credentials are the same on both. The only difference is the external port number.
    Is the problem with Navicat? Can you recommend another way to test the connection? I have used Shields Up to verify that the external port is open.

    Hi,
    The Azure SQL Database
    service is only available with TCP port 1433. To access Azure SQL Database from your computer, ensure that your firewall allows outgoing TCP communication on TCP port 1433.
    More information:
    http://msdn.microsoft.com/en-us/library/azure/ee621781.aspx
    Regards,
    Mekh.

  • How do we sync contacts and calendars (ONLY) between two iCloud accounts, two iPhones and one iMac with two user accounts?

    This is complex.  Until today we had one iMac with two user accounts - one for me and the other for my wife.  We sync'd our calendars and contacts between our two user accounts using my iCloud account, thereby keeping our schedules coordinated and our contacts information always the same between us.  Also, as I had an iPhone, I sync'd my phone with my iCloud account, thereby keeping the contacts and calendars in the two user accounts on the iMac AND my iPhone sync'd.  (I also sync'd other things, like Notes and Mail and Safari settings, between my iPhone and my user account on the iMac, but my wife did not want to be burdened with all my emails showing up in her email account and I wasn't interested in hers, etc., so we didn't sync anything between us other than calendars and contacts.)
    We've finally bought my wife an iPhone and set up an iCloud account for her.  And of course she now wants to sync several items from HER account on our iMac to HER iPhone, but I don't want them, just as she doesn't want all of my other stuff.  But we still want our mutual calendars and contacts to sync to HER new iPhone, just like they already do to mine.  But I can't figure out how to CHANGE her iMac user account from using MY iCloud account on the iMac to using HER new iCloud account, and then having HER iCloud account speak to MY iCloud account but share JUST our calendars and contacts.
    Originally I tried a workaround by simply having her iPhone log into my iCloud account.  That works great for the calendars and the contacts.  But...she can't sync anything else from her iMac account to her new iPhone because she's presently "forced" to use my iCloud account.  And neither of us want to sync our other things to each other's iMac accounts or iPhones.  Also as we're both using my iCloud account, in things like the Find My iPhone app, the Cloud is seeking two phones labeled with my name and none with her's.  So we definitely don't want this as the set-up and communications network between our devices.
    We want to set up our users on the iMac to sync to our SEPARATE AND DIFFERENT iCloud accounts and then have those iCloud accounts sync calendars and contacts (ONLY) between themselves, and then push that data to our separate iPhones (or the other way, from either of our iPhones to the individual accounts on our iMac and the other person's iPhone).  Does this description make sense to you?  I've diagramed it nicely using Keynote, but even thiough I can draw it, I can't figure out how to set up and configure all the devices to make it work.  If you would like me to send the Keynote slides (just two of them - the current and desired configurations - please send your email address to me at [email protected] and I'll be happy to forward it to you.
    If anyone can help me set this up I'd be most appreciative!  Thanks so much.  Merry Christmas and Happy New Year to all readers in this community!

    BobT.
    I had the same problem, and decided to look into it last night.
    First of all, the solution I would like to have is for Apple to allow for selection of iCloud accounts per application, i.e. Contacts to one, Photo Stream to another. I believe this would be the most straight forward solution for the problem we are facing. 
    Since this is not an option I came up with a workaround. I was most interested in solving this for Contacts, so this is what I tested for. Now I have all 3 devices with the same contacts.
    1) Turn off iCloud for Contacts on all devices. On the device that has the Contacts list that you would like to propagate to all others select to keep the contacts, and on the others select not to keep them.
       Note that the current backups still exist on iCloud, so in case something goes wrong you can still turn the iCloud for Contacts back on to get your current Contacts back.
    2) In iTunes, sync All Contacts with the phones, starting with the one with the Contacts content you chose to keep.
    From this point on, the 3 devices should sync contacts with each other.
    This, of course, will stop your iCloud backups of Contacts, but I don't think this is really needed. You are already storing copies of your Conacts on 3 devices, which for good parts of the day are likely not all co-located. You also potentially have Time Machine backups turned on, which would mean there is a 4th copy there as well. For the case of Contacts iCloud only complicates matter ... that is until Apple implements the solution I first wrote about.

  • Can 2 teachers share an ipod touch and put apps on it with two itune accounts

    Can 2 teachers share an ipod touch and put apps on it with two itune accounts?

    Sure.  No problem.
    Be aware that ALL purchases are permanently associated with whatever Apple ID was used to originally obtain them.  Apps can not be updated without knowledge of that ID and, more importantly, its password.  Apple IDs can not be merged and purchases can not be transferred from one ID to another.
    Minor nuisance if you choose to update apps from inside the computer's iTunes.  If you're logged into the "wrong" account, it's necessary to log out/in to do the update.  It's easier if you update from the iPod itself.  No need to log out/in but you do need to know the password for the ID.

  • How can I use an iPad with two itunes accounts?

    How can I use an iPad with two itunes accounts?
    Hi there
    My partner has a works iPad, which has her works Apps on (ones that are specifically made by her company and are NOT available in the App store).
    What I want to be able to do is to ALSO have my itunes account on there so that I can put all the apps I have purchased previously from my iPhone on it.
    This is so I can put on VLC player (thats already in my itunes account) so I can add videos to the iPad.
    How do I do this please?
    I tried it before by connecting it to my mac, but it wiped everything off the iPad completely and also deleted the data settings for using 3G.
    So I want to avoid this happening again the future as it had to be sent back to her head office to be sorted again.
    Any advise please?
    Thanks

    You can't. The iPad is desgined to be a 'one user' device and only really works with one apple ID at a time.
    The only way would be if she, at work and with her work apple id, downloaded your apps (repurchasing them of course).
    It's not meant to be a multiple user/multiple ID device.

  • Sharing one library with two user accounts.

    I want to share one iTunes library with two user accounts on the same iMac.
    I've followed the tutorial where you move the iTunes Music folder to a shared location HD/Shared/iTunes and then pointed both iTunes to that location via the advanced menu, but only the admin account has the music. The other user account iTunes shows nothing.
    Also, I've now moved the music folder back to my area on the HD (not shared any more) and now the iTunes music folder shows all the album folders where before I guess they were hidden. Why and how do I get it back to how it was...?
    All we're trying to do is share one mac. My wife and I have our own log in user accounts, but want to have the same music and iPhotos accessible on our own set-ups.
    Thanks for any help.

    Out of interest I got this to work.
    I made a folder called 'All Music' and put all the album folders in it.
    Moved this folder to User/Shared/ and then clicked on the file, and Get Info.
    In Get Info added my wife to Sharing & Permissions as Read & Write.
    In iTunes / Advanced found the folder on my user account, and then did the same on my wife's account and hit add to library.
    I hope this was the right way to do it..... It seems to have worked.

  • Reminders App does not work on Yosemite with two iCloud accounts.

    The Reminders App does not work on Yosemite (10.10.1) with two iCloud accounts. It seems like when there are two iCloud accounts connected in Yosemite (10.10.1) the plist file for Reminders disappears.
    I have tried restarting Reminders; restarting the mac; starting the mac in recovery mode to repair the disk and disk permissions; and starting the mac in recovery mode and reinstalling OSX.

    Yes sharing Reminders list works. The problem is, I have one shared iCloud account with a colleague (shared calendar, Reminders and email). It makes it easier to run our business with a single shared iCloud account...I know it's not the typical usage.

  • How to connect sql database with Flash

    Dear Friends,
    Iam working on a quessinarie (assesment) for elearning software. i want to connect sql database with flash and save my records in back end like add, delete, modification of student result and details.
    Kindly help me to connect the sql database. or dot net server. I know how to connect PHP and mysql. But my client dont want php. only sql database and do the add, del, modificaiton.
    Thanks in advance,
    Syed Abdul Rahim

    unfortunately no, i do not know ASP well enough to give any code advice, other than the basic concept:  make a request on a server-side script (such as ASP) via URLLoader - the script receives variable values (if required), runs the DB queries you wish to invoke, and 'returns' the results - pick them up in the URLVariables class via the event handler in Flash and assign them to local properties if needed, etc.
    there are quite a few threads that you could find more specific information on the ASP side, here and elsewhere around the net.

  • Can you access non-Oracle database with HTML DB?

    Can you access non-Oracle database with HTML DB? If not, will this be possible in the future?
    I realize HTML DB is not an open-source product. However, it is necessary sometimes to get non-Oracle database info. JDeveloper supports this. It does not appear to me that HTML DB does. This is a major drawback to it being a product for more potential applications that rely on other database technology such as MySQL, etc.
    If it is possible, is this brain surgery to do it. HTML DB offers fast simplified development and it would be good if it was built in. Does anyone know of an example of accessing non-Oracle database that is available?

    12282,
    In general, HTML DB gives you access to Oracle database facilities. These include heterogeneous services. Please search this forum for keyword "heterogeneous" and you can follow the threads that interest you.
    As for the comparison with brain surgery, I'd rank them about the same in terms of raw thrill.
    Scott

  • Cannot create SQL database with free trial subscription

    Hello,
    I get the error message 'The operation is not supported for your subscription offer type.' when trying to create a sql database with my free trial subscription.
    Regards
    Julian

    Hi Julian,
    It should be allowed, please provide steps that you used and ran into this issue. alternatively try these details
    step by step instructions to get started.
    Hope this helps
    Please mark as answered if it helped
    Vishal Narayan Saxena http://twitter.com/vishalishere http://www.ogleogle.com/vishal/

  • How to access the sql database in applet?

    How to access the sql database in applet?
    Please help me.

    import java.applet.*;
    import java.awl.*;
    import java.sql.*;
    //other packages
    public class jdb extends Applet
    Connection con;
    Statement stmt;
    String name="drvijay";
    String phoneno="9842088860";
    public void init(){}
    pubilc void stop(){}
    public void destroy(){}
    public void start()
    call();
    public void call()
    try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              conn=DriverManager.getConnection("Jdbc:Odbc:emp","sa","");
              stmt=conn.createStatement();
              stmt.executeUpdate("insert into empdetails(name,phoneno) values ('"+name + "',''"+ phoneno +"' )" );
              }catch(SQLException e)
                   System.out.println("error"+e);
                   System.exit(0);
    //<applet code="jdb" height="200" width="200"> </applet>
    u this jdbc statement in any of the method..
    */

  • Accessing a SQL database

    I'm trying to access an SQL database and export the contents as a tab delimitated file. Is there a free program that would allow me to do this?

    Hi,
    the free edition of DBVisualizer http://www.dbvis.com/products/dbvis/features/index.jsp?feature=1 should be sufficient for that.
    Regards
    Stefan

Maybe you are looking for

  • Syntax eror in INSERT INTO satement

    I get this when i try to insert information in the database: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. thanks for the help in advanced

  • WA_getDocumentDOM is not defined

    I just bought and downloaded and tested the Spry one time last night. Today I get this...whenever I try inserting  the Tabbed Panels.. At line 132 of file "C\Programs....etc...etc....\Spry\DesignTime\EditingUtils.js":WA_getDocumentDOM is not defined.

  • Form Size becoming Too large

    Hello, I have a very strange problem. I designed a fillable form using Designer7.0. I reader enabled the form using Adobe Reader Extensions Server 7.0, so that users use their Adobe reader(7.0.5) to fill in the form. The empty PDF form is around 700K

  • My Ipod is disabled and says connect to itunes

    My sons ipod touch is disabled and says to connect to itunes.  Tried to go to devices, but says it is not located in computer.

  • Why wifi is called half duplex

    In a tutorial video i have found that wiifi is called half duplex. why it is so called? Posted by WebUser Poristhan Prince from Cisco Support Community App