Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: linking SQL database with C# problem

  1. #1
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Question linking SQL database with C# problem

    Hello,

    First off i like to apologize for the many questions but i am excited to get into C# programming and how easy and fun it is to program especially with SQL database, i also like to apologize for the last post, posted in the wrong location, dont know how to remove for everyones convennience so my bad.

    QUESTION: I am getting this message that is halting fun production. I have made sure that I have a primary key in the database of SQL 2005 server, using C# I am trying to import the database or at least use it as a reference to store information on the database by doing data->add new data source -> add sql db -> then browsing to my database I created but gives me the error message, I made sure I have permissions, heck I created the database so I should be able to do whatever. Is there anything I a missing or a step(s) I need to do?

    the message says "this file is in use" "enter a new name or close the file's that's open in another program" i dont have SQL management studio opened or nothing, no database program is running just the C# IDE, whats the deal? the first time it started i didnt have permissions, but got that resolved by manually adding me on SQL management studio database name, but now i get that error message above, what am i doing wrong?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Re: linking SQL database with C# problem

    Hello Everyone,

    Ok i got past that problem, where it says the database is being in use, what i did was i shut down the SQL server service and it is now being able to select the database without getting that error message. HOWEVER there is a new hurdle to jump over, since i got it now i try and click on to use that it shows loading but then it gives this error message: an error has occured while establshing a connection to the server./ when connecting to SQL server 2005, this failure may be causing by the fact that under the default settings SQL server does not allow remote connection." any ideas? i made sure the management configuration in SQL has TCP/IP enabled, Local Enabled and Pipes enabled however is there something i am missing?

  4. #3
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: linking SQL database with C# problem

    I think you need the SQL Server Service to be running in order to use SQL databases. Perhaps try re-enabling and see what happens.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  5. #4
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Re: linking SQL database with C# problem

    Hello Xav, I have tried that however then the message pops up "this file is in use" "enter a new name or close the file's that's open in another program" so i stop the service then i can access it, the interesting thing when i go to SQL 2005 surface area configuration, i go to analysis services then to remote connection, i click on it and it gives me an error message saying "the serverproperty with name='network\listenonlyonlocalconnections' doesnt exist in the collection"? do you think that this might be the problem?

  6. #5
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: linking SQL database with C# problem

    Unfortunately, I'm no SQL expert. I tend to use XML files for most things, but perhaps your SQL installation is corrupt? I don't want to recommend a reinstall if it's unnecessary, but it's a possibility.

    Has this error only recently started occuring? Did you change anything?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  7. #6
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Re: linking SQL database with C# problem

    Hey Xav, well tried to uninstall reinstall but stupid error keeps coming up, i saw there is a way to create an SQL database from C#, i tried that but still same thing, cant create database from C# visual studio, going to try on different PC and let everyone know the outcome, thank you for all or any information.

  8. #7
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: linking SQL database with C# problem

    Can't wait for the result.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  9. #8
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Re: linking SQL database with C# problem

    Sorry bout that and the late response, however i uninstalled it, reinstall nothing, still the same problem, getting frustrated so i found a free version of SQL express, installing it right now, including management studio express, creating a new database and see if i get the same issues, please let me know if anything. Also jordan gave me an infraction, for what exactly?

  10. #9
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: linking SQL database with C# problem

    See what it says in the infraction message.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  11. #10
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Re: linking SQL database with C# problem

    I am going to try another thing, making sure i have all the updates, i found a nice website for basic troublehsooting SQL, this guy wrote an entire page on this error i am getting, that is only connecting to SQL using managemnet studio, but still probably same concept, did all his things such as port changing, firewall turned off, verify name etc but still nothing, i am going to do SP2 on SQL 2005, maybe an update issue. will let everyone know the outcome. wish me luck

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Allegro linking problem
    By vaironl in forum C and C++
    Replies: 1
    Last Post: 09-01-2011, 12:03 AM
  2. Linking problem
    By MDM in forum General Programming
    Replies: 0
    Last Post: 11-06-2010, 04:16 PM
  3. Linking Windows form to SQL2005 Database
    By newguy15 in forum Visual Basic Programming
    Replies: 1
    Last Post: 04-12-2010, 12:16 AM
  4. Linking MySQL Database Info to Pages
    By rsnider19 in forum Website Design
    Replies: 6
    Last Post: 10-10-2009, 08:23 PM
  5. Linking a Form to a SQL Database
    By newguy15 in forum Database & Database Programming
    Replies: 2
    Last Post: 12-04-2007, 12:13 AM

Tags for this Thread

Bookmarks

Posting Permissions

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