Re: Pooled Connection Strings
- From: Chris <coz1978@xxxxxxxxx>
- Date: Mon, 7 Apr 2008 07:14:57 -0700 (PDT)
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class dbconn
Public Shared Function ConnString() As SqlConnection
Dim conn As String
conn = "DATA
SOURCE=SqlServer;UID=SomeID;PWD=SomePass;DATABASE=SomeDB"
Dim sqlconn As New SqlConnection(conn)
sqlconn.Open()
Return sqlconn
End Function
End Class
On Apr 1, 1:39 pm, Jack Jackson <jjack...@xxxxxxxxxxxxxxxx> wrote:
On Tue, 1 Apr 2008 08:03:47 -0700 (PDT), Chris <coz1...@xxxxxxxxx>
wrote:
Hi-
I've got a pooled connection string I've written in C#.
namespace SomeProgram
{
static class Program
{
public static OleDbConnection DBConnectionString
{
get
{
string conn;
DataSet ds = new DataSet();
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=DB
\\somedb.mdb";
OleDbConnection oleconn = new OleDbConnection(conn);
oleconn.Open();
return oleconn;
}
}
}
}
Now it works great in C#, but I'm trying to do the same thing in VB.
When I code the VB equivalent and try to reference it
(Program.DBConnectionString), it errors out and says that 'Program is
not defined'. Any suggestions and tips are more than welcome. Thanks.
Maybe SomeProgram.Program.DBConnectionString?
.
- Follow-Ups:
- Re: Pooled Connection Strings
- From: Patrice
- Re: Pooled Connection Strings
- References:
- Pooled Connection Strings
- From: Chris
- Re: Pooled Connection Strings
- From: Jack Jackson
- Pooled Connection Strings
- Prev by Date: Re: Heavy Application with Multiple Modules
- Next by Date: Re: Pooled Connection Strings
- Previous by thread: Re: Pooled Connection Strings
- Next by thread: Re: Pooled Connection Strings
- Index(es):
Relevant Pages
|