VS 2005 Pass My.Settings Object To A Sub?

Dec 17, 2009

I have a sub that I want to receive a My.Settings object. I don't know, though, which kind of object to use in the declare line of the sub. For example:[code]

View 3 Replies


ADVERTISEMENT

Application.Settings VB 2005 - Save Arrays Using The Settings System Object

Jan 14, 2009

I just wondered if you can or can't save arrays using the settings system object. There seems to be no way of entering it at designtime. It seems implied you cannot create new user settings.subobjects at runtime. I'm looking to find the easiest way to save a populated array of PictureBox's. If the only way is a self/custom made/managed .ini file then I need to know so i can start on that but I was hoping to use some of all this phaff in the new frameworks usefully.

View 3 Replies

[2005] Pass Excel.Application Object To Shared-Addin By .Net?

Jan 22, 2009

I currently need to build a Automation Add-in for Excel. This add-in will load a recordset from Database to Excel. I would like to have function A() that I input in Cell as a formular. This function A() call a the add-in to load the data from Database to Excel. The data should be a matrix. So that means I would like to set in Excel worksheet a range of data by just calling single function in a cell. (I am sure there should be some way to implement it)As I know if I develop a shared Add-in by VB(or VB.Net) and in the add-in, I can get an Object of Excel.Application. By this Excel.Application object, I can get full control of Excel inside the Add-in. That means if I define a sub that load datamatrix from database and using the Excel.Application object I can populate the data matrix to the Excel.

I have done much research on internet and I now have built a shared Add-in for excel. I should say this add-in works fine without invoke the Excel.Application Object that I have tested. But when I call the Add-in function that invode Excel.Application Object from Excel I got an error as below:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Run-time error '2147467262'(*)
Unable to cast object of type 'System.String' to type Excel.Application

[code]....

View 2 Replies

VS 2005 Update Table - If All Results Is PASS Then The Table2 Should Be Updated As Pass

Jun 8, 2012

I have two tables:

table1

case_no flow result
tc_1 001 pass
tc_1 002 pass
tc_1 003 pass
tc_2 001 pass
tc_2 002 fail
tc_2 003 pass


table2"

case_no result
tc_1 pass
tc_2 fail

Table2 should be updates from table based on the results... If all results is PASS then the table2 should be updated as pass... if any result is FAIL then the entire case_no should be updates a s fail..

View 7 Replies

VS 2008 - Error With Arraylist In My.Settings - Object Reference Not Set To An Instance Of An Object

Mar 14, 2010

The issue is when I try to add a new item to the ArrayList with the following code, it gives me an error:

vb Private Sub btnLabelAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLabelAdd.Click
Dim result As String = InputBox("New Filter Label:", "Label List")

[CODE]................

Object reference not set to an instance of an object.

I'm not really sure what I'm supposed to be doing with this. It's a new setting I just added and it's empty, so I'm not sure if that has anything to do with it or not. Anyone know what's going on and what needs to be done to get it to accept a value and not want to be "initialized"?

View 9 Replies

Function - Pass Object Versus Reference Object In Parent?

Dec 1, 2011

I am working on a application that has quite a few functions involved and have been thinking of the following: If I have a function that has a few paramaters, is it more efficient to pass the objects to the function(Example 1) or reference the objects in the parent(Example 2)? Does it matter if the objects are large or not?

Example:

Class mainform
Public myGenericList As New List(Of String)
Public myDatarowArray() As DataRow

[Code].....

View 6 Replies

How To Pass Object As Sub

Jan 20, 2012

This code copose from Class including tow sub first sub to insert data in DB Ms access- second code: to check if there is same number of Tel if there is not same number will excute the first code insert, if there is same number of Tel it will show messagebox the problem that I faced is by how to pass object(InsertData) from CheckN sub. It showed me error : Expression is not a method

[Code3]...

View 1 Replies

VS 2005 To Pass Or Not To Pass?

Apr 16, 2009

