Nested Tokens - Multiple Instances In A String

Jun 22, 2010

I would like to use nested tokens, a similar question was asked in this thread [URL While this did address how to do it with a single instance, I was wondering how to do it with multiple instances in a string. ie.

input to textbox1
"I {love|like} {blue|red|orange|pink} its my {favorite|worst} color "

Press a button and would output a random word in the brackets to textbox2/msgbox similar to. "I like red its my favorite color" or "I love pink its my worst color"

View 2 Replies


ADVERTISEMENT

C# - String Tokens In .NET?

Jun 1, 2010

I am writing a app in .NET which will generate random text based on some input. So if I have text like "I love your {lovely|nice|great} dress" I want to choose randomly from lovely/nice/great and use that in text.

View 4 Replies

Connecting To Multiple SQL Instances?

Jan 3, 2011

Any best method of managing multiple SQL connections .net (VB). My application connects to four instances of SQL Server (2000, 2005, 2008, 2008R2) restoring databases, modifying data and taking backups. In addition to managing databases the app also has its own DB (on the 2008 instance) for storing various data. I'm using two methods to connect to the instances, SMO (For backups, restoring and retrieving information about the databases, size etc) and SqlClient for querying each database for many tasks such as updating fields and executing sql scripts.I have multiple forms for performing various tasks so there are many places I'm opening / closing connections.

Would it be best to maintain a persistent global connection to each instance from the application? (Two in total, one for SMO and the other for SqlClient) or open close a connection for each task I'm performing?) I'm not using LINK as I need the tasks to be as fast as possible. The connection string will differ on each connection (Based on Instance and Database being connected to) how would I manage this? A string in the config file for the applications database would make sense, as that would be static but the databases being worked on will vary with each connection. Currently I'm creating a connection for each instance within the main form:

Dim 2000Connection = New SqlConnection("Data Source=" & SQLServerName & _
"SQL2000;Initial Catalog=Master;User ID=sa;Password=P@ssw0rd;Pooling=True;")
Dim 2005Connection = New SqlConnection("Data Source=" & SQLServerName & _
"SQL2005;Initial Catalog=Master;User ID=sa;Password=P@ssw0rd;Pooling=True;")
Dim 2008Connection = New SqlConnection("Data Source=" & SQLServerName & _
"SQL2008;Initial Catalog=Master;User ID=sa;Password=P@ssw0rd;Pooling=True;")
[Code] .....

View 1 Replies

Multiple Instances Of A Form?

Sep 13, 2010

If I create a console application for example with a class named "Person" I can create an object variable with a ceratin name only once. For example:

Module
Module1
Sub

[Code]....

View 1 Replies

Multiple Instances Of Class?

Mar 29, 2010

I have the following problem. (VB.Net 2008)I have created a class (myFirstClass). In this class there are a lot of calculations being made wich gets fired by events in that same class.Now i want that same class to be able to fire more instances of itself. However i noticed that each time i fire an event from a Sub the program waits till the event is finished before going to the next line of code. This is a problem since i want the event wich fires a new instance of the class to fire it and forget about it.

View 7 Replies

Multiple Instances Of The Same Form?

Mar 3, 2010

I have two forms in my application. Form 1 is a listview that is populated with unique Customer IDs. When the user double click the listview on the particular Customer ID then it loads Form2. Form2 has many listviews within it such as a listview for the Customer telephone, another listview for their addresses etc and all the data presented in Form2 listviews are based on the Customer ID that the user clicked in Form1.

So here is my question...I want the user to be able to open Form2 with that particular details of the customer but also to go back to Form1 and double click another Customer ID and opens Form2 again (such as replicating Form2) with the other Customer details.So the moral of the story is i want the user to be able to have many instances of Form2 open each time they wish to view a different Customer ID without having to close Form2 down every time.

View 3 Replies

VS 2008 X86, X64, PID, Multiple Instances?

Feb 6, 2010

My ultimate goal is to get a list of PIDs and have a user select 1 of them.For example: the process image name is program.exe. The application name varies for each instance the program.exe is run, and therefor each application name has its own PID associated with it. By application name I mean the Task name under the Applications tab of Windows Task Manager. Another issue I face is that some systems run x64, so the name is no longer program.exe but program.exe*32

So my issue is, how do I search for program.exe, or on x64 platforms program.exe*32, and if there are multiple instances of program.exe/program.exe*32 running, how can I get a list of PIDs for each and associated them with the application name as the Task name under the Applications tab of Windows Task Manager.that might sound a bit confusing! So if it is, please let me know and I will try to explain more. Any reference guides or example code would be greatly appriciated as I have only used the "System.Diagnostics" but once.

View 2 Replies

Adding Multiple Instances Of Same Control

Jan 14, 2011

I have a control which consists of a couple of labels and a couple of buttons side by side.I want to add multiple instances of this control to a panel.The problem I have is with positioning/formatting.Whenever I add the control it just gets added on top of the previous one.Should I be using something other then a panel? Are there any tips ot tricks I should be aware of ?

View 3 Replies

Checking For Multiple Instances Of Application?

Aug 30, 2010

How can I check for multiple instances of my visual basic application? When the user runs the application, I want to know how many instances are already open.

View 2 Replies

Communicating Between Multiple Instances Of Application?

Mar 9, 2009

I have an application which the user can open multiple instances on the same machine. However, a section of the app would have sync problems if more than 1 instance has control over it. This is where I thought of transferring control, or sharing, between them. What should I be looking into?

They would have to be able to identify which one of them has control and to send text information over. I thought IPC or Named Pipes could do the trick, but I'm unfamiliar with them and examples seem to indicate only a single server will work. Here, I have multiple instances of the same app and every one of them needs to be able to listen for that request for control.

View 25 Replies

Creating Multiple Instances Of A Form?

Aug 12, 2009

I have a form (form1) and I havea button on form1 (button1) that will start a second form (form2).How can I make it create multiple instances of form2 when button1 is clicked?i tried a process module that the studio comes as standard but it does not allow me to start multiple instances...how can i do this?

View 14 Replies

Hold Multiple Instances(10) Of Alarms?

Jul 20, 2010

I have created an alarm program but am having an issue creating multiple alarms. Here is what I have so far. I have created an array to hold multiple instances(10) of alarms that I want to run concurrently.

Code:
Dim SetAlarms(7, 9) As String
Public Shared x As Integer = AlarmNumb
'X=alarmnumb

[Code]....

What I cannot figure out is how to get the program to read the array and recognize each row as a separate alarm to process. This means it must read the array, know which variables to populate with what information and cycle thru the list.

View 5 Replies

Loading Multiple Instances Of One .dll In .Net 2010?

Sep 22, 2010

I'm working on a program that uses a COM Object exposed by a .dll. The .dll has a known bug, though, where it acts very erratically when more than one instance of the object is created under one .dll, resulting in crashes or corrupted data a large part of the time. I'm curious if there is some way I can load another instance of the .dll itself, then create another instance of the object without having to need a new process for every instance.

View 9 Replies

Multiple Instances Of A Custom Class?

Feb 15, 2009

I have a sub that runs on a button click which I want to create a new instance of a custom class and add it to a list of already created instances of this class. I want the result to be a List Of collection of all of my class instances.

My problem is that each time I run the sub, it simply 'overwrites' the first instance of the class and adds a copy of it to the list instead of writing a new instance. My code is along these lines

dim objFixture as new clsFixture
For n As Integer = 1 To intNoOfChannels
objFixture.SetChannelAddress(n, intCurrentChannelTotal + 1)
intCurrentChannelTotal += 1
next
lstFixtures.Add(objFixture)

View 7 Replies

Multiple Instances Of DCOM Singleton

May 19, 2011

Testing a configuration of a Windows 7 workstation acting as a "server" and a Windows XP workstation acting as a "client" (also fails in the same way using a Windows 7 client workstation).

[Code]...

View 8 Replies

Multiple Instances Of Forms, Same Record?

Jun 22, 2009

Good Day. Kinda banging my head against the wall on this one. I have a Mdi application with the start form(mdiparent) and form1(mdichild). On the start form, there is a textbox and a button. Heres how I want it to work:

1. value is entered into textbox and button is clicked

2. if form1 is open with that value, Bring it to the front if not, create a new instance of form1

If Not IsNothing(frmForm) Then 'If it is something
If Not frmForm.IsDisposed Then 'it's not disposed
'loop through the open form1s and compare the form1s property to the startform textbox
'if its the same, bring the form1 to the front

[code]....

View 3 Replies

Open Multiple Instances Of Same Form?

Jul 6, 2009

I am writing an application whose main purpose will be to collect user-entered data on a prescribed time interval (to be used by a dr. during anesthesia to collect patient vitals during surgery). I am attempting to accomplish this by having a form opened from the main window on every tick of a timer. The problem, is that if the user is a bit slow in entering the data on the first window, and the timer ticks again before they submit the first form, when the form is reopened (currently by simply using a show() command), the process of opening the form again simply overwrites the original form rather than creating a second instance.What is the best way to open a second (and possibly 3rd, 4th... nth) instance of the same form?

View 4 Replies

Prevent Multiple Instances Of A Form?

Jun 22, 2011

I am working on a project where i have a home form which has two buttons for login for employee and administrator.after clicking on button login form will open,but i want as soon as login window opens d previous home form must be closed or hide..also there is link on login page for home,but as soon as user click on home link new instance of home form is opening,hnce i want to stop dis multiple opening of the form.i tried close() and hide() but no use.[code]...

View 2 Replies

Preventing Multiple Instances Of A Form?

Mar 29, 2009

need help please on how to prevent multiple instances of a form at runtime in vb so tha when a user clicks a button to load a form it loads an if the user clicks the same button again whilst the other instance of the form is running it doesnt open a new one but insted sets focus on the currently running form.br2

View 4 Replies

Single Form With Multiple Instances

Aug 12, 2010

I have a form which displays temperature and humidity data for a device in the field. I have multiple devices. Rather than creating a separate form for each device, obviously it is much better to have a single form that I instantiate, pass data to, and display. The devices are listed in a treeview, and when the user double-clicks the node, I create an instance of the form, pass the device's data to the instance of the form, and display the form. All of this works perfectly. However, I have a challenge: If the form for a particular device is already open, I don't want another one opened when the user double-clicks the node.

However, whenever I place logic in the program to check for the existence of the form and only allow another instance to be created if one doesn't already exist, it prevents me from creating a form instance for any other device that I may wish to view, simultaneously. So, I have a dilemma -- allow the user to display the data for multiple devices, including allowing multiple forms to be open for a single device, OR only allowing one device to be displayed at any given time.

View 2 Replies

Update Datatable With Multiple Instances?

Mar 23, 2011

If the application is used with multiple users/instances adding records to the same database, whats the best practice for doing this and not incurring any conflicts with primary keys. Right now my partial solution is to do a tableadapter.fill before adding a new row to retrieve any new records. But this obviously isnt the best practical solution as the likleyhood of a conflict still exists when letting the apllication increment the key.

Whats a "correct" way to do this, any reading or examples would be great for me to learn.

View 2 Replies

Working With Multiple Instances Of The Same Form

Apr 6, 2010

is they a way of keeping track for multiple instances of the same form? example saving the contents of a textbox ,the positition of the form and size when using the code below to create the new instance of the form ,i would like to save the contents of multiple form2`s from form1 ,can it be done??

[Code]...

View 6 Replies

WPF + Communicate Between Multiple Application Instances?

Mar 20, 2010

I need to grab information between two instances of my WPF app (the contents of a public collection, to be precise).

View 2 Replies

Using RegEx To Find String Inside Nested String?

Sep 10, 2011

Using VB.NET, Is there a way to do this RegEx call in 1 step... instead of 2-3? I'm trying to find the word "bingo", or whatever is between the START and END words, but then also inside the inner FISH and CAKES words. My final results should be just "bingo".

Dim s1 As String = "START (random string) FISH bingo CAKES (random string) END"

[Code]...

View 2 Replies

.net - Nested Queries From Multiple Oracle Databases

Jul 21, 2011

In .NET, Is it possible to run a nested query from two separate Oracle databases?

[Code]...

Ultimately, this is an effort to overcome an "ORA-01795" error from using an "in" statement with over 1000 items in the conditional list, without having to break the query out into multiple "OR value IN" lists.

View 3 Replies

Check If Multiple Instances Of An Application Are Running?

Aug 15, 2011

I made a simple "restarter" app... However, I need to close multiple instances of an application. For example, if I have three windows of paint, or three windows of Word open, how do I check if it is still open before I open a new instance?

[Code]...

View 1 Replies

Creating Multiple Form Instances In A Subroutine?

Aug 23, 2010

I am trying to create a subroutine that creates multiple instances of a specific form.

Here is my code:Public Sub NewFormInstance(ByVal FormName As Form)

Dim FormInstance As New FormName
FormName.Show()
End Sub

View 3 Replies

Custom Setting To Save Multiple Instances

Dec 28, 2011

I have this code for custom settings:

Code:
Imports System.Configuration
Public Class setLV
Inherits ApplicationSettingsBase
Private fpListViewItems As List(Of ListViewItem)
ReadOnly Property ListViewItems() As List(Of ListViewItem)
[Code] .....

It works great for saving one Listview and its items but I need to save multiple Listviews and their items. I have no idea how to accomplish this.

View 3 Replies

Keeping Multiple Form Instances Separate?

Sep 16, 2009

When I create more than one instance of the same form and I call a method on any of these instances, the code only fires on the most recently created instance. Even when I click a button on that form, it executes on the other form. How can I call these and keep them as distinct objects?

For example: if I build Form1 with a public method called ChangeMyColor and a button to call that method. Then in the main app I set MyForm1 = New Form1
and MyForm2 = New Form1, then call MyForm1.ChangeMyColor, the color changes on the second instance. Even if I click that button on the first instance, the color still changes on the second.

View 8 Replies

Multiple FileStream Instances To Access 1 File?

Jun 22, 2011

I have written some simple codes which are using FileStream to read a big .zip file.My codes ran fine as expected until I tested to create multiple threads to access that particular same .zip file at the same time.

The error that I've got was > The process cannot access the file 'D: est.zip' because it is being used by another process.Is it possible to read 1 particular file by multiple FileStream instances at the same time?

[Code]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved