How to build a connection string if "Only variable names (i.e.: $variable) may be used as the target of an assignment statement."

im looping through databases on a server & building  a connection string to each database.
$SQLConn.ConnectionString = "Server=$SrvName; Database=$DBName; User ID =DBLogin; Password=myPassword;"
The problem is i get this error:
Only variable names (i.e.: $variable) may be used as the target of an assignment statement
I can put the code into an Inlinescript, but then I lose the ability to perform paralellism. Is there any way to construct the connection string in PS Workflow without using an Inlinescript?

Hi Winston,
Why not just wrap the InlineScript blocks in a Parallel block, to cause them to execute in parallel?
For example:
workflow foo {
parallel {
inlinescript {
start-sleep -Seconds (Get-Random -Minimum 1 -maximum 5)
"a"
inlinescript {
start-sleep -Seconds (Get-Random -Minimum 1 -maximum 5)
"b"
Sometimes outputs "a b" and sometimes outputs "b a"

Similar Messages

  • 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

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Why every time i connect my iphone to my computer said: this iphone cannot be used because the apple mobile device service is not started

    why every time i connect my iphone to my computer said: this iphone cannot be used because the apple mobile device service is not started

    I'd start with the following document with that one:
    iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows

  • HT1349 How do I set up a speed dial on my iPhone 4s?  I am used to the bberry where I just keep my finger on a number in order to dial. This is very useful in the car.  How do I get the same effect on iPhone?

    How do I set up a speed dial on my iPhone 4s?  I am used to the bberry where I just keep my finger on a number in order to dial. This is very useful in the car.  How do I get the same effect on iPhone?

    I found a post from Alope that told me exactly how to fix it.
    Go to:
    Settings   - General   - Restrictions    -    put your pass code in   -     Facetime      -  turn the switch to ON
    Worked perfectly to stop the message that said, Not authorized to do that!

  • How may I use directly the numerical when caps lock is on?

    How may I use directly the numerical when caps lock is on?

    I don't understand?  Having caps lock on still allows you to type numbers.  Perhaps you mean something else?

  • How to build dynamic query strings in the query using DB adapter 'Pure SQL'

    Dear Forum,
    I am building an application which will access DB to fetch some result set. The query involves retrieving data from multiple tables(nearly 10 tables). So I have created a DB adapter using 'execute pure sql' option. With this query works fine, but my inputs parameters will vary. So I need to make my query dynamic to append the query strings at runtime depending on the inputs.
    For example I have 3 input variables - input1,input2 and input3 (in my request xsd) which are used in the pure sql query. Now if I get a 4th input parameter input4 in the request, I need to append this to query string as 'AND input4=[some value]' at runtime. Otherwise my query should have only 3 parameters. Please suggest how this can be achieved.
    Regards,
    Satya.

    This is a strange requirement, depending on the columns you have and what are optional in them, one way is to have separate operations and each opeartion will have different inputs and for each operation , a different DB Adapter is called. But this way, it results in more number of operations for the service as well as more number of references in the composite. Even if you pass the column inputs to the SQL procedure, it will result in a large number of if-else cases..
    Thanks,
    N

  • How should load sensitive connection strings

    ok so when i need to connect a swf to some sort of data
    source on the server be it XML, a .NET DLL, a CFC or what ever so
    that i can load data from a database or what ever, everyone is
    always saying that i shouldn't hard code the connection string into
    my actionscript as anyone can get it and do malicious things with
    it.
    So how should i load the connection string into flash. if i
    put them on the server in an XML file or somthing like that then i
    still need to put a connection string into the actionscript in
    order to load in my main connection strings into the actionscript.
    Basically i need to know how to load an external string into
    a swf without anyone else being able to get hold of that string for
    them selves.
    i realy need help with this because i am developing an app
    for somone and i need it to connect to a database and i need it to
    be secure. i have everything sorted except making the connection
    string to the database unstealable.

    Hi
    1. The "GLOBAL.ASA" in ASP3 become "GLOBAL.ASAX" on ASP.Net and it is not the equivalent of web.config. ASP3 do not have an equivalent as this is dynamic tech and By default there is no precompile/compile action as in Dot.Net
     2. You can just move a text file which include the connection string outside the site's folder as we used to do 15 years ago when we used Microsoft Access as a database (When we need small database, before the SQL EXPRESS). This way there is no direct
    URL to get to file!
    * There are several option of restrict the use of a file in ASP3 and in the IIS configuration. check if this is what you want (restrict the use of a specific file/folder) 
    3. robot.txt is only for searching engine which keep "nice behavior". it do not stop any application including search engine from getting the file.
    Have fun :-)
    [Personal Site] [Blog] [Facebook]

  • 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]

  • How to create SQL Connections String using JSP

    Hi, Dear I wrote sample Jsp program(Create a table and Inserted to Table) using SQLConnection
    I got this Error, how to rectify please help me?
    This is my Connection String
    <%
    String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
         Class.forName(driver).newInstance();
         Connection con=null;
         ResultSet rst=null;
         Statement stmt=null;
         try
              String url=java.sql.DriverManager.getConnection("jdbc:sqlserver://10.1.5.6:1433;Database=manickaraj;User=sa; Password=test*");
              con=DriverManager.getConnection(url);
              stmt=con.createStatement();
         catch(Exception e)
    System.out.println(e.getMessage());
         if(request.getParameter("action") != null)
              String CategoryName=request.getParameter("Category1");
              String Description=request.getParameter("Description1");
    String Status=request.getParameter("Status1");
              stmt.executeUpdate("insert into Category(CategoryName,Description) values('"+CategoryName+"','"+Description+"','"+Status+"')");
              rst=stmt.executeQuery("select * from Category");
    %>
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 5 in the jsp file: /CategoryAction.jsp
    Generated servlet error:
    C:\Documents and Settings\manickaraj\.netbeans\5.5\apache-tomcat-5.5.17_base\work\Catalina\localhost\SampleJsp\org\apache\jsp\CategoryAction_jsp.java:61: incompatible types
    found : java.sql.Connection
    required: java.lang.String
    An error occurred at line: 5 in the jsp file: /CategoryAction.jsp
    Generated servlet error:
              String url=java.sql.DriverManager.getConnection("jdbc:sqlserver://10.1.2.4:1433;Database=manickaraj;User=sa; Password=test*");
              ^
    1 error
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

    package shop;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    public class DAClass {
         private static Connection conn;
         private static ResultSet rs;
         private static PreparedStatement ps;
         public static void connect(String dsn, String un, String pwd) {
              try {
                   //access or Mysql odbc connectivity
                   //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   //conn=DriverManager.getConnection("jdbc:odbc:"+dsn,un,pwd);
                   //mysql
                   //Class.forName("com.mysql.jdbc.Driver");
                   //conn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/eshop?user=root&password=root");
                InitialContext ctx = new InitialContext();
         DataSource ds = (DataSource) ctx.lookup("jdbc/eshop");
          conn = ds.getConnection();
         //DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/MySQLDB")
              catch(Exception e) {
                   //return "not soory";
         public static boolean chkPwd(String un, String pwd) {
              try {
                   boolean b=false;
                   ps=conn.prepareStatement("select * from cust_info where cust_name=? and cust_pwd=?");               
                   ps.setString(1,un);
                   ps.setString(2,pwd);
                   rs=ps.executeQuery();
                   while(rs.next()) {
                        b=true;
                   return b;
              catch(Exception e) {
                   return false;
    }changed the code like this other part is same.implemented connection pooling but still its too lazy loding can you guide me?

  • When i connect to my pc, getting this message-this iphone cannot be used because the apple mobile device service not started.why

    i replaced my apple iphone4,Because that having some technical problems.but when i get new iphone4 that does't have the previous contents that is my contacts,purchased items etc...,but the backup cd is in my hand and also my itunes having the whole content but the device is connecting to my pc,getting this message that is THIS IPHONE  CANNOT BE USED BECAUSE THE APPLE MOBILE DEVICE SERVICE NOT STARTED.
    Please give me a solution
    thank you

    Try the information in this Apple Support Document. http://support.apple.com/kb/ts1567

  • How to pass dynamically generated string value as array name in TestStand?

    Hi All,
              I have a string variable which holds an array name as its value. The string value is a dynamically generated one. Now my problem is how to retrieve the values within the array where as the array name is stored in a string variable.
    for eg:
    fileglobals.InfoName = "Array_Name" --> fileglobals.InfoName is a string variable, Array_Name is the array name generated dynamically and it is known only at run-time.
    Array_Name[0] = "a";
    Array_Name[1] = "b";
    Array_Name[2] = "c";
    In the above case, I have to retrieve the values of a, b and c
    Any help is greatly appreciated
    Thanks
    Arun Prasath E G

    Hi,
    Looking at your sequencefile.
    You seem to be trying to save into FlieGlobals.InfoName a string with the values of "FileGlobals.Info_0".."FileGlobals.Info_n" where n is the value of Parameter.TestSocket.Index.
    Then you are setting the value into FileGlobals.TempName from "StationGlobals.FileGlobals.Info_0" assuming Parameter.TestSocket.Index is 0.
    Is this correct?
    I realise this is a cutdown sequence file but you must make sure These variable actually exist in either FileGlobals or StationGlobals. Also with FileGlobals each SequenceFile has its own FileGlobals unless you have set the properties of the SequencFile to use a common FileGlobals.
    What was the precise error you was seeing as it will properly telling you what variable of property it can't find.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How do I print in black ink only and when I want color I can turn on the feature?

    Hi everyone,
    I finally got the HP Envy 5530 to work..hooray!  OK, just a follow-up how do I have my documents print without the color component.
    Now I don't mind the color, its pretty, but I just want the standard, old black and white so that I can save the color when absolutely needed. 
    How do I just print in standard black for homework notes, and when I want color how do I activate this feature.  
    Is their a way to turn off the colored ink? 
    How do print in the black ink as cheaply as possiable so the quality isn't fantastic but good enough.
    Thanks.
    Franklin

    Hi,
    Me again, to set print Black only as default, please try:
    Double click printer ison on desktop,
    Click Set Preferences,
    Click Advanced Settings,
    In Grayscale pull down window, select Black Ink Only
    Click Apply then Ok
    After that, you can print colors for each job BUT you have to select color to overwrite the default (default will stay until you reset it). Please note: printer still consumes color inks during warming up process.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to insert data into a table only when data has changed its value (when compared to the previous inserted value)

    I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
    If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
    What is the best way to do it without increasing overheads?

    This view works:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable i
    INNER
    JOIN mytable
    d
    ON
    d.IDNO
    = i.IDNO-1
    WHERE
    i.[Level]
    <> d.[Level]
    on this mytable below.  A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable).  mytable below
    should give 3 lines. The IDNO is an identity column.
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916

  • How to build Form or Report on different table name

    Hi,
    I want to know, is it possible to query data from a different tables with same structure.
    For example:
    I have tables tableA, tableB ....
    What I want is to select table name from combo box and
    after that to query data for the chosen table.
    So is it possible anyway to build a form or report without knowing the table name during the design ?
    Thanks

    Hello Boris,
    The way you can make this work is like this:
    You need to create a view (say vw_2Tables)whose source is like
    select "table_A" tableName, col1,col2,... from table_A
    union
    select "table_B" tableName, col1,col2,... from table_B
    Then create the Report based on this view:
    select tableName, col1, col2
    from vw_2tables
    where tableName = :P_tablename;
    This will make the Portal create a bind parameter for you.
    Create an LOV whose Select statement is
    select "table_A" tableName from dual
    union
    select "table_B" tableName from dual
    And add this LOV to the bind parameter source in Report
    (in Customization Tab).
    You need to run this Report in customize mode
    (if your report name is say Rep_1
    then this will be http://...../Rep_1.show_parm)
    Hope this helps
    Madhav

Maybe you are looking for

  • Java applet and Linux RedHat7.1 kernel  2.4.2-2

    Hello. I have really interesting problem... I am trying to run java applet in different env.: #1. windows2000, sun java1.3.1, webstart 1.0.1; #2. linux RedHat 7.1 kernel 2.4.2-2, sun java1.3.1, webstart 1.0.1; #3. linux RedHat 7.0, kernel 2.2.16-22,

  • Nokia n80 theme help?

    When I change my theme and edit it, I select a user defined wallpaper. When I turn phone off/on it goes to default theme?????? phone's owned nokia orange, nok 5.1, ericsson er500, nok702, nok8310e,ericsson t68/t68i nok6210e nok3330, nok6100, nok6230,

  • Flash plugin crashes always for FarmVille, CityVille now, submission fails

    The Flash plug in crashes immediately whenever FarmVille or CityVille by Zynga loads now. When I try to send a report, the submission fails. When I try to change settings, the Flash plug in crashes as well, never allowing me to change anything. I nee

  • HP scanner showing read only from Mac after software upgrade to OSX 10.9.1

    I recently updated my IMAC software to OSX 10.9.1 and I am unable to scan and sent material from my HP Photosmart scanner. It says it is "read only". How can I change so that I can scan and email documents?

  • Ipod shows charge icon but not recongnized by the computer

    i want to restore my ipod mini, but the ipod updater wont recongnize it, it doesnt show up to be erased, and i cant even turn it on, displays a sad icon. please help, i need help asap