1

Be easy on me I am a recent college grad working on my first industry project. I built the app using 2012 and had to build on 2010. i have a combobox set to get the values from a database I access through VPN. The server has many different databases on it and every time I set the connection in 2010 it never gives me the option to access the any of the databases. Steps taken: Restarted program. Searched this site religiously. Tried multiple different connections.

I know there are other ways to get data into a combobox but I was using the configuration wizard vs 2010 offers to set up my connection. This is where the two versions of vs differ for some reason. 2012 let me view all the databases on the server. 2010 did not it automatically put me on master which gives me no way to access another db.

Here is vs 2010 This is all the connection shows me

  • 2
    Please post your code - nobody here (that I know of) have crystal balls or can read minds :) – Tim Oct 23 '13 at 15:46
  • 4
    Please show your database connection. Where do you read it from? – Vincent Oct 23 '13 at 15:46
  • 1
    Are you getting an error? Should we assume that "2010" and "2012" refer to versions of Visual Studio? – Dave Swersky Oct 23 '13 at 15:47
  • Please explain more. What do you mean by set the connection? Tried multiple different connections. We need to know what you are actually doing. – Hogan Oct 23 '13 at 15:48
  • Yes visual Studio and that's just it with 2012 i clicked the combobox to bind data items then selected new project data source. There was no code written – CharmingInferno Oct 23 '13 at 15:49
  • Give me just a sec to get what I can of the data conenction – CharmingInferno Oct 23 '13 at 15:49
  • 1
    One thing of note is that you should not be blocking on this because the latter half of the application depends on the combobox. Until you get a solution you should be able to put static values in to have a working combobox. You should only be blocking on parts where the database is critical. So for example in your data layer where you are currently trying to access the database just return your own datasets and then hook it up to the database when you get that working. – Chris Oct 23 '13 at 15:50
  • Try running the application in the debugger. is it failing when an attempt to open the database fails. At least in the debugger the real exception can be captured. – Mike Beeler Oct 23 '13 at 15:51
  • @Chris I have tested it with a static value to make sure it works now is getting the value form the database – CharmingInferno Oct 23 '13 at 15:51
  • @Vincent I can't post pictures till I have a rank 10 – CharmingInferno Oct 23 '13 at 15:55
  • @CharmingInferno: My point was that if the latter half of your app is dependent on the combobox and not on the database then static values will allow you to develop the second half of the app. It may be that I misunderstood and the rest of the app is DB dependant too but I was just wanting to address your last line suggesting you were unable to continue development. – Chris Oct 23 '13 at 15:58
  • @Chris yes it is vague i will edit and yes the rest is done it's the values in the db that is all that is left. – CharmingInferno Oct 23 '13 at 16:00
  • Now you can post pics... – Dave Swersky Oct 23 '13 at 16:01
  • @Tim that's just it was using the wizard with vs 2010 – CharmingInferno Oct 23 '13 at 16:02
  • Here is a good Q&A on populating a combobox in a Windows form. I would recommend against relying on wizards until you know how to do it by hand: http://stackoverflow.com/questions/7423911/how-to-populate-c-sharp-windows-forms-combobox – Dave Swersky Oct 23 '13 at 16:07
  • @DaveSwersky alright I will go do that now and thank you! – CharmingInferno Oct 23 '13 at 16:11
  • @DaveSwersky after looking at it the connection i have in 2012 says dbconnectionetc(setting) while 2010 says conenction.etc.master.dbo why the difference? – CharmingInferno Oct 23 '13 at 16:12
  • Try the code and update your question with specifics if you have a problem. – Dave Swersky Oct 23 '13 at 16:13
  • The page is bugging me not to continue in comments, so here is one more question to refer to: http://stackoverflow.com/questions/14113931/c-sharp-populate-a-combobox-from-table-in-database – Dave Swersky Oct 23 '13 at 16:16

0 Answers0