Changing Connection String dynamically at runtime

I am using the Crystal Report Viewer control in in a Visuall Studio 2008 C# project.  The reports are created inside of Visual Studio 2008, and will be running against an InterSystems Cache database.  I have to use an ODBC (RDO) connection and use a connection string.
I have seen many examples of how to update the connection string at runtime if it is SQL server (or some flavor thereof), but nothing for an ODBC (RDO) connection to a NON-MSSQL database.
The problem when I update the connection string for each of the tables in the report, the report will either not run and display a window -- tiled 'Datbase Login' -- that has the Server, Database, Username, and Password fields on the window, OR, it will run but not against the database that was specified at runtime (it uses the connection stored in the report).
Code Sample #1 (This is using the connection string, and will cause a the "Database Login" window to be displayed - the first scenario from above)
rd = new ReportDocument();
// Load the report
rd.Load(fileName, OpenReportMethod.OpenReportByDefault);
rd.Refresh();
// Create the connection object
ConnectionInfo connectionInfo = CreateConnection(Server, Port, ServerNamespace, Username, Password);
// Set the connection info on each table in the report
SetDBLogonForReport(connectionInfo, rd);
SetDBLogonForSubreports(connectionInfo, rd);
private static ConnectionInfo CreateConnection(string Server,
                                               int Port,
                                               string ServerNamespace,
                                               string Username,
                                               string Password)
        ConnectionInfo connectionInfo = new ConnectionInfo();
        string connString = "DRIVER=InterSystems ODBC;SERVER=" + Server
                                                  + ";PORT=" + Port
                                                  + ";DATABASE=" + ServerNamespace
                                                  + ";UID=" + Username
                                                  + ";PWD=" + Password;
        connectionInfo.IntegratedSecurity = false;
        connectionInfo.UserID = Username;
        connectionInfo.Password = Password;        //In examples that I have seen, this is the actual connection string, not just the server name
        connectionInfo.ServerName = connString;          connectionInfo.DatabaseName = ServerNamespace;
        connectionInfo.Type = ConnectionInfoType.CRQE;
        return connectionInfo;
private static void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
        foreach (CrystalDecisions.CrystalReports.Engine.Table table in reportDocument.Database.Tables)
            TableLogOnInfo tableLogonInfo = table.LogOnInfo;
            tableLogonInfo.ConnectionInfo = connectionInfo;
            table.ApplyLogOnInfo(tableLogonInfo);
private static void SetDBLogonForSubreports(ConnectionInfo connectionInfo, ReportDocument reportDocument)
        foreach (Section section in reportDocument.ReportDefinition.Sections)
            foreach (ReportObject reportObject in section.ReportObjects)
                if (reportObject.Kind == ReportObjectKind.SubreportObject)
                    SubreportObject subreportObject = (SubreportObject)reportObject;
                    ReportDocument subReportDocument = subreportObject.OpenSubreport(subreportObject.SubreportName);
                    SetDBLogonForReport(connectionInfo, subReportDocument);
