Connecting sql server to visual studio

Laura Candelaria 0 Reputation points
2023-03-21T14:14:53.7133333+00:00

Hi I am attempting to connect sql server to my visual studio with windows authentication. When attempting to add the server it askes for my servers name. I keep putting my server name/username and it is not working saying it's incorrect format. I also tried using localhost/username and also server name/instance name(sqlserverexpress) and still not working. I have no idea why or what else to try. Please help!

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,648 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Bjoern Peters 8,781 Reputation points
    2023-03-21T16:34:43.1566667+00:00

    Hi Laura,

    Welcome to Q&A Forum; this is a great place to get support, answers, and tips.

    Thank you for posting your query; I'll be more than glad to help you out.

    I am using VS2019 in a SQL Server database project, creating a new connection to a SQL Server,

    I have the following screen (sorry for the German language setting ;-) )

    I just entered the server name(IP), maybe the instance name (servername\instancename), chose the type of authentication and tested the connection...

    So, generally, with Windows auth. You just need to enter the server and instance names as described here.

    https://learn.microsoft.com/en-us/sql/ssms/tutorials/ssms-tricks?view=sql-server-ver16#find-sql-server-instance-name

    IUser's image

    I hope my answer is helpful to you,

    Your

    Bjoern Peters

    If the reply was helpful, please upvote and/or accept it as an answer, as this helps others in the community with similar questions. Thanks!

    0 comments No comments

  2. Seeya Xi-MSFT 16,436 Reputation points
    2023-03-22T06:12:11.3066667+00:00

    Hi @Laura Candelaria ,

    I am attempting to connect sql server to my visual studio with windows authentication.

    You need select Windows authentication and its username and password are grayed out. You only need to enter the SQL account name and password if you want to use the SQL authentication method.User's image

    Please refer to this video: https://www.youtube.com/watch?v=HeGNMgdQ79M

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  3. Olaf Helper 40,656 Reputation points
    2023-03-22T06:33:58.77+00:00

    When attempting to add the server it askes for my servers name

    It asks for the server name, so enter the server name, not a combination of server and user name.

    0 comments No comments