|
 |
aspx thread: RE: aspx digest: March 27, 2002
Message #1 by "Tony Arslan" <tarslan@n...> on Thu, 28 Mar 2002 08:31:40 -0600
|
|
Zach,
The following code should work for you (I hope). Only for SQL Server not
for anyother DBMS.
Imports = System.Data
Imports = System.Data.SqlClient
Dim myConnection As SQLConnection
Dim myCommand As SQLCommand
Dim myReader As SQLDataReader
Dim SQL As String
Dim ConnStr As String
SQL = "SELECT * FROM Shippers"
'Use either one of the following lines. NOT
BOTH
'This line is for DSN. You need to setup a DSN
with DsnNorthwind
ConnStr
ConfigurationSettings.AppSettings("DsnNorthwind")
'Use this line for DSN-less. I prefer this.
ConnStr
"server=localhost;uid=sa;pwd=tony;database=Northwind"
myConnection = New SQLConnection(ConnStr)
myConnection.Open()
myCommand = New SQLCommand(SQL, myConnection)
myReader = myCommand.ExecuteReader()
ShipMethod.DataSource = myReader
ShipMethod.DataBind()
Good Luck,
Tony
-----Original Message-----
From: ASP+ digest [mailto:aspx@p...]
Sent: Wednesday, March 27, 2002 5:00 PM
To: aspx digest recipients
Subject: aspx digest: March 27, 2002
-----------------------------------------------
When replying to the digest, please quote only
relevant material, and edit the subject line to
reflect the message you are replying to.
-----------------------------------------------
The URL for this list is: http://p2p.wrox.com/list.asp?list=aspx
ASPX Digest for Wednesday, March 27, 2002.
1. How is the Treeview font set?
2. Re: How is the Treeview font set?
3. Re: page_load & response.redirect???
4. Re: page_load & response.redirect???
5. Connect to MySQL database
6. Fw: Pooling problem in aspx final release
7. Re: Fw: Pooling problem in aspx final release
----------------------------------------------------------------------
Subject: How is the Treeview font set?
From: jude@j...
Date: Wed, 27 Mar 2002 11:51:10
X-Message-Number: 1
Does anyone know how to set the Treeview control font from the
default "Times"?
I've tried several things, but had no luck.
Thanks.
j
----------------------------------------------------------------------
Subject: Re: How is the Treeview font set?
From: jude@j...
Date: Wed, 27 Mar 2002 14:24:00
X-Message-Number: 2
NEVER MIND. I Figgered It oUt.
----------------------------------------------------------------------
Subject: Re: page_load & response.redirect???
From: "jstorfa" <jstorfa@s...>
Date: Wed, 27 Mar 2002 17:20:49
X-Message-Number: 3
response is not an object.... Response is though...
>
> I use windows authentication mode, in my login page, the page_load sub
will
> determine
> weather the user is admin or regular user and then redirect them to an
> appropriate page, but it seems the the
> response.redirect("whatever.aspx") doesn't work? how come?
>
> my code:
>
> Sub Page_Load()
>
> 'see if the user has been authenticated
> If User.Identity.IsAuthenticated Then
>
> 'create a reference to a WIndowsIdentity object that
> 'represents this users Indentity object
> Dim objIdentity = CType(User.Identity, WindowsIdentity)
>
> 'get the current WindowsIdentity object for this user
> 'this contains more specific information
> Dim objWinIdentity = objIdentity.GetCurrent()
>
> 'display the properties
> 'NOTE: change the group names and the machine name to suit your
setup
> msgHello.InnerHtml = "Hello <b>" & objWinIdentity.Name
& "</b><br />" _
> & "The authentication method used was <b>" _
> & objWinIdentity.AuthenticationType
& "</b><br />" _
> & "Is this a System account: <b>" _
> & objWinIdentity.IsSystem & "</b><br />" _
> & "Is this an Anonymous account: <b>" _
> & objWinIdentity.IsAnonymous & "</b><br />" _
> & "Is this a Guest account: <b>" _
> & objWinIdentity.IsGuest & "</b><br />" _
> & "Is this account a member of
the 'Administrators'
> group: <b>" _
> & User.IsInRole("BUILTIN\Administrators")
& "</b><br
> />" _
> & "Is this account a member of the 'Users'
> group: <b>" _
> & User.IsInRole("BUILTIN\Users") & "</b><br />"
_
> & "Is this account a member of the
> 'DANDARE\TestGroup' group: <b>" _
> & User.IsInRole("DANDARE\TestGroup")
& "</b><br />" _
> & "Is this account a member of the
> 'DANDARE\NoMembers' group: <b>" _
> & User.IsInRole("DANDARE\NoMembers") & "</b>"
>
> ' note the messgae above display properly without the following added,
> otherwise the page is blank.
>
> if User.IsInRole("BUILTIN\Administrators")
> response.redirect("login_admin.aspx")
> else
> response.redirect("login_user.aspx")
> end if
>
>
>
> Else
>
> msgHello.InnerHtml = "Hello, you were not authenticated"
>
> End If
>
> End Sub
>
> Kevin Yu
> system.data.oledb
> coop student
> Western Research Center - Natural Resource Canada
> email: kyu@n...
> phone:(780) 987-8611
>
----------------------------------------------------------------------
Subject: Re: page_load & response.redirect???
From: "Lewis" <lewis@t...>
Date: Wed, 27 Mar 2002 10:38:16 -0700
X-Message-Number: 4
Response.redirect should work - but it sends the new url to the client's
browser and then it comes back in as a new request. I think that your
code should work if you use
server.transfer("whatever.aspx") instead.
-----Original Message-----
From: jstorfa [mailto:jstorfa@s...]
Sent: Wednesday, March 27, 2002 5:21 PM
To: ASP+
Subject: [aspx] Re: page_load & response.redirect???
response is not an object.... Response is though...
>
> I use windows authentication mode, in my login page, the page_load sub
will
> determine
> weather the user is admin or regular user and then redirect them to an
> appropriate page, but it seems the the
> response.redirect("whatever.aspx") doesn't work? how come?
>
> my code:
>
> Sub Page_Load()
>
> 'see if the user has been authenticated
> If User.Identity.IsAuthenticated Then
>
> 'create a reference to a WIndowsIdentity object that
> 'represents this users Indentity object
> Dim objIdentity = CType(User.Identity, WindowsIdentity)
>
> 'get the current WindowsIdentity object for this user
> 'this contains more specific information
> Dim objWinIdentity = objIdentity.GetCurrent()
>
> 'display the properties
> 'NOTE: change the group names and the machine name to suit your
setup
> msgHello.InnerHtml = "Hello <b>" & objWinIdentity.Name
& "</b><br />" _
> & "The authentication method used was <b>" _
> & objWinIdentity.AuthenticationType
& "</b><br />" _
> & "Is this a System account: <b>" _
> & objWinIdentity.IsSystem & "</b><br />" _
> & "Is this an Anonymous account: <b>" _
> & objWinIdentity.IsAnonymous & "</b><br />" _
> & "Is this a Guest account: <b>" _
> & objWinIdentity.IsGuest & "</b><br />" _
> & "Is this account a member of
the 'Administrators'
> group: <b>" _
> & User.IsInRole("BUILTIN\Administrators")
& "</b><br
> />" _
> & "Is this account a member of the 'Users'
> group: <b>" _
> & User.IsInRole("BUILTIN\Users") & "</b><br />"
_
> & "Is this account a member of the
> 'DANDARE\TestGroup' group: <b>" _
> & User.IsInRole("DANDARE\TestGroup")
& "</b><br />" _
> & "Is this account a member of the
> 'DANDARE\NoMembers' group: <b>" _
> & User.IsInRole("DANDARE\NoMembers") & "</b>"
>
> ' note the messgae above display properly without the following added,
> otherwise the page is blank.
>
> if User.IsInRole("BUILTIN\Administrators")
> response.redirect("login_admin.aspx")
> else
> response.redirect("login_user.aspx")
> end if
>
>
>
> Else
>
> msgHello.InnerHtml = "Hello, you were not authenticated"
>
> End If
>
> End Sub
>
> Kevin Yu
> system.data.oledb
> coop student
> Western Research Center - Natural Resource Canada
> email: kyu@n...
> phone:(780) 987-8611
>
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
----------------------------------------------------------------------
Subject: Connect to MySQL database
From: "Zach Clements" <clementz@c...>
Date: Wed, 27 Mar 2002 19:38:27
X-Message-Number: 5
Could someone show me how to connect to a MySql database with ASP.net?
Thanks Zach
----------------------------------------------------------------------
Subject: Fw: Pooling problem in aspx final release
From: "Farhan Zia" <farhan-zia@c...>
Date: Thu, 28 Mar 2002 00:58:08 +0500
X-Message-Number: 6
hi.......i have converted my system from .net betaII to final release. I
need some help regarding it. Actually I am working on a 3 tier
architecture... SQL at back end, VB.Net as middle layer and asp.net at
from end. After migrating to final release, as I tried to access my
site... it throws an exception saying "Server timeout before getting a
connection from pool. This could happen because all connection objects
in the pool are in use and the maximum size of pool is reached." I
tested my COM(middle layer) through a .net windows application and it
works perfectly well. But when accesed through ASP.Net... I get this
error. Even I cannot login to my site.
Please help. Thanks
Farhan Zia
----------------------------------------------------------------------
Subject: Re: Fw: Pooling problem in aspx final release
From: Philip Tham <philipt1@s...>
Date: Wed, 27 Mar 2002 17:57:00 -0600
X-Message-Number: 7
I would suggest try not to use com first - just execute the program with
the programming codes. This willgive you some ideas with your com
setting and others.... Have you consider using web services? I run
into this problem before and end up of not using com layer.
Philip
----- Original Message -----
From: "Farhan Zia" <farhan-zia@c...>
To: "ASP+" <aspx@p...>
Sent: Wednesday, March 27, 2002 1:58 PM
Subject: [aspx] Fw: Pooling problem in aspx final release
> hi.......i have converted my system from .net betaII to final release.
> I need some help regarding it. Actually I am working on a 3 tier
> architecture... SQL at back end, VB.Net as middle layer and asp.net at
from
> end. After migrating to final release, as I tried to access my
> site... it throws an exception saying "Server timeout before getting a
> connection
from
> pool. This could happen because all connection objects in the pool are
> in use and the maximum size of pool is reached." I tested my
> COM(middle
layer)
> through a .net windows application and it works perfectly well. But
> when accesed through ASP.Net... I get this error. Even I cannot login
> to my
site.
>
> Please help. Thanks
> Farhan Zia
>
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to
---
END OF DIGEST
|
|
 |