Showing posts with label password. Show all posts
Showing posts with label password. Show all posts

Thursday, March 22, 2012

ConnectionString without Password

Hello!

I am working at a ASP.NET Project with has a sign-in area. All users (the aspnet_Membership and so on) are on an external SQL Server stored.

The ConnectionString in the web.config looks like this:

<add name="hspWerbung" connectionString="Persist Security Info=False;User ID=XXXXX;Password=XXXXX;Initial Catalog=HSPWERBUNG01;Data Source=SERVER_SQL_02\STOCKHOLM"
providerName="System.Data.SqlClient" /
Is there any way to create a ConnectionString without the User ID and without the password?

When i want to reach my site on the web (not with http://localhost/...) , i can't do it with "Integrated Security=True", because there will be no user, or?

hi, some where we have to store the user name and pwd. the alternative apoach is to encript them and store in the xml file using hash algorthim. when ever you are trying to connect to the DB get the string and decript it and store in the cache or session.

sqlsql

Connectionstring W/O password

I have an asp.net 1.1 application that has to access a SQL Server DB on
another server. In the past we have simply put UID and PWD in the
connectionstring and everything works well.
We now have a client that insists we not include pwd in the connection
string. Although this is easy to do when the DB is on the same server,
using NT Authority, I don't know how to do it when the db is on another
server.
Someone told me to "set up identical service accounts" but I don't know what
that means. I know it's easy to encrypt a connection string in 2.0 but this
is a 1.1 app.
Can someone tell me how this is best done?
Thanks,
TTina
Are both servers in the same domain?
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||I already answered this question below. If you open different topics then we
can not reach to the happy end.
If you are in a domain then you'll not need to create identical accounts on
both servers, it would be enough to create a Login in your SQL Server
Instance for the account you want to log in to your SQL Server and use this
domain account for your ASP app in its conn str.
If those servers are not in the same domain but in the same network then try
my suggestion which is under your previous topic.
Ekrem nsoy
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||no. they are in different workgroups. Why do you ask? I could probably put
them in a domain system and in the same domain.
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
> Tina
> Are both servers in the same domain?
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>|||If they are , this login should exist in Active Directory and to be seen
from both machine
You can create a login let me say ASP_USER (on both machine) to access
both machines.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
> no. they are in different workgroups. Why do you ask? I could probably
> put them in a domain system and in the same domain.
> T
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>|||They don't use active directory
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uoYZ8b1NIHA.3852@.TK2MSFTNGP06.phx.gbl...
> If they are , this login should exist in Active Directory and to be
> seen from both machine
> You can create a login let me say ASP_USER (on both machine) to access
> both machines.
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
>

Connectionstring W/O password

I have an asp.net 1.1 application that has to access a SQL Server DB on
another server. In the past we have simply put UID and PWD in the
connectionstring and everything works well.
We now have a client that insists we not include pwd in the connection
string. Although this is easy to do when the DB is on the same server,
using NT Authority, I don't know how to do it when the db is on another
server.
Someone told me to "set up identical service accounts" but I don't know what
that means. I know it's easy to encrypt a connection string in 2.0 but this
is a 1.1 app.
Can someone tell me how this is best done?
Thanks,
TTina
Are both servers in the same domain?
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||I already answered this question below. If you open different topics then we
can not reach to the happy end.
If you are in a domain then you'll not need to create identical accounts on
both servers, it would be enough to create a Login in your SQL Server
Instance for the account you want to log in to your SQL Server and use this
domain account for your ASP app in its conn str.
If those servers are not in the same domain but in the same network then try
my suggestion which is under your previous topic.
--
Ekrem Önsoy
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||no. they are in different workgroups. Why do you ask? I could probably put
them in a domain system and in the same domain.
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
> Tina
> Are both servers in the same domain?
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>>I have an asp.net 1.1 application that has to access a SQL Server DB on
>>another server. In the past we have simply put UID and PWD in the
>>connectionstring and everything works well.
>> We now have a client that insists we not include pwd in the connection
>> string. Although this is easy to do when the DB is on the same server,
>> using NT Authority, I don't know how to do it when the db is on another
>> server.
>> Someone told me to "set up identical service accounts" but I don't know
>> what that means. I know it's easy to encrypt a connection string in 2.0
>> but this is a 1.1 app.
>> Can someone tell me how this is best done?
>> Thanks,
>> T
>|||If they are , this login should exist in Active Directory and to be seen
from both machine
You can create a login let me say ASP_USER (on both machine) to access
both machines.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
> no. they are in different workgroups. Why do you ask? I could probably
> put them in a domain system and in the same domain.
> T
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>> Tina
>> Are both servers in the same domain?
>> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
>> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>>I have an asp.net 1.1 application that has to access a SQL Server DB on
>>another server. In the past we have simply put UID and PWD in the
>>connectionstring and everything works well.
>> We now have a client that insists we not include pwd in the connection
>> string. Although this is easy to do when the DB is on the same server,
>> using NT Authority, I don't know how to do it when the db is on another
>> server.
>> Someone told me to "set up identical service accounts" but I don't know
>> what that means. I know it's easy to encrypt a connection string in 2.0
>> but this is a 1.1 app.
>> Can someone tell me how this is best done?
>> Thanks,
>> T
>>
>|||They don't use active directory
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uoYZ8b1NIHA.3852@.TK2MSFTNGP06.phx.gbl...
> If they are , this login should exist in Active Directory and to be
> seen from both machine
> You can create a login let me say ASP_USER (on both machine) to access
> both machines.
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
>> no. they are in different workgroups. Why do you ask? I could probably
>> put them in a domain system and in the same domain.
>> T
>> "Uri Dimant" <urid@.iscar.co.il> wrote in message
>> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>> Tina
>> Are both servers in the same domain?
>> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
>> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>>I have an asp.net 1.1 application that has to access a SQL Server DB on
>>another server. In the past we have simply put UID and PWD in the
>>connectionstring and everything works well.
>> We now have a client that insists we not include pwd in the connection
>> string. Although this is easy to do when the DB is on the same server,
>> using NT Authority, I don't know how to do it when the db is on another
>> server.
>> Someone told me to "set up identical service accounts" but I don't know
>> what that means. I know it's easy to encrypt a connection string in
>> 2.0 but this is a 1.1 app.
>> Can someone tell me how this is best done?
>> Thanks,
>> T
>>
>>
>

Connectionstring W/O password

I have an asp.net 1.1 application that has to access a SQL Server DB on
another server. In the past we have simply put UID and PWD in the
connectionstring and everything works well.
We now have a client that insists we not include pwd in the connection
string. Although this is easy to do when the DB is on the same server,
using NT Authority, I don't know how to do it when the db is on another
server.
Someone told me to "set up identical service accounts" but I don't know what
that means. I know it's easy to encrypt a connection string in 2.0 but this
is a 1.1 app.
Can someone tell me how this is best done?
Thanks,
T
Tina
Are both servers in the same domain?
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>
|||I already answered this question below. If you open different topics then we
can not reach to the happy end.
If you are in a domain then you'll not need to create identical accounts on
both servers, it would be enough to create a Login in your SQL Server
Instance for the account you want to log in to your SQL Server and use this
domain account for your ASP app in its conn str.
If those servers are not in the same domain but in the same network then try
my suggestion which is under your previous topic.
Ekrem nsoy
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>
|||no. they are in different workgroups. Why do you ask? I could probably put
them in a domain system and in the same domain.
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
> Tina
> Are both servers in the same domain?
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>
|||If they are , this login should exist in Active Directory and to be seen
from both machine
You can create a login let me say ASP_USER (on both machine) to access
both machines.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
> no. they are in different workgroups. Why do you ask? I could probably
> put them in a domain system and in the same domain.
> T
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>
|||They don't use active directory
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uoYZ8b1NIHA.3852@.TK2MSFTNGP06.phx.gbl...
> If they are , this login should exist in Active Directory and to be
> seen from both machine
> You can create a login let me say ASP_USER (on both machine) to access
> both machines.
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
>

Thursday, March 8, 2012

connection to sql server

hi,
in my server explorer i add a connection;
server name is cerebrum,username is ga, no password and database in the server is dal.
i tested the connection and it is successful. i am now able to browse the table in my server explorer. from my server explorer the i dragged the just data connection:cerebrum.dal.dbo in my design form and it created SqlConnection1 which contain my connection. properties of my SqlConnection1:



Name: SqlConnection1
ConnectionString: workstation id=SOLARIS;packet size=4096;user id=ga;data source=cerebrum;persist security info=False;initial catalog=dal
ConnectionTime: 15
Database: dal
DataSource: cerebrum
Modifiers: Protected
PacketSize: 4096
WorkstationId: Solaris

in my page load i added this code:


SqlConnection1.Open();
if (SqlConnection1.State == ConnectionState.Open)
{
Label1.Text = "SQL Connection is open";
}
else
{
Label1.Text = "SQL Connection is closed";
}

it gave me the error:



Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Line 51: SqlConnection1.Open();
Line 52: if (SqlConnection1.State == ConnectionState.Open)

i don't know what's wrong with it. i really need your help.

This error means that the web server cannot open a connection to cerebrum SQL Server. It could mean that you cannot connect over TCP-IP to the computer cerebrum from your web server. So go to web server and try to ping cerebrum, see if this is successfull.

Try modifying the datasource to give the driver more clues about where your database server is. For example, replace cerebrum with the IP address of cerebrum, try variations like below:

datasource=123.123.123.123
datasource=123.123.123.123,1433
datasource=tcp:cerebrum,1433
With .NET you need to use tcp-ip, verify that your SQL Server is using tcp-ip protocol by looking that the SQL Server errorlog.

Wednesday, March 7, 2012

connection to database ?

can i have multiple user and password in a connection string ??

for example :

<add name="strCon" connectionString="Data Source=test;Initial Catalog=test;User=test, guest;Password=test, guest" providerName="System.Data.SqlClient" />-

or is there any other way ??

the reason is that i have created a view that hits 2 database that requires user info and pass ...........any advice is appreciated

Just put two connection strings in your web.config and in the area that says add name="" give them separate names. In your datalayer you will have to allow for this. When it is calling from one database call the appropriate connection string. When it is the other use the second connection string.

I hope that this helps.|||thanks for the info...........

Connection to an alias instead of a named server?

Is this doable?
The server name is TOPAZ
The alias name is topaz-alias
The username is somesqldb
The password is password
The following connection statement works:
Connection conn_topaz_byserver =
DriverManager.getConnection
("jdbc:microsoft:sqlserver://topaz;databasename=somesqldb"
,"somesqldb", "password");
The following connection statement fails:
Connection conn_topaz_byalias =
DriverManager.getConnection
("jdbc:microsoft:sqlserver://topaz-alias;databasename=somesqldb"
,"somesqldb", "password");
Galen Boyer
Hi Galen. The driver is trying to open a raw socket
to a machine named whatever you put in the URL
after the '//' and before the ';'. If you can
set up your DNI to find topaz from the alias,
then it will work.
Here's a program that opens a socket like the
typical type-4 driver will do, given the inputs
the URL and properties will supply. If you can
configure your OS dni info to get this program to
succeed opening the socket using the alias you want,
then the driver will too.
Joe Weinstein at BEA
import java.io.*;
import java.net.*;
public class isAnythingListeningOn
{
public static void main(String argv[])
throws Exception
{
if (argv.length != 2)
{
System.out.println("Usage: isAnythingListeningOn <host> <port>");
System.out.println("eg:\n% java isAnythingListeningOn myMachine 1433");
System.exit(0);
}
try
{
System.out.println("\nTrying to open a socket with host "
+ argv[0] + " and port " + argv[1] + " ...");
Socket socket = new Socket(argv[0],(new Integer(argv[1]).intValue()));
System.out.println("\nYes, there is, we got a socket.");
socket.close();
}
catch (Exception e)
{
System.out.println("We failed to open a socket. Here's why:\n");
e.printStackTrace();
System.out.println("\n(Either there is no machine named '" + argv[0]
+ "' or\nnothing is listening there on port "
+ argv[1] +")\n");
}
}
}
galenboyerdev@.hotpop.com wrote:

> Is this doable?
> The server name is TOPAZ
> The alias name is topaz-alias
> The username is somesqldb
> The password is password
> The following connection statement works:
> Connection conn_topaz_byserver =
> DriverManager.getConnection
> ("jdbc:microsoft:sqlserver://topaz;databasename=somesqldb"
> ,"somesqldb", "password");
>
> The following connection statement fails:
> Connection conn_topaz_byalias =
> DriverManager.getConnection
> ("jdbc:microsoft:sqlserver://topaz-alias;databasename=somesqldb"
> ,"somesqldb", "password");
>
|||Joe Weinstein <joeNOSPAM@.bea.com> writes:

> Hi Galen. The driver is trying to open a raw socket
> to a machine named whatever you put in the URL
> after the '//' and before the ';'. If you can
> set up your DNI to find topaz from the alias,
> then it will work.
[...]

> Socket socket = new Socket(argv[0],(new Integer(argv[1]).intValue()));
The following worked:
java.net.Socket socket = new java.net.Socket("topaz",1433);
The following failed:
java.net.Socket socket = new java.net.Socket("topaz-alias",1433);
So, the alias seems to be a "microsoft toolset only" feature.
Thanks.
Galen Boyer

Saturday, February 25, 2012

Connection string with sa password

My application designed with VB6.0 is connected to MS SQL Server 7.0.
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.com...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?

Connection string with sa password

My application designed with VB6.0 is connected to MS SQL Server 7.0.
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?
First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.c om...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?

Friday, February 24, 2012

Connection string problems

I've got a problem with a connection string that is dynamically generated at runtime. The password for the connection string is encrypted and then put in the connection string. Some of the passwords encrypt to weird chararcters, but, they have always worked in regular ADO (I'm porting this behavior from a VB6 program) and the password works when I copy it over and login via Query Analyzer. The error I get is:

