Click here to Skip to main content
15,887,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Abandoning Session not logging out Pin
Abhishek Sur2-Mar-09 2:53
professionalAbhishek Sur2-Mar-09 2:53 
QuestionASP.NET Problem with IO.Directory.GetFiles Pin
Larvex2-Mar-09 2:23
Larvex2-Mar-09 2:23 
AnswerRe: ASP.NET Problem with IO.Directory.GetFiles Pin
Abhishek Sur2-Mar-09 2:54
professionalAbhishek Sur2-Mar-09 2:54 
GeneralRe: ASP.NET Problem with IO.Directory.GetFiles Pin
Larvex2-Mar-09 3:40
Larvex2-Mar-09 3:40 
GeneralRe: ASP.NET Problem with IO.Directory.GetFiles Pin
Larvex2-Mar-09 4:57
Larvex2-Mar-09 4:57 
GeneralRe: ASP.NET Problem with IO.Directory.GetFiles Pin
pnslcs2-Mar-09 9:24
pnslcs2-Mar-09 9:24 
GeneralRe: ASP.NET Problem with IO.Directory.GetFiles Pin
Larvex3-Mar-09 0:18
Larvex3-Mar-09 0:18 
QuestionUpdate Connection String Pin
Vimalsoft(Pty) Ltd2-Mar-09 1:53
professionalVimalsoft(Pty) Ltd2-Mar-09 1:53 
Good Afternoon

My Application is Structured in a Way that before you login you must First Select a Database. Now i have one page that i want to change the Connection String Database name.

I have this function that get called on page load


/*This Function will change the Connection string in the web.congif file based on the Database that exists on the
 * session Variable. If there is nulll then set odirect3 as a current Database name.
 */
public void UpdateConfig()
{
    CommonFunctions obj = new CommonFunctions();



    String strKey = "NEWDT";

    String StrDatabase;

    if (Session["ActiveDatabase"] != null)
    {
        StrDatabase = Convert.ToString(Session["ActiveDatabase"]);
    }
    else
    {
        StrDatabase = "oDirectv3";
    }

    String strValue = @"User id=sa;Password=abacus;Server=LOUWTJIE\SQLEXPRESSDatabase="+StrDatabase;

    Configuration objConfig = WebConfigurationManager.OpenWebConfiguration("~");

    AppSettingsSection objAppsettings = (AppSettingsSection)objConfig.GetSection("appSettings");

    if (objAppsettings != null)
    {
        objAppsettings.Settings[strKey].Value = strValue;

        objConfig.Save();
    }
}


On the Development site it works well. But while still debugging the code, checking if its doing what i want, There is a point where it has to save the changes
objConfig.Save();

The Part will execute and message box will appear asking me if i really want to save the changes made, i will save yes and everything will be fine. But if i don debug it , it gives an Error that says
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)


How can i do this and Suppress this dialogs


Thank you

Vuyiswa Maseko,

Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za

AnswerRe: Update Connection String Pin
J4amieC2-Mar-09 2:12
J4amieC2-Mar-09 2:12 
GeneralRe: Update Connection String Pin
Greg Chelstowski2-Mar-09 2:13
Greg Chelstowski2-Mar-09 2:13 
GeneralRe: Update Connection String Pin
Vimalsoft(Pty) Ltd2-Mar-09 2:23
professionalVimalsoft(Pty) Ltd2-Mar-09 2:23 
AnswerRe: Update Connection String Pin
Greg Chelstowski2-Mar-09 2:12
Greg Chelstowski2-Mar-09 2:12 
GeneralRe: Update Connection String Pin
Vimalsoft(Pty) Ltd2-Mar-09 2:31
professionalVimalsoft(Pty) Ltd2-Mar-09 2:31 
GeneralRe: Update Connection String Pin
Greg Chelstowski2-Mar-09 2:41
Greg Chelstowski2-Mar-09 2:41 
GeneralRe: Update Connection String Pin
Vimalsoft(Pty) Ltd2-Mar-09 2:47
professionalVimalsoft(Pty) Ltd2-Mar-09 2:47 
GeneralRe: Update Connection String Pin
Greg Chelstowski2-Mar-09 2:53
Greg Chelstowski2-Mar-09 2:53 
GeneralRe: Update Connection String Pin
Vimalsoft(Pty) Ltd2-Mar-09 19:45
professionalVimalsoft(Pty) Ltd2-Mar-09 19:45 
GeneralRe: Update Connection String Pin
Greg Chelstowski2-Mar-09 20:50
Greg Chelstowski2-Mar-09 20:50 
GeneralRe: Update Connection String Pin
Vimalsoft(Pty) Ltd4-Mar-09 1:27
professionalVimalsoft(Pty) Ltd4-Mar-09 1:27 
QuestionCan i use my own User Registartion Information Class with ASP .NET Login controls Pin
The One2-Mar-09 1:49
The One2-Mar-09 1:49 
AnswerRe: Can i use my own User Registartion Information Class with ASP .NET Login controls Pin
Abhishek Sur2-Mar-09 3:55
professionalAbhishek Sur2-Mar-09 3:55 
QuestionError occuring while developin with ASP.NET Pin
VeeKeyBee2-Mar-09 1:46
VeeKeyBee2-Mar-09 1:46 
AnswerRe: Error occuring while developin with ASP.NET Pin
Vimalsoft(Pty) Ltd2-Mar-09 1:54
professionalVimalsoft(Pty) Ltd2-Mar-09 1:54 
QuestionImport data from Excel sheet to sql Database-asp.net 2.0 Pin
Member 46590012-Mar-09 1:26
Member 46590012-Mar-09 1:26 
AnswerRe: Import data from Excel sheet to sql Database-asp.net 2.0 Pin
Greg Chelstowski2-Mar-09 1:34
Greg Chelstowski2-Mar-09 1:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.