Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating connection string with ID
Message
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
00842508
Message ID:
00842707
Views:
15
Thank you Mike for your reply,

Yes I tried the following string and it works fine,
strConnString = "Data Source=" & strDataSource & "; Initial Catalog=" & strDatabase & "; User ID=testt; password=testttt"
BR

>Remove "Integrated Security=SSPI" from the connection string. Since you have it in the connection string, you're connecting to SQL Server using Windows Authentication. It sounds like you're looking for SQL Server Auth.
>
>-Mike
>
>>I tried that and added a userid and password not exist in the sql, but it still connects to the database, well it should not.
>>
>>
>>>>Thank you Morgan for your reply,
>>>>
>>>>No not this what I want, my connection strings works fine, but I need to add a User ID authentication to my string, meaning the connection will connect to database server with the user mentioned in the connection string only.
>>>>
>>>>
>>>>>>
>>>>>
>>>>>string ConnectString = "Data Source=" + strDataSource + ";Integrated Security=SSPI" + "; Initial Catalog=" + strDatabase + ";uid=" + strUsername +
>>>";pwd=" + strPassword;
>>>>>
>>>>>SqlConnection oConnection = new SqlConnection(ConnectString);
>>>>>oConnection.Open();
>>>>>
>>>>>
>>>>>
>>>>>Is that what you wanted?
>>>>>
>>>>>Morgan
>>>
>>>
>>>Trying that, w/ the strUsername equals the username and strPassword equals the password.
>>>
>>>Morgan
<><><><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><><><>
Previous
Reply
Map
View

Click here to load this message in the networking platform