Sample #2 (the same as Sample #1 above, only the ConnectionInfo method is different - which is all that I included here)
private static ConnectionInfo CreateConnection(string Server,
                                                int Port,
                                               string ServerNamespace,
                                               string Username,
                                               string Password)
        ConnectionInfo connectionInfo = new ConnectionInfo();
        string connString = "DRIVER=InterSystems ODBC;SERVER=" + Server
                                                  + ";PORT=" + Port
                                                  + ";DATABASE=" + ServerNamespace
                                                  + ";UID=" + Username
                                                  + ";PWD=" + Password;
        connectionInfo.Attributes.Collection.Add(new NameValuePair2(
                          DbConnectionAttributes.CONNINFO_DATABASE_DLL, DbConnectionAttributes.DATABASE_DLL_CRDB_ODBC));
        connectionInfo.Attributes.Collection.Add(new NameValuePair2(
                          DbConnectionAttributes.QE_DATABASE_NAME, ServerNamespace));
        connectionInfo.Attributes.Collection.Add(new NameValuePair2(
                          "QE_DatabaseType", "ODBC (RDO)"));
        DbConnectionAttributes attributes = new DbConnectionAttributes();
        attributes.Collection.Add(new NameValuePair2(
                          DbConnectionAttributes.CONNINFO_CONNECTION_STRING, connString));
        attributes.Collection.Add(new NameValuePair2(
                          "Server", Server));
        attributes.Collection.Add(new NameValuePair2(
                          "UseDSNProperties", false));
        connectionInfo.Attributes.Collection.Add(new NameValuePair2
(                          DbConnectionAttributes.QE_LOGON_PROPERTIES, attributes));
        connectionInfo.Attributes.Collection.Add(new NameValuePair2(
                          DbConnectionAttributes.QE_SERVER_DESCRIPTION, Server));
        connectionInfo.Attributes.Collection.Add(new NameValuePair2(
                          "QE_SQLDB", true));
        connectionInfo.Attributes.Collection.Add(new NameValuePair2(
                          DbConnectionAttributes.CONNINFO_SSO_ENABLED, false));
        connectionInfo.IntegratedSecurity = false;
        connectionInfo.UserID = Username;
        connectionInfo.Password = Password;
        connectionInfo.ServerName = connString;
        connectionInfo.DatabaseName = ServerNamespace;
        connectionInfo.Type = ConnectionInfoType.CRQE;
        return connectionInfo;
I have also tried setting connectionInfo.ServerName equal to just the real server name, but that didn't work either.
After the above operations are performed, I simply assign the returned ReportDocument object to the Crystal Viewer control.  If I don't call the above functions, and just set the ReportDocument source (using whatever connection string was embedded in the report originally), the report runs as expected.  Only when I attempt to update the connection string, the report will not execute.  Please advise.  Thanks!

I am using the Crystal Report Viewer control in in a Visuall Studio 2008 C# project.  The reports are created inside of Visual Studio 2008, and will be running against an InterSystems Cache database.  I have to use an ODBC (RDO) connection and use a connection string.
I have seen many examples of how to update the connection string at runtime if it is SQL server (or some flavor thereof), but nothing for an ODBC (RDO) connection to a NON-MSSQL database.
The problem when I update the connection string for each of the tables in the report, the report will either not run and display a window -- titled 'Datbase Login' -- that has the Server, Database, Username, and Password fields on the window, OR, it will run but not against the database that was specified at runtime (it uses the connection stored in the report).
Code Sample #1 (This is using the connection string, and will cause a the "Database Login" window to be displayed - the first scenario from above) -- The code samples appear to be too long to post, so I will add them as seperate replies.
rd = new ReportDocument();
// Load the report
rd.Load(fileName, OpenReportMethod.OpenReportByDefault);
rd.Refresh();
// Create the connection object
ConnectionInfo connectionInfo = CreateConnection(Server, Port, ServerNamespace, Username, Password);
// Set the connection info on each table in the report
SetDBLogonForReport(connectionInfo, rd);
SetDBLogonForSubreports(connectionInfo, rd);
private static ConnectionInfo CreateConnection(string Server, int Port, string ServerNamespace, string Username, string Password)
        ConnectionInfo connectionInfo = new ConnectionInfo();
        string connString = "DRIVER=InterSystems ODBC;SERVER=" + Server + ";PORT=" + Port + ";DATABASE=" + ServerNamespace + ";UID=" + Username + ";PWD=" + Password;
        connectionInfo.IntegratedSecurity = false;
        connectionInfo.UserID = Username;
        connectionInfo.Password = Password;        //In examples that I have seen, this is the actual connection string, not just the server name
        connectionInfo.ServerName = connString;          connectionInfo.DatabaseName = ServerNamespace;
        connectionInfo.Type = ConnectionInfoType.CRQE;
        return connectionInfo;
// Code smple continued in the next reply