"Format of the initialization string does not conform to specification starting at index 113"

I'm thinking that ADO.NET encodes it incorrectly. I've run across this: http://support.microsoft.com/?kbid=823679 kb article but I'm not sure if this is my problem. Has anyone else been able to figure out what is wrong with it?It could be. If so, re-download the 1.1 sdk. It could be that your encryption is dumping a bad value.

System.Diagnostics.Debug.WriteLine(ConnectionObject.ConnectionString);
Find out how it's being passed in.|||The connection string is a valid connection string... the problem is that the sqlconnection object is choking on a valid connection string based on some weird characters. I need to know if it's possible to get around this.|||those weird characters.. are they entered as such in sql server? and what version framework are you using?

Connection String Help

Could someone please tell me where do I find out my "user" and "password" for my Sql Connection String. Also could someone tell me I'm using the right server name. I know the name of my server on my network. But I see different names in the SQL Server Enterprise Manager.You should be able to get your username and password from the DBA if it's a database server where you work. If it's hosted they usually give it to you in a setup confirmation email, if you didn't get one you can call their support line and they should be able to help you out.

Good luck.|||Where do I find the DBA?|||:) Oh dear that made me laugh (sorry). DBA is a person that owns the database. They're an elusive lot usually found in darken rooms muttering about DATs and watching re-runs of Star Trek ;) When we all know that Star Wars is far superior.|||That's good, lol.

