|
-
Jan 13th, 2003, 01:41 AM
#1
Thread Starter
Fanatic Member
comman Connection
hi
i am a vb programmer .. petty new to asp.net
as we have a public connection object in module can we have a connection.
i have some events which connection to database and retrive the database....
can i have a .. if so how and where do i need to declare it
regards
-
Jan 17th, 2003, 05:26 AM
#2
Thread Starter
Fanatic Member
-
Jan 17th, 2003, 10:47 AM
#3
huh? Your question makes no sense!
-
Jan 18th, 2003, 01:24 AM
#4
Thread Starter
Fanatic Member
Originally posted by Cander
huh? Your question makes no sense!
my mistake... when u are new u dont know ur problem to right...
ok...
as we have connection object in module in vb6 can we have connection object in asp.net module.
will it be the same as vb
i tried it the connect is shared... but i can have only one datareader is it so or do we have a way of doing....
i need to share connection datareader object across pages as we do in vb
hope this time i make some sense
-
Jan 19th, 2003, 11:06 PM
#5
Lively Member
You can add it in your web.config file in an appsettings block
Code:
<appsettings>
<add key="constring" value="data source=localhost;initial catalog=northwind;UID=sa;Pwd=;"/>
</appSettings>
Then access it like so:
Code:
Imports System.Collections.Specialized
Dim appsetting As NameValueCollection = CType(HttpContext.Current.GetConfig("appSettings"), NameValueCollection)
conn = CStr(appsetting("constring"))
"Find all you need in your mind if you take the time" -DT
-
Jan 20th, 2003, 06:04 AM
#6
Thread Starter
Fanatic Member
Originally posted by Cin0s3
You can add it in your web.config file in an appsettings block
Code:
<appsettings>
<add key="constring" value="data source=localhost;initial catalog=northwind;UID=sa;Pwd=;"/>
</appSettings>
Then access it like so:
Code:
Imports System.Collections.Specialized
Dim appsetting As NameValueCollection = CType(HttpContext.Current.GetConfig("appSettings"), NameValueCollection)
conn = CStr(appsetting("constring"))
dont u think this will share the connect string rather than the connection object.
if u see my Q.. it is diff i am trying to open more than one datareader with same connection object
any way thanks a lot for tip
-
Jan 20th, 2003, 01:47 PM
#7
Frenzied Member
This connection object of yours, is it like a vb module, or a compiled business object, like a dll file??? More info please.
Whenever I need database support to my asp.net pages I use my db.dll file in which I have all the logic behind connections. Reuse code is the way to do it 
kind regards
Henrik
-
Jan 21st, 2003, 06:17 AM
#8
Thread Starter
Fanatic Member
i have connection object in module as we have in vb.
my point is not behind connecting .. can we have more than one datareader object for same connection.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|