Is There Function Takes Name Of Instance And Return Instance

Feb 29, 2012

I was trying to fill 10 checkedlistboxes with items..So I made a sub with 2 arguments like this Private Sub fill_checkedlistboxes(ByVal items As String, ByVal checkedlistbox As CheckedListBox) End sub the first argument items is a long string whitch splits in the sub into many strings and added them all into the second arguments (thecheckedlistbox) I want to make for next statement to fill all the 10 checkedlistboxes in my form with an 10 long strings held in an array called strings, so i write something like this [code] What i have to write in the "?????" area to have the checkedlistbox that i want? the checkedlistboxes names are checkedlistbox 1, 2 , 3 ....10

View 12 Replies


ADVERTISEMENT

Invoke An Instance Function Delegate On An Instance Of A Generic Type?

Aug 4, 2010

D is a dictionary whose entry values are of Type T..What I'm attempting to do is have a delegate like "Serializer" below that I can invoke on an instance of T, such as "Entry.Value" below.Please see the "return Entry..." line below for my wishful thinking.[code]

View 2 Replies

Open A New Instance Of IE and Direct It To A Web Page When A User Takes A Specific Action?

Jul 20, 2010

I need to open a new instance of IE and direct it to a web page when a user takes a specific action.Used are random so setting anything on their machine is not an option.This works great on my local machine in developent but when deployed to my server it fails with no error.I must be missing a permission or something simple understanding that on the server things are run under the ASPNET account.My code is in a code class, myCode.We are in VS 2008 and IIS 6.Tried a couple of different things, they all fail silently.

Imports System.Diagnostics
Imports System.ComponentModel
Dim sWebPath as Sting = "https://mySecure.com/Page.htm"[code].....

View 7 Replies

.net - Save System.Collections.Specialized.NameValueCollection Instance To Hard Disk And Load It Back As An Instance?

Jun 24, 2011

I have following instance of System.Collections.Specialized.NameValueCollection:

Dim UserSelection As New System.Collections.Specialized.NameValueCollection
UserSelection.Add("D_Color1", "Black")
UserSelection.Add("D_Color2", "Green")
UserSelection.Add("D_Color3", "Purple")

I need to save this instance to hard disk and then load it back from hard disk as an instance. How do I do that?

View 2 Replies

Make A Single Instance App And Showing The MainWindow When Another Instance Is Launched In .NET With WPF?

Aug 30, 2011

I am looking for a way to make my app running in a single instance mode and showing the MainWindow of the first instance when another instance is launched.I do a quick search on the internet but I did'nt find anything to open the MainWindow of the first instance or it was for Windows Form not for WPF.

View 1 Replies

Return Instance Of Microsoft Word?

Oct 5, 2011

Is am doing a lot of word manipulation and may have several instances of word open (some without documents). I wanted to close any extra instances and return an object to any other instance that was open [code]...

View 2 Replies

Transfer Control To The New Instance In A Single Instance Application?

Jul 15, 2011

I have a single instance VB 2010 application I know how to communicate with the next instances run through the StartupNextInstance application event. The usual way of working with this is parsing command line arguments of the new instance and continue execution of the old instance. What I would like to do is replace the running instance with the new one. Is there any way to do this other than disabling the single instance property ?

View 1 Replies

Purpose Of Using Shared Methods That Return An Instance Of A Class?

Oct 11, 2010

What is the purpose of using shared methods that return an instance of a class, as opposed to a constructor?

ie: in VB.net, the system.drawing.color class has shared method "FromArgb(int, int, int) as color". This is different from java's implementation which simply is a constructor that takes three ints. Why the decision to do one or the other?

View 1 Replies

Getting The Local Instance Of SQL Server Rather Than A Named Instance

Jul 29, 2010

A while ago, I wrote a web-based guestbook application that wrote it's own database.

My code was very amateurish, but, as it was my very first publication, I was very happy with it. Only about a month after I'd published it did I realize I'd made a huge mistake in the code.

I've only ever connected to a specific named instance of SQL Server, and it occurred to me that, if the SQL Server instance has a different name than the one I specified, it wouldn't work.

So, since my users will probably not know what the name of the instance of SQL Server that's running is, I thought adding a field where the user can specify it would help if they do, but what if they don't? My answer was to get the local instance, regardless of name.

I tried Data Source=.local;, Data Source=.; and other variants, but nothing worked.

View 2 Replies

Selecting Data From One Sql Instance An Inserting Into Another Sql Instance?

Sep 1, 2011

I have no problem doing a select statement from a database and displaying it.An I have no problem inserting data into a sql database table. However with this issue I have to grab the data an insert it into a totally different SQL 2005 instance.