Sunday, February 19, 2012

Connection String for selling Web Applications?

If I'm wanting to sell my Web Applications to clients that run using SQL Server, is it best to use a UserID and Password in the connection string, or would using Windows Integrated Security (SSPI) do? The reason I'm wondering is because I wouldn't know my customer's UserID and Password when they purchased one of my web apps, I would have to recompile the app with the new connection string (I'm not storing it in the web.config file)..

What is the best way to handle this on a global level, so that it would work on any system?

for example, would having the following connection string be a good idea for a production site?

string strMyConnectionString = " Data Source = (local); Integrated Security = SSPI; Initital Catalog = MyDBSource; ";It would really be better to allow it to be specified in the Web.Config. What happens if the database is not located on the same machine?|||Why are you not storing it in the web.config file ?|||I didn't store it in the web.config file for security reasons. Would the web.config be the best way to go? Should I encrypt the string?|||Yes and Yes

Sunday, February 12, 2012

Connection Properties on Expressions?

Hi,

I can seem to find all the necessary properties of a connection in the expression section... except for the password...

How the hell do i specify the password for a connection based on a variable?

Regards,

Have you tried building a connection string and including the password that way.

Alternatively use windows authentication, but I'm sure you've thought of that.

|||

Yes i have already tought about both of them.. but in the connection String that is built using the interface and choosing SQL Auth the password is never there.. well i will try that way but it was a little bit easier and safer if the connection could receive a Password parameter and possibly encrypt it for use... don't know!

I'll try and see about that!

Regards,