|
-
Oct 28th, 2002, 10:43 AM
#1
Thread Starter
Addicted Member
two hard questions?
hi, i have two problems:
problem 1:
I have a web application, this application access an sql server. the database will be moved from time to time.
I need to know if it is possible to type in the location of the database server into a text box or something and then start using the system?
problem 2:
how do i view what roles the user that has logged into my system has, i wish to limit what is displayed on a web page if a user with a certain role is logged in, i know how to do it using the domain or the user name, but not the role.
please help if you can
thanks
tom.
-
Oct 28th, 2002, 11:09 AM
#2
1. You could store the connection string in a variable and have a textbox that enters a new one when needed. That may only last per user though. You could setup a page that writes the connection string to a config file and persists it that way though.
2. Do a search in the help for the WindowsPrinciple.IsInRole() function which will tell you if the user is in a certain role or not.
-
Oct 28th, 2002, 11:14 AM
#3
Thread Starter
Addicted Member
Originally posted by Edneeis
[B]1. You could store the connection string in a variable and have a textbox that enters a new one when needed. That may only last per user though. You could setup a page that writes the connection string to a config file and persists it that way though.
do you know of any examples of this at the moment i have used various walkthroughs, i am using session variables:
i thought this might have worked:
Session("conClasf") = "Data Source=" & txtDbServer.Text & ";Integrated Security=SSPI; Initial Catalog=SystemStatus"
but no, also i am using SqlDataAdapters that have datasets, these are configured within the .net, will i have to change these??
-
Oct 29th, 2002, 12:56 AM
#4
Addicted Member
Hi
Why not try using ODBC where you can simply change the new location of the database whithout messing with your code
-
Oct 29th, 2002, 02:36 AM
#5
Your code looks right maybe you have to use the Add method of the session object to get the value in???
-
Oct 29th, 2002, 04:09 AM
#6
Thread Starter
Addicted Member
-
Oct 29th, 2002, 04:57 AM
#7
VB Code:
Session.Add("conClasf", "Data Source=" & txtDbServer.Text & ";Integrated Security=SSPI; Initial Catalog=SystemStatus")
Although to tell the truth I'm no wiz at web stuff. So I'm not sure of the scope of teh session object. Also I don't know if you HAVE to use add or what happens if you add an item that is already there. But in the past this is how I entered things into the sesion object.
-
Oct 29th, 2002, 05:02 AM
#8
Thread Starter
Addicted Member
Originally posted by Edneeis
VB Code:
Session.Add("conClasf", "Data Source=" & txtDbServer.Text & ";Integrated Security=SSPI; Initial Catalog=SystemStatus")
Although to tell the truth I'm no wiz at web stuff. So I'm not sure of the scope of teh session object. Also I don't know if you HAVE to use add or what happens if you add an item that is already there. But in the past this is how I entered things into the sesion object.
where should the txtDbServer.Text be deffined? at the moment it is a textbox on the web page but i have had to define it in the global.asax file aswell??
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
|