I am looking for some input. I am helping with a web application that is fairly large. We have some logic factored out into classes, not a true business logic layer (yet ). The classes are setup to pull values directly from the QueryString or Session variables and I'm not sure that that mehtod is proper or even a

The reason I would like some input is, there may be a chance to rewrite or at least refactor the code.

[Code]...

View 2 Replies

My.settings Complex Object Is Nothing

Mar 26, 2010

I'm trying to save some settings in a complex object. If I make a dll of the class I can then add it in the projects properties settings list as that type.When the program runs though it won't show up as anything other than nothing. I read you have to have a sub new empty constructor which I have but don't know why else this would fail.First question is how to you do this. Second is there anyway to use a class inside the project as the target of the settings type or do you have to bring a in an external dll to do this every time? [code]

View 4 Replies

How To Get Name Of Object And Pass Parameters

Jan 31, 2012

For example if I have a function call like below
Function callingMe()
Exit Function

And my Function call is like below
SomeObj.callingMe('1','2','3','4','5') // Variable number of arguments
Inside callingMe() function, I want to know arguments passed i.e 1,2,3,4,5 and the Object i.e SomeObj in above case.

View 2 Replies

Make An Object Not Pass Through Another?

Apr 5, 2012

I am making a simple maze game that you use the arrows keys to navigate. I completed the movement part of it, but now i'm having trouble with the walls. How can you make an object not pass through another and how to tell the program what to do when a object gets to a defined place(the finish)

View 4 Replies

Object Must Pass Itself As A Parameter?

Sep 10, 2011

I have various shape objects, and I want each unique shape to implement a saveToDB method that simply calls a DB object that implements a Save method with an object as its input paramter. This DB.Save method will be a long case function that implements the proper SQL commands based on the type of attributes possessed by the input parameter object.how do I implement the SaveToDB method in my Shape class? Is it something like this:

Function Shape.SaveToDB
DB.Save(Me)
End Function

The goal here is to let each shape save itself without it knowing anything about database operations; I want to isolate db-specific information in my intermediary DB object, so the DB object will have to figure out what type of object wants to be saved into the SQL database and then execute whatever SQL instructions are needed. And then if I override the SaveToDB method in each shape subclass, I can avoid the case statement entirely, replacing it with a series of unique methods such as db.SaveCircle (ob), db.SaveSquare (ob), etc., sincle the caller already knows what it is.

View 4 Replies

Pass A Function As An Object Instead Of It?

Dec 20, 2011

I'm trying to give a default value to the register property method. This required a function, but passed as an object(delegate?).[code]....

I want to call that registerproperty method, but I don't know how I can do that in VB.net. I just need to pass along a new Person object and I thought this was the way to go[code]....

View 3 Replies

Pass Data Out Of An Object?

Dec 17, 2010

I have this [code]...

1. Create a global SQL instance and call .Write from within .ReadData

2. Create a new SQL instance within .ReadData and call .Write

3. Pass the data back to the code above and call .Write from the main code i.e. [code]...

View 1 Replies

Pass Object Between Asp.net Applications?

Jan 6, 2012

We have a few applications that will be passing a token object around and I wanted to get an idea about the best approach at doing this.

For starters, this token object is somewhat simple. It would have about 5 properties or so.

