locked
Data Source Name, User ID and password RRS feed

  • Question

  • User-2071549094 posted

    Hi forum members,

    I searched thru the forum but can't find the answer hence the question.

    I just downloaded MS SQL2016 after experience some glitches - cannot create table due to backend blah blah blah.

    Now, I wanted to follow this tutorial which is ADO.Net http://geekswithblogs.net/dotNETvinz/archive/2009/02/19/binding-gridview-with-data---the-ado.net-way.aspx

    And in my webconfig I need to define my SQL connection datasource so I am stuck cos I am not using entity framwork and I do not know how to find the Data Source name in this case.  Also, if I have to add in the User ID and password I do not know how to discover the facts in my computer cos when I downloaded 2016 everything is ported over automatically.

    So, I hope someone can tell me how to .

    Also, I wanted to mention I went to the Configuration Manager in SQL server 2016 but was denied access so I can't see it from there either.  Even though I am the administrator !

    Sunday, November 27, 2016 9:13 AM

All replies

  • User-707554951 posted

    Hi tangara,

    In your web.config, your connection string should like below:

    <connectionStrings>
      <add 
        name="MyConnectionString" 
        connectionString="Data Source=\sqlexpress;Initial 
        Catalog=MyDatabase;User ID=userName;Password=password"
        providerName="System.Data.SqlClient"
      />
    </connectionStrings>

    Data Source is your server name.

    Initial Catalog is the default database queries should be executed against. For normal uses, this will be the database name.

    For the authentication, we have a few options.

    User ID and Password means using SQL credentials, not Windows, but still very simple - just go into your Security section of your SQL Server and create a new Login. Give it a username and password, and give it rights to your database. All the basic dialogs are very self-explanatory.

    1.open sql server 2016. click connect to server.

    2.change Authentication to SQL credentials. set user name and password.

    You can also use integrated security, which means your .NET application will try to connect to SQL using the credentials of the worker process.Check here for more info on that.

    Best regards

    Cathy

    Monday, November 28, 2016 7:51 AM
  • User-2071549094 posted

    Hello Cathy,

    I am not using SQL Express I think.  I downloaded SQL Server 2016.

    This is the full name :

    Microsoft SQL Server Management Studio

    Thus, can you advise what is the Data Source I should be using ?

    Tks.

    Monday, November 28, 2016 1:24 PM
  • User-707554951 posted

    Hi tangara,

    As I description above, Data Source is your server name,

    You could get sever name through following step below:

    1, Right click you Sql sever 2016,

    2. Click Connect>click Database Engine, you will see an window as picture below ( below is sql sever 2014 ):

    Best regards

    Cathy

    Friday, December 2, 2016 8:45 AM