View 8 Replies

Class Function Without Instance?

Mar 24, 2012

I have a Class, which I create an instance of in order to use, however I have a couple of functions (which don't really relate to the instance data) which I want to use when an instance hasn't been created.

Visual Basic .NET (2010)

Example of what I'm trying to do:

' Log a user into the system (this works)
Dim hedwig As New CustomSecurity
hedwig.Login("username", "password")

[Code].....

View 3 Replies

Datatable Getdata Performance - In-line Table Valued Function In SSMS Takes About 6 Seconds To Return 11088 Records?

Mar 25, 2011

An in-line table valued function in SSMS takes about 6 seconds to return 11088 records. The same function in VB .Net 4.0 using TableAdapters.InputTableAdapter.GetData (Created with data set designer) takes about 15 minutes complete.Both are executed from the same workstation.Why does this discrepancy exist?

Workstation:

Windows XP SP3, 2GB

VS2010 Ultimate

.Net 4.0 Framework

Server:

SQL Server 2008

View 3 Replies

Creating Single Instance Form In MDI Application - Check Whether Form's Instance Created Or Not?

Feb 8, 2012

creating single instance form in MDI Application. How to check whether form's instance created or not?

View 6 Replies

Split Function; Discard All Data Before The Last Instance Of A Delimiter?

Nov 29, 2010

Okay so what I'm trying to do is get the filename from OpenFileDialog/SaveFileDialog, only without the full path, and dump said filename into a variable so I can use it for other things.

Using the Split function, I can get any part of the array between the delimiters (""), but what I'm trying to do is get all the information after the LAST delimiter in the string.

View 2 Replies

Sql Server - Access A Shared Function From An Instance Of An Object?

Dec 28, 2010

The context of this question is that I am trying to debug performance issues (apart from the obvious ones I already know about and can find).I inherited a code base (VB.NET) for an ASP.NET app. This is an app that was developed way back in .NET 1.1 days, and was the first .NET app for a lot of the developers who worked on it.

In this code base is a class called DatabaseUtility that contains several Shared Public methods as well as non-Shared Public Functions and Subs for CRUD operations to the database (SQL Server).

It is common in my "BL" that a method creates an instance of the DatabaseUtility which essentially figures out what the connection string should be and opens a connection, as well as giving the developer a handle to the other methods contained within it.Dim utility as New DatabaseUtility()

Once I have that, I start to create parameters that I am going to pass to one of the methods in DatabaseUtility (like GetDataSet). There is a Shared method in my DatabaseUtility called CreateParameter which does essentially that. It creates a SqlParameter object so I can add it to a Parameters collection.

Now, the code base is littered with a lot of this:

utility.CreateParameter(...)However, because CreateParameter is a Shared method, I am not sure what is going on behind the scenes. I know because it is a Shared member that an instance of the DatabaseUtility is not created when I call it like this:DatabaseUtility.CreateParameter(...)

However, because I am calling it from an instance (utility), does that change the behavior at all?

View 1 Replies

Return To Already Open Application When User Tries To Open A New Instance If Same Version?

Nov 27, 2011

I want to open up an existing instance if my program is already running only if its running the same version.I noticed that this question was asked for only if the name exists, but what if the version is older, I just want to notify the user that an older version is still running, "please remove older version before starting this version."The other link is this one:Return to an already open application when a user tries to open a new instance but they don't talk about closing an instance if an older or newer version is detected.

View 3 Replies

Instance Of IE And Be Able To Populate Instance Of IE?

Sep 2, 2009

Currently I am useing the following code which I found on these forums. I get pretty good use of it. I would like to be able to open my own instance of IE and populate it. I am trying not to populate any other minstances of IE that may already be open.

[Code]...

View 1 Replies

C# - Return To An Already Open App When A User Tries To Open A New Instance If Same Version?

Nov 28, 2011

I want to open up an existing instance if my program is already running only if its running the same version. I noticed that this question was asked for only the the name exists, but what if the version is older, I just want to notify the user that an older version is still running, please remove older version before starting this version. The other link is this one: Return to an already open application when a user tries to open a new instance but they don't talk about closing an instance if an older or newer version is detected.

View 1 Replies

Get "Object Reference Not Set To An Instance Of An Object" Error When Trying To Find An Instance In A String?

Jan 23, 2009

I am using the IndexOf function of the string class to find a specific instance of a string. And based on that I have a logic to do something. Below is the example of what I am doing. The code is in production and is working fine. But for some instance I am getting an "Object reference not set error". Yeah its intermittent.The requestXML is a string of xml data passed in as a paramter to a subroutine. I am fetching the xml string as a form post in a request object. The only thing I could think of getting this kind of error is when the requestXML string varia

requestXml = Request("requestXML")
SubmitRequest(requestXml)
Private
Sub SubmitRequest(ByVal requestXml

[code]....

View 5 Replies

Object Reference Not Set To An Instance Of An Object When Calling A Function

Jun 13, 2012

I call the function GetDataTable and when it gets to the return line, I get the error message: Object reference not set to an instance of an object.

Dim DB As New DBConn
Dim gd As New DataAccess.GetData
Dim DT As New DataTable

[Code].....

Updated. I'll see if I can update with the DataAccess.GetData code. I didn't originally put it in there because our shop use it all the time and have no issues with it.

View 1 Replies

Get The Instance Name Into One Combo And The Databases On That Instance Into The Other Combo?

Feb 15, 2012

I have two combo boxes and I am currently using MicroSoft SQL Server to get the instance name into one combo and the databases on that instance into the other combo. I am wanting to switch to System.Data to get these values and I am able to get the instance through enumeration but am having trouble finding where to get the database name values assigned to that instance.Does anyone know the equivalent of SMO Server.databasename is in System.Data?

View 5 Replies

Calculation Function - Takes The Average (which Is Calculated By A Different Function)

May 24, 2011

To have a function that takes the average (which is calculated by a different function) say for example the average is 6, now the function is to take the number 6 and get the variance from six to another number lets say its 12 so this will return a calculation of 50% variance. now here comes the issue, i have it calculating the variance how ever lets say that there is a score that is 0, how can i make it calculate the variance without taking count for that 0? i guess you can say i need it to "skip" if its a 0.

View 5 Replies

Function That Takes A String As A Parameter?

Jan 1, 2012

I have a function that takes a String as a parameter And in it I have variables, so if I call it it's like

Dim Text As String = MyStringConverter("Hello Mr. " & Name & " " & Surname "!")

View 4 Replies

.net - Function That Takes Other Functions As A Parameter And Executes Them

Apr 29, 2010

Is there a way in vb.net to create a sub/function that will take as an argument some kind of pointer to another function, and allow this new sub/function to execute the passed function? What I have are 10-12 xml-rpc functions I am calling against a remote server. Each of these functions has different argument lists (one takes 1 string, another might take 3 strings and one int, etc). All of them return an object.

[Code]...

View 4 Replies

Sql - Function Takes Long Time For Execution?

Jun 13, 2012

Actually, I am trying to find out whether the partno is existing in the database table or not and it takes long time in count = checkCommand.ExecuteReader statement

Public Function CheckProductNo(ByVal Partno As String) As Boolean
Dim count As SqlDataReader
Dim valid As Boolean = False
Using connection As New SqlConnection

[code]....

View 4 Replies

Build A Function That Takes The Exact Parameters Of CType?

Nov 2, 2009

what exactly is the type of the second argument of CType

CType(testobject, Control)

what exactly is Control? how can Control be used as though it is an expression?i nid to know this because i'm trying to build a function that takes the exact parameters of CType, let's call it CType2public function CType2 (byref object as Object, byval thetype as Type) as Object problem is when i do this: CType2(testobject, Control) they give me "Control is a type and cannot be used as an expression".

View 6 Replies

Function That Takes ByRef Parameters Using Control.Invoke ?

Nov 10, 2005

I'm currently invoking a function that takes ByRef parameters using Control.Invoke (which I notice specifies the Object parameter array to be ByVal) but the array of parameters I give it isn't updated by the function. Is this possible with VB.Net 2003 or must there be some error in my code?

View 5 Replies

Is Write A Function Procedure That Takes An Array Of Strings

May 9, 2010

I'm a beginner and doing a review for my final...the question is-Write a Function procedure that takes an array of Strings, sorts it using Shell sort and returns the sorted array. I do not get shell sort at all.

View 3 Replies

Make A Function Which Takes A Number Then Does An Operation To It Again And Again Until It Gets A Vlue?

Apr 26, 2009

This is probably a stupid question, but how do you make a function which takes a number then does an operation to it again and again until it gets a vlue which it already has seen, when it returns all of its values? I have this function:

Private Function fractal(d as string) As double
Fractal = Val(D) * (Val(D) - 1)
Fractal = FormatNumber (Fractal, 2)

[code].....

View 4 Replies

Create A New Instance In MEF

Aug 29, 2011

I am using MEF for Plug-in, I made one class PluginManager which has propety<ImportMany()>Public Property Plugins() As Lazy(Of IPlugin, IPluginExport)() Now want to create a new instance of when i query from plugins, I have already set PartCreationpolicy as Nonshared, but still its not working.

View 1 Replies







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