Similar Messages

  • How to change Connection String property in DataLink tab with Database options at Runtime?

    Hello
    please help me with your suggestions on the subject.
    I need to set "connection String" property at runtime as a result of some operation so as to log data in one of the 2 different database available.
    Regards
    Nitin Goel

    Hello Goel,
    are you thinking about something like this:
    Message Edited by frankne on 07-15-2009 01:40 AM

  • Problem with Connection Manager. Can't change connection string / Server name

    p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin-top:0cm;margin-right:0cm;margin-bottom:10.0pt;margin-left:0cm;line-height:115%;font-size:11.0pt;font-family:'Calibri','sans-serif';}
    .MsoChpDefault
    {font-size:10.0pt;}
    .MsoPapDefault
    {line-height:115%;}
    @page Section1
    {size:612.0pt 792.0pt;margin:72.0pt 72.0pt 72.0pt 72.0pt;}
    div.Section1
    {page:Section1;}
    Hi,
    I have copied a number of SSID packages from a live server to my test server and am trying to get them up and running but I have a problem with the connection. The only thing that is different is the server name. I decided to keep the same connection in the connection manager as it is referenced in a dtsConfig file. I changed the dtsConfig file to reference the new servername [Data Source= new test server name]. I also check my paths and they are pointing to the correct config locations etc.
    I found this post which was similar to my problem but I still get problems with the connection
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1319961&SiteID=1
    I updated the connection by changing the server name in the actual connection. I did this from the data flow tab in the Connection Managers sections (MS Visual Studio). Right clicked - Edit - changed the name of the server name to my test server and selected the database. Test connection was fine, and saved this.
    Once I saved this, the connection string changed to my current test server in the properties of the connection. However when I run the package I get the following error:
    Error: 0xC0202009 at ReportsImport, Connection manager "myconnectionstring": SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Login timeout expired".
    An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".
    An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Named Pipes Provider: Could not open a connection to SQL Server [53]. ".
    Error: 0xC020801C at Myprocess import from file, BuyAtReportsImport [79]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "myconnectionstring" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    Error: 0xC0047017 at Myprocess import from file, DTS.Pipeline: component "ReportsImport" (79) failed validation and returned error code 0xC020801C.
    Error: 0xC004700C at Myprocess import from file, DTS.Pipeline: One or more component failed validation.
    Error: 0xC0024107 at Myprocess import from file: There were errors during task validation.
    So even if I change the existing connection properties and save and Build my package again, my connection properties (connectionstring, servername etc) all revert back to its original data source when I re-open the package. Simply it does not seem to be saving the connection properties i put in.
    What am I doing wrong or how can I change the existing connection manager to look at the new server. The database is  the same and I have full admin privilege on the server.
    I don't want to recreate my packages as there are alot and they are not simple.
    After changing the connection properties, saving and reloading I get a connection error. But this is because it is not retaining the new connection manger setting i entered.
    Incidentally - I created a new SSID to perform a simple connection and write to the the server and it was OK so there is no problem with actually seeing the my test server.
    Thanks in advance

    Yes, the package is in visual studio and I have executed it. There are no errors but in the output i have the error message about my connection. My dtsConfig file is added to the project in the 'Package Configuration Organizer' and path and files are correct. This is the output error:
    Error: 0xC020801C at xx import from file, xxReportsImport [79]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "myconnectionname" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    I will try and run it using dtexec.exe. if I have two config files do i use
    dtsexec.exe /f <packagename> /conf <configfile> /conf <secondconfigfile>

  • Changing connection string host from localhost to IP address produces error

    Hi all,
    First of all, thanks in advance for your help. Second, I know next to nothing about Oracle database administration, so please be patient, but I want to understand things, rather than just running down the Google rabbit hole with guess-and-check until things happen to work and I don't know why.
    I've got a connection string that I'm using to connect to a local Oracle database I'm using for testing. I have the 11g installed and the 11.1.0.7 64-bit client (as my application is a 64-bit application) installed, both locally on my development machine. I've got a connection working using the following connection string:
    Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = mywindowslogin.path.to.me)));User Id=********;Password=********;However, when I change "localhost" to my IP address, my computer name, or anything else, I get "ORA-12541: TNS:no listener".
    The tnsnames.ora in my database home is as follows - it was set up for me automatically when I installed the database. mywindowslogin.path.to.me doesn't point to anywhere, which I assume is correct, but my computer is on the path.to.me domain.
    LISTENER_MYWINDOWSLOGIN =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
    MYWINDOWSLOGIN =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = mywindowslogin.path.to.me)
      )How can I resolve this issue?
    Edited by: Don on Jul 14, 2010 8:31 AM

    Does setting the environment variable affect all installations? Only two of my four Oracle Homes have a tnsnames.ora file, or event a NETWORK/ADMIN location, so I'm not sure where to put tnsnames.ora in those Homes. I copied the tnsnames.ora for my database to the one other Home that had a NETWORK/ADMIN location, but I'm still getting "ORA-12541: TNS:no listener" if I don't use "localhost" as the host.
    Thanks!
    Edited by: Don on Jul 14, 2010 12:08 PM

  • Database connection string dynamic

    Hello everybody,
    My application should do some tests that user choses.
    For each test type I should save the database in a file with different name, something like : Report_YYYY_MM_DD_Test_x, without stopping the execution of the application.
    My problem is that i cannont rename the database after Teststand wrote in it. I must stop first the application and then I can rename it.
    I tried to build dynamic connection strings and to prepare the database before Teststand write it. But I saw that after the first acces, despite of new connection string, Testand write further in the database described in the first connection string. Also seems that the handle to database once established, will be released at the end of test. I could close the connection to the DB but i don't know if it is possible.
    for any ideea how to handle this situation i would be grateful

    Hi Harleen Kaur Chadha,
    I understand your requirement is access 5-6 database on same server using one JDB receiver channel. I think, it is possible. SAP Help [Link|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm ]. In receiver JDB channel select Message Protocol : u201CNative SQL Stringu201D. Then you have make sure that the payload coming to this JDBC receiver channel should look like this
    INSERT INTO DatabaseName : tableName 
    (column-name1, column-name2, column-name3)
    VALUES(u2018column-value1u2019, u2018column-value2u2019, u2018column-value3u2019)
    But, the mapping program you are using now, should generate the String (shown above). And SAP says this protocol is primarily for test purposes.
    FYI. If you select Message Protocol: "XML SQL Format", finally it would be converted to string (shown above) will be sent to database.
    Regards,
    Raghu_Vamsee

  • How to change connection string for a form created with b1de

    Hi all
    i've created a form using the Code Generator tool ob B1DE
    My question is how can i set the connection string to a different server and database. doing so after the creation wizard has finished?

    Hi,
    Why do you need to change the connection string? What are you calling "connection string for a form"???
    The only connection string I now about is the one used to connect to the UI API... and this one is fixed for all apps in debug mode and given as parameter when your addon is registered in B1.
    The connection string is filled in the code of your generated addon.
    Please go to the main class of your addon, in the main method you have the following code where the connection string is filled either with the command line parameters (release mode) or with the fixed value given by SAP. This code doesn't need to be changed...
            public static void Main()
                int retCode = 0;
                string connStr = "";
                bool diRequired = true;
                // CHANGE ADDON IDENTIFIER BEFORE RELEASING TO CUSTOMER (Solution Identifier)
                string addOnIdentifierStr = "";
                if ((System.Environment.GetCommandLineArgs().Length == 1)) {
                    connStr = B1Connections.connStr;
                else {
                    connStr = System.Environment.GetCommandLineArgs().GetValue(1).ToString();
                try {
                    // INIT CONNECTIONS
                    retCode = B1Connections.Init(connStr, addOnIdentifierStr, diRequired);
    Regards
    Trinidad.

  • Change connection string in MS Excel 2013 powerpivot

    I need to update connection strings of multiple files in Bulk using c# . But , Its working for MS Excel 2010 and not for Excel 2013.
    Code snippet :
    Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
    Microsoft.Office.Interop.Excel.Workbook ppWorkbook = (Microsoft.Office.Interop.Excel.Workbook)xlApp.Workbooks.Open(fileNameBox.Text);
    Microsoft.Office.Interop.Excel.Connections connections = ppWorkbook.Connections;
    string newConnectionString = "Connection String";
    try
    foreach (Microsoft.Office.Interop.Excel.WorkbookConnection connection in connections)
    connection.OLEDBConnection.Connection = newConnectionString;
    catch (Exception ex)
    It occurs while assigning the connection string to OLEDBConnection. Need solution for MS Excel 2013 c#.

    Hello,
    this links contains all connection string about Excel:
    https://www.connectionstrings.com/excel/

  • Change Connection Strings?

    Hi everyone,
    When developing a Sinea App, especially in the context of using Office 365 or SharePoint, can we have a method or mechanism to change the data connection without having to remove and re-add the data source.
    While developing the app we might choose to connect to lists and libraries in a Dev site and before we publish the app we would want to change the URLs to point to a production site or server.
    Regards,
    James.

    Hi James,
    Currently for Office 365, this is the only way to swap out sources in the manner you described. The reason is when you add the data source and successfully sign in, we grab key details such as what tenant you are on? What services are available to you? And
    bake those into the connector.
    Therefore, when switching between development and production sites, this information will change and as such we need to query the server for these key details again, and add the connector configured appropriately for this new server. As long as the
    names are the same, most of the rules should be fine, but we definitely understand that there will be some friction.
    As we evolve the product and the oppourtunity arises, this is definitely something we'll consider. Many thanks for the feedback.

  • Trying to change the Release/Debug connection string (ORACLE) of a VS13 Lightswitch project. Getting ORA-00942 error...

    Hello,
    i try to change the connection string of a Lightswitch 2013 project. I have a database for developers and a 'productive' database for releases. Both are similar (table names, entries etc..) and they are from ORACLE. First i attached the developer database
    as an external source. Everything works fine. Now I'm trying to change the connection string  whether my application is in a release state or in a developer state.
    I found a hint in the following question to solve that issue: Question
    from a LS-User 
    It is possible to change the connection string during the runtime. I tried it out and added to my DataBaseService.lsml.cs:
    partial void DataBase_InitializingConnection(DatabaseConnectionState state)
    state.ConnectionString = "DATA SOURCE=DB.productive;PASSWORD=password;PERSIST SECURITY INFO=True;USER ID=USER_PROD";
    Well, Lightswitch is using the new connection. But when i run the application, i am getting the error "ORA-00942: table or view does not exist". The views and tables definitely exist. The two schemas are the same. So what am i doing wrong?
    Regards from Munich

    HI Munich,
    Welcome to Lightswitch forum.
    According to your description above, you want to connect to external datasource in Lightswitch application.
    Oracle is not a supported data source for LightSwitch, it's recommended to use SQL Server database.
    If you want to change the connection string, you can update the connection string for a data source using the data source wizard. For example in VS2013: 
    Please let me know if there is anything that I can do to help.
    Best regards,
    Angie
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create dynamic Connection String in SSIS Package???

    Hi
    I created OLEDB Source Connnection String for that Package,
    i need Create OLEDB Destination Connection String Dynamically,
    Same server name,but i need to add DW at the end of the Database
    ex:
    Source database name is Demo,
    Destination database should come DemoDW.
    i need to create Dynamic Destination Connection String..
    any possible to Create 
    Thanks in advance
    Pandiyan
    pandiyan

    Hi Pandiyanpvp,
    According to your description, the OLEDB Destination Connection String should be dynamically based on the OLEDB Source Connection String. They are all the same, except adding “DW” at the end of the Database of OLEDB Source Connection String in OLEDB Destination
    Connection.
    To achieve this requirement, we can create a variable with the Database name of OLEDB Source Connection String, then use expression to control the OLEDB Source and OLEDB Destination Connection Strings. For more details, please refer to the following steps:
    Create a variable named Source with the Database name of OLEDB Source Connection String as value.
    Click the OLEDB Source Connection Manager to navigate to the Properties window.
    Click “…” next to Expressions to add a ConnectionString Property with the expression like below:
    "Data Source=.;Initial Catalog="+@[User::Source] + ";Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"
    Click the OLEDB Destination Connection Manager to navigate to the Properties window.
    Click “…” next to Expressions to add a ConnectionString Property with the expression like below:
    "Data Source=.;Initial Catalog="+ @[User::Source] + "DB"+";Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • SQL 2000 ODBC CONNECTION STRING FOR SQL 2008

    i have vb 6 application. Database is SQL server 2000.
    my connection string is (using odbc driver),
            .ConnectionString = "Driver={SQL Server};SERVER=" & mServer & ";DATABASE=mydb;UID=" & mLogin.Username & ";pwd=" & mLogin.Password & ";"
    Now i have tried this application with SQL server express 2008 R2
    Can i still keep the old connection string? will there be any problem in future?
    (if i have to change then have to change at so many places.....)
    I can run application without any problem for now (not changed connection string to new one)
    otherwise i have to use ODBC or OLEDB which are,
            .ConnectionString = "Driver={SQL Server Native Client 10.0};SERVER=" & mServer & ";DATABASE=mydb;UID=" & mLogin.Username & ";pwd=" & mLogin.Password & ";"
    or
            .ConnectionString = "Provider=SQLNCLI10;SERVER=" & mServer & ";DATABASE=mydb;UID=" & mLogin.Username & ";pwd=" & mLogin.Password & ";"
    if i have to change to new connection string Which one is better to use odbc or oledb.
    h2007

    personally I favor ODBC as it is easy to use sometime. Additionally you can check the link below:
    http://social.msdn.microsoft.com/Forums/en/sqlintegrationservices/thread/19e0c306-0be4-46b5-b207-0937931d63a7 
    cheers!!!
    Vatsa
    www.objectiveprogramming.com

  • ISQL*PLUS dynamic reports - how to pass connect string in the URL

    When we run dynamic reports thru ISQL*PLUS, does anyone know how
    to pass the connect string info in the URL
    The following is the code from ISQL*PLUS users guide but it
    dosen't show how to pass the connect string
    when I tried to pass hr/your_secret_password@dbserver for userid
    I got an error msg
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <HTML>
    <HEAD>
    <TITLE>iSQL*Plus Dynamic Report</TITLE>
    </HEAD>
    <BODY>
    <H1>iSQL*Plus Report</H1>
    <H2>Query by Employee ID</H2>
    <FORM METHOD=get ACTION="http://host.domain/isqlplus">
    <INPUT TYPE="hidden" NAME="userid"
    VALUE="hr/your_secret_password">
    <INPUT TYPE="hidden" NAME="script"
    VALUE="http://host.domain/employee_id.sql">
    Enter employee identification number: <INPUT TYPE="text"
    NAME="eid" SIZE="10">
    <INPUT TYPE="submit" VALUE="Run Report">
    </FORM>
    </BODY>
    </HTML>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Thanks
    Jay

    The form you use should work when your change
    "hr/your_secret_password" to a valid username, password
    and connect identifier like "hr/hr@MYDB". Don't forget to
    configure MYDB in your tnsnames.ora file on the machine that has
    the iSQL*Plus server.
    What was the error you got?
    The full URL syntax did seem to go missing from the 9.0.1 doc.
    See below for the full syntax. This should be appearing in a
    forthcoming FAQ.
    - CJ
    What syntax can I use to run an iSQL*Plus Dynamic Report?
    You can run a dynamic report by entering the report URI in the
    location field of your browser, or by making the report server a
    link or the action for an HTML form. The iSQL*Plus 9i Release 1
    documentation has examples of these.
    The general syntax for running a dynamic report is:
    {uri}?[userid=logon&]script=location[&param...]
    where uri
    Represents the Uniform Resource Identifier (URI)
    of the iSQL*Plus Server, for example:
    http://host.domain/isqlplus
    where logon
    Represents the log in to the database to which you
    want to connect:
    {username[/password][@connect_identifier]}
    where location
    Represents the URI of the script you want to run.
    The syntax is:
    http://[host.domain/script_name]
    The host serving the script does not have to be
    the same as the machine running the iSQL*Plus server.
    where param
    Specifies the named parameters for the script you
    want to run.
    Named parameters consist of varname=value pairs.
    iSQL*Plus will define the variable varname to equal value prior
    to executing the script e.g.
    ...script=http://server/s1.sql&var1=hello&var2=world
    This is equivalent to the SQL*Plus commands:
    SQL> define var1=hello
    SQL> define var2=world
    SQL> @http://server/s1.sql
    iSQL*Plus, SQL*Plus and SQL keywords are reserved
    and must not be used as the variable names (varname). Note also,
    that since variables are delimited by the ampersand character,
    there is no requirement to enclose space delimited values with
    quotes. However, to embed the ampersand character itself in the
    value, it will be necessary to use quotes.
    For compatibility with older scripts using the &1
    variable syntax, varname may be replaced with the equivalent
    variable position as in:
    ...script=http://server/s1.sql&1=hello&2=world
    Note the & is the URL parameter separator and not
    related to the script's substitution variable syntax.
    Commands and script parameters may be given in any
    order in the dynamic report URI. However, please note that if any
    parameters begin with reserved keywords such as "script" or
    "userid" then it may be interpreted as a command rather than a
    literal parameter.

  • Supply connection string for OracleRoleProvider at runtime

    Hi
    I can not put password in web.config because our systems request passwords at runtime from another system. How can i initialize OracleRoleProvider?
    thank you!

    I found the answer here http://forums.asp.net/p/997608/2209437.aspx
    changing "_sqlConnectionString" to "m_OracleConnectionString" does it.
    var roleField = roleProvider.GetType().GetField("m_OracleConnectionString", BindingFlags.Instance | BindingFlags.NonPublic);
    if (roleField != null)
    roleField.SetValue(roleProvider, connectionString);
    Still it requires a dummy connection string in the web.config.
    +<connectionStrings>+
    +<add name="OraAspNetConString" connectionString="***" providerName="Oracle.DataAccess.Client"/>+
    +</connectionStrings>+
    I wonder is there any simpler solution....?

  • How to specifiy the provider to be Oracle.ManagedDataAccess.Client when creating a dynamic connection string with EF Code First from Database?

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

  • How to dynamically set connection string for report in C# code?

    Hi,
    I have installed CRVS2010. I have created new Crystal Report WPF Application and new report. I would like to set connection string for report in code dynamically.
    Is this possible?
    Thanks
    Ivana

    Lots of posts in this forum on how to set database connections. WPF should not be a consideration as it's just a viewer. The report engine is still the same. Search these forums. Use the search box at the top right corner of this page. Look at samples here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Note that none of the samples above are using WPF, but like I said, the WPF is just a different viewer and will not impact how the report engine logs on to a database. (I think of it as a gray car vs. a red car. Same engine, just the color is different)
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Maybe you are looking for

  • Why is text on Google lists smaller than it is in my Internet Explorer browser?

    I have already solved this problem myself, but don't know how to get rid of my question! In Settings, I opted under Options for a certain size of type, and that solved my problem, and I learned that Control and two plus characters will increase the s

  • Reduce PDF File Size - any ideas?

    Hi all, I have a C++/C# programs that generates PDF's in Adobe Reader using Infragistics.  This is a recent change from using VS View as our old method of illustrating - we now use Infragistics.  This has resulted in our PDF File sizes almost doublin

  • 8800GT and 7300G as second card ?

    I am hoping to get the new 8800gt for the older mac pro but want to keep my second monitor on a 7300gt (I currently have 2 7300 in the computer) ... Can I just pop the fist card out and put the 8800 in and just keep the second 7300 running my second

  • FireAMP agent removal

    Sourcefire newbie here...I have to remove FireAMP agents from computers, but I would like to do this from the FireAMP management console.  I know that if you navigate to Management>Computers and you highlight the computer in question you have the opt

  • Beta Camera Profiles installation problem

    I downloaded Camera Raw 4.5 Plug in, which is needed for the beta Camera Profiles installation. CR 4.5 is definitely in the right place and working fine. According to Adobe FAQ, beta Camera Profiles belong in the Adobe folder in Camera Raw. I copy he