Link to home
Start Free TrialLog in
Avatar of djsoltan
djsoltan

asked on

Visual Studio Connection String to MS SQL

hi guys,
i am totaly new with visual studio 2005 and i am working on a new project to be able to query data from a MS SQL server.
i've used php and mysql alot and im pretty familiar with it but with this visual basic im a little lost.
someone told me the connection string has to be saved in 'web.config' and someone told me it should be saved under master file.
anyways, could you please tell me how i should do it and provide me with a copy/paste code to use to get this runing?
thank you very much
ASKER CERTIFIED SOLUTION
Avatar of carmodyk
carmodyk
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, and regards to your connetion string being stored, you don't necessary have to have it stored in the webconfig area.   You can just declare it as a public string in your code or a general Private string for your VB forms near the top of your code, right after the Inherits System.Windows.Forms.Form declaration

Inherits System.Windows.Forms.Form
     Private strMyConnectionstring As string = "Data Source=yourDatabase;Initial Catalog=pubs;User Id=sa;Password=asdasd;"


   
Avatar of djsoltan
djsoltan

ASKER

thanks alot,
it sure helped alot :)