Results 1 to 8 of 8

Thread: two hard questions?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    128

    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.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    128
    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??

  4. #4
    Addicted Member CoMMiE's Avatar
    Join Date
    Jul 2000
    Location
    Malaysia, Kuala Lumpur
    Posts
    179
    Hi
    Why not try using ODBC where you can simply change the new location of the database whithout messing with your code

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Your code looks right maybe you have to use the Add method of the session object to get the value in???

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    128
    add...how?

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    VB Code:
    1. 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.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    128
    Originally posted by Edneeis
    VB Code:
    1. 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
  •  



Click Here to Expand Forum to Full Width