Would we create a WCF app and reference it through a datacontract?What about serializing it and sending it through an http post? (each app have a referenced dll of the object)Querystring? (I truly don't think this would be good, but put it up nonetheless)?

View 2 Replies

Pass Out An Object Array In .NET?

Mar 25, 2011

I'm writing a wrapper class to expose a subset of the functionality of a .NET FTP library edtftpne from Enterprise Distributed Technologies.

When you call the edtftp's GetFileInfos method you get an array of FTPFile objects returned. I'm able to iterate through these but I don't know how to pass them on as a new and different object array containing only Name and Size for each file. Here's the code I have. Sorry it's a little confusing because I have my own class named FTPFile and the .NET library I'm using also has a class named FTPFile. I'm using both of them here. I should probably change the name of my class just to avoid confusion:

Public Function GetFileList() As FTPFile() Implements IFTP.GetFileList
Dim ftpfiles() As EnterpriseDT.Net.Ftp.FTPFile
ftpfiles = fCon.GetFileInfos 'Fill object array

[Code]....

I'd just pass on the object array that I'm getting from the GetFileInfos method but COM clients won't have access to the class/object EnterpriseDT.Net.Ftp.FTPFile without me rewriting it, I'm assuming.

View 1 Replies

Dispose Of Application Settings Object?

Dec 28, 2009

I have a custom settings file that I designed using the designer. In my form, I have a function that creates a new instance of this settings by using a dim statement. Then I add this new settings object to a hashtable. After I exit this function, I no longer have access to the settings object without using the hashtable to retrieve it. If I want to remove the object from the hashtable, I can do a simple remove but the settings object still exists somewhere in memory. How can I dispose of this object as well since it inherits from ApplicationSettingsBase and does not have a built in Dispose() function?

View 5 Replies

User Settings XML Serialization Of An Object?

Jul 17, 2009

I am trying to save a custom object as a user setting in a VB.net app. This object consists of a List(Of Pair(Of String, Object)). Pair is a custom class which has two read/write properties (a String and an Object).

If I put simple types like int, string, datetime as the second value of my pair, the setting is saved without any problem. But if I try to put something more complex, like a list, there seems to be a problem during serialization and my setting is not saved.

String values in my pairs are serialized like this:

<value1>Priority_1</value1>

Object values are serialized with a special attribute:

<value2 xsi:type="xsd:int">2</value2>

Seems like values of type Object are serialized differently, to "remember" what is the real type of the object. Why can't it do the same for more complex types like List(Of T)?

View 1 Replies

Asp.net - Pass An Object Into A UserControl In A Repeater?

Jul 24, 2009

I want to wrap up a chunk of HTML render logic in a User Control. Then I want to pass a custom product object (title, thumbnail, id, etc.) to the UserControl that it can use when it renders. Ideally I want to use this in a repeater (or for loop) and pass the current custom product object into the UC.Every example I've seen has been passing through strings on the UC tag but thats not really want I want to do as it means I'll have references everywhere that need updating should we add a new field that needs rendering.

.Net 1 using VB.net (not my first choice for .net so go easy)HTML example to get us going, this would be in the .ascx page:

<div>
<h3><%= myProd.title %></h3>
<img src="<%= myProd.thumbnail %>" />
<p>

[code]....

Yet in my ascs page I get:"Object reference not set to an instance of an object"

Line 1: <%@ Control Language="vb" AutoEventWireup="false" Codebehind="ProductRender.ascx.vb" Inherits="MyApp.ProductRender" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
Line 2: <h3>
Line 3: <%= myProd.title %>
Line 4: </h3>

View 2 Replies

Call A Method And Pass In An Object?

Apr 21, 2012

I have a method called ADD in a class that connects to a database. The database class name is XDB. I also have an object named XXX in it's own separate class with properties.One of the instructions for the Button named ADD click event is:

'Call Add method passing in the XXX object

So this is how I coded:

'declare a variable X as an object instance of XXX
Dim X As New XXX[code].....

I know it's wrong since it doesn't add the XXX and the form doesn't close but I don't know what I'm doing wrong.

View 6 Replies

Calling A Sub And Pass In Parent Object?

Jul 6, 2009

I have a statement that will call a Sub.

Charts(CurChartNo) = Server.CreateObject("ChartFX.WebServer")
Call InitChart()

Inside this sub, I will assign values to the properties of the Charts object that is

Public Sub InitChart()
Charts(CurChartNo).RGB2Dbk = &HC0FFFF&
Charts(CurChartNo).Chart3D = False

[code]....

But the Charts is not recognized in the Sub. This is current program under ASP, I am converting to ASP.Net.

View 3 Replies

Correct Way To Pass The Graphics Object?

Oct 2, 2009

When I do my form_paint event, I have quite a lot to redraw, so I'm breaking into into severals subs to make it easier to read. I'm passing the 'e' variable into my subs as shown below, is this correct?

Private Sub frmMain_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
DrawMap(e)
End Sub
Private Sub DrawMap(ByVal e As System.Windows.Forms.PaintEventArgs)
End Sub

Am I right in copying that whole 'e as system.windows....' etc line from the form_paint details into my subs details?Just to clarify, the sub will draw directly onto the form.

View 3 Replies

Dynamically Pass Values To An Object?

Mar 28, 2011

How can I do this:

Dim oMyObject As New MyObject
oMyObject.DoSomething("Parameter1","Parameter2")

The "DoSomething" and the two parameters are dynamically provided from another script. They are stored in a string object in this script: sAction & sParameters. My question is how can I dynamically pass the "sAction" to the object oMyObject.For example oMyObject.sAction (where sAction should be the value stored in the sAction string). The example will probably not work. Is there a way to do this? The idea behind is to avoid having to write each function hardcoded, like:

If sAction = "DoSomething" then
oMyObject.DoSomething(sParameters)
ElseIf sAction = "AnotherThing" then

[code]....

View 5 Replies

Pass A String Return An Object?

Feb 12, 2011

I 'm new to programming and to vb. So my question could be from misconception about what can i do. How can i pass a string to a "procedure" and get in return a object whith the same name as the string?

View 8 Replies

Pass An Object Type To A Class?

Jun 18, 2009

I create a object type entity in the main function and would like to pass it to a separate class, do some calculation, and then pass the result back to the main function. But I keep getting errors, can someone point me where I did wrong? It's in windows application[code]...

View 2 Replies

Pass Object To Function Using CodeDom?

Jun 27, 2010

How do you pass a control (say a textbox) to a function as a parameter in compiled assembly using CodeDom? I've tried passing through the args in the Invoke method but it doesn't work.[code]...

View 6 Replies

Pass Reference Object From One Form To Another?

Apr 29, 2011

I have maintain a common data table for 3 forms.[code]...

View 5 Replies

Pass Variables To A COM Object From Application?

Aug 10, 2010

I am writting a VB .net (3.5) applivcation which references a COM object. I can call methods on the COM object fine provided that they don't require any variables to be passed. I have been told that you can only pass a maximum of one varaible to a COM object, I really don't believe that it true

for example
objsession.connect()
works fine
but

[Code]...

View 6 Replies

Asp.net - Use A Dictionary-like Collection As An Application Settings Object?

Jun 8, 2009

I'd like to store a set of key/value pairs in the application settings of my ASP.NET web app, but I'm not finding a straightforward way to do that. For example, these two questions tell me that StringDictionary etc. won't serialize to XML and suggest that I'll have to roll my own implementation. But it seems like this should be easier to do; after all, web.config is XML and < applicationSettings> is essentially a collection of key/value pairs, so it feels like I'm missing something obvious. Given my specific case below, do I really have to roll my own serialization, or is there an easier workaround?

The web app in question is a basic contact form that sends email to different recipients based on the value of a parameter; e.g. [URL]...The goal is to be able add or remove recipients (or change their addresses) by editing the web.config file so that I don't have to recompile and can easily maintain different configurations in test and production environments. For example:

// I can use something like this for the sender address SmtpMsg.From = New MailAddress(My.Settings.EmailSender)

// And then just edit this part of web.config to use different addresses in different environments.
<setting name="EmailSender" serializeAs="String"> <value>webcontact@exampledomain.com</value>

[Code]...

View 2 Replies

Attatch Application Settings To ComboBox Object

Feb 25, 2012

I'm pretty sure this has been answered on this thread before, but I'm having trouble searching for it, so I decided to make a new post. Anyway, My problem is that I have a Setting from "My.Settings.Navigation" that is a Specialized String Collection, and what I am trying to do is find a method in which I can attach "My.Settings.Navigation" to a ComboBox. I was also wondering if it was possible to make it only hold up to 20 items at a time?

View 4 Replies







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