Return List Of String That An Object A Has Username

Dec 2, 2010

How to return Ilist of strin that object a has username i want return that name

View 1 Replies


ADVERTISEMENT

List Of T Find Date Or Other Property In A Object In The List - Then Return Found Object?

Sep 3, 2009

After reading all the examples for list of T exists and Find and find first, none show how to handle multi-property objects. Below is bare bones example maybe someone could flesh out to show how this should be done.

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim DatePriceList As New List(Of DateAndPrice)
DatePriceList.Add(New DateAndPrice(Date.Parse("1/1/2000"), 10.12))
DatePriceList.Add(New DateAndPrice(Date.Parse("1/2/2000"), 11.12))

[Code]...

View 3 Replies

.net - Function To Accept List(Of String), Array & String And Similarly Return List(Of String)?

Jul 29, 2011

I want the Function to accept List(Of String), Array & String and similarly return List(Of String), Array & String respectively. The Function simply adds a string (month) to the input collection. I just want to use it for string, array and list with needing to think of conversions.

[Code]...

View 2 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

Public-facing Property To Return Either A String OR A Numeric W/o Using 'Object'?

Nov 4, 2010

So I've run into a case where I have a class that can store either a string or a numeric value, and I want a single property to return one or the other (it would be a failure for both to be set). I'm using a custom generic class to deal with the numerics (so I can use signed, unsigned, and nullables), and will be storing the string in a separate variable.

In theory, if overloading could be done based on the return type, I could do this quite easily. But .NET currently disallows this. So I am wondering if there is some other really-far-out-there trick (outside of MSIL generation via Reflection.Emit) that could accomplish the same thing.

I'm open to ideas via delegates, pointer dereferencing, generics, mystical rites, etc. Also interested in any thoughts or pros/cons of such possibilities as a learning tool. If using a standard Object is the only way to achieve what I want, then that's fine with me. But It's difficult to find the correct set of keywords to hunt down this kind of capability on Google, so I thought I'd ask here before I moved on to doing something else on the project.

View 2 Replies

Return Rows That Have A Matching String To Predefined List?

Jul 8, 2009

1 within each section of a SplitContainer. The left hand side will be for inputing text that is copied/pasted from a word, excell, or text file.The right hand side would be for my output. What I would like it to do is return just the rows from the left hand side that contain a match to any one of the predifined strings. This will be used to search large lists of company names and circuit IDs and return the rows with matching namesSo far I have the form created, the Splitcontainer in place along with the richtextbox on each side and a submit button at the bottom.

View 12 Replies

Asp.net Mvc - Creating A List (of String) Giving Error" Object Reference Not Set To An Instance Of An Object"

Nov 1, 2011

MVC 3 razor VB.NET project. I have resorted to manual building a list for a drop down box so I can insure certain values are available in the select list and also to control what the first item is in the list. The below is my code snippet for the part that is giving me problems..

[Code]...

View 2 Replies

[VS2010] My.User.Name To Return Only The Username

Oct 14, 2010

I'm trying to get the My.User.Name to display only the windows username in a textbox. By default it returns domain name plus the username. How do I make it to display only username, without the domain name?

[Code]...

View 6 Replies

[VS2010] User.Name To Return Only The Username?

Jun 4, 2009

I'm trying to get the My.User.Name to display only the windows username in a textbox. By default it returns domain name plus the username.How do I make it to display only username, without the domain name?

View 39 Replies

Convert List Of String Into An Object?

Mar 6, 2012

I am looking for a way to convert my List(Of string) into an Object in vb. So in the end it would be the same as declaring Dim cArray() As Object = new Object. Can anyone point me to how i can achieve this? I cannot use the LINQ .ToArray as that creates a string array and this is not acceptable for my work. I need to pass this object into another one that has the parameter (aArray as Object).

View 4 Replies

Return An Object As The Return Value Through A RealProxy Transparent Proxy?

Oct 7, 2010

I'm working up a system where I plan on using RealProxy objects to enable intercepting method calls against a set of objects, handling the call, and then returning appropriate results. This works just find for simple return types like strings or ints, but I can't seem to return objects from the RealProxy.Invoke method. Everything works. I get no errors, but the returned value is always NOTHING, instead of an object.

I've worked up the smallest sample code I could, and have included it below. Essentially, just call RPtest and single step through. The code creates a simple object, RPTestA, with a string field and an object valued field It then retrieves the string

[Code]...

View 1 Replies

Insert List Object As Argument In String.format

Feb 10, 2012

I am trying to pass a list in string.format as the parameters to the SQL statement, but I get the following error: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. I know that I can get it to work when I list out each individual list member as the arguments, but I am wondering if there is a shortcut so I can just use the list object as the only argument.

[Code]....

View 1 Replies

Display A List (Of Object) Which Has Single Objects And Child List (Of Object)?

Sep 6, 2011

Limited to using v2.0 of .Net framework (we use VB.net) due to environmental constraints on our servers.I've got an ASP.net webpage which pulls data from a webservice that performs checks on user accounts in active directory. Operators can check multiple accounts at one time using the web interface. The webservice returns a list(of AccountCheck) objects which themselves contain single properties like username, email address, and List(of AccountError) objects which contain multiple properties.[code]What I want to do is using some kind of repeater, create multiple panels or divs which contain labels showing the username, email etc, and a gridview which has the accounterror list bound to it to show all the errors. The users could be checking 2, 5, 7 accounts at once, and is dynamic.

View 2 Replies

Cast A List Of Object To List Of Interface That Object Implements?

May 19, 2009

I am working in VB.net and have a Class, Foo, that implements an interface, IBar.I have a List of Foo's, but I need to pass a list of IBar's into a function, but I keep getting casting errors, even when I use DirectCast.My code is [code]MainWorks works, but it would be really annoying and inefficient to have to do that everywhere I want to call this function.

View 4 Replies

Return An Array Of Object Interface's Rather Than An Object?

Mar 4, 2009

I have an interface that describes an specialized list in my application...

[Code]....

Is there a way to make an interface serializable, or am I going to have to convert each of my objects into a concrete class implementing the interface, and then return that class?

View 2 Replies

VS 2010 Return Items In A List Before Returning The List?

May 23, 2012

That was probably bad title, but I'll illustrate what I'm trying to do. I have a method in a class that I need to call several times. The method returns a List(Of String). I'm just grabbing some information from a database.

VB.NET
Public Function GetTestList() As List(Of String)
Dim int As Integer = 0

[code]....

View 4 Replies

Items In List View Should Be Saved In This Template Username?

Dec 1, 2010

I have a listview and the list contains 2 columns.
first is Username
second is Password

I want the information under those columns to be save as a text file in this style:

username1 : password1
dowpkf : wateverpass

and so on .so basically the items in list view should be saved in this template username..

View 5 Replies

How To Quickly Transform A List(Of Object) Into A List(Of "Object.field")

May 29, 2012

Suppose I have a list of Cat.

Public Class Cat
Public Property id As Guid
Public Property name As String
Public Property race As catRace
End Class

How can I quickly transform this List(Of Cat) into a List(Of Guid) using the id property?

I could do :

Dim newList As List(Of Guid)
For each item in catList
newList.Add(item.id)
Next

But I think there must be a way to do this faster (1 LOC). I just can't find how.

View 3 Replies

C# - With LINQ, How To Transfer A List<List<string>> To List<string>

Dec 15, 2010

I got an object of List<List<string>>I need to bring this into a ist<string>I have no idea how to do this with LINQ.

View 1 Replies

.net - Can't Return Dictionary(Of String, String) Via GET Ajax Web Request, Works With POST

Jun 23, 2009

I have the following web method:

<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=True, XmlSerializeString:=True)> _

[Code].....

I wanted to use HttpGet here so that the result can be cached.

I tried every variation of calling this, but no luck. Is this possible with GET?

View 2 Replies

.net - Return Object() From WCF

Aug 17, 2011

I have a WCF service wich has this function:

[Code]...

wich returns the values specified here:

[Code]...

Each one of this functions returns a List of entities. If I call this functions individually they return their values ok. But what I want is to make only one call to the service and no several! I want to be able to receive it in another application like this:

[Code]...

View 1 Replies

Net - Return The Object Associated With The Name

Feb 3, 2012

I'm connecting my program to some external code. I'm setting it up so that the external code can instance objects and I've come across a problem. I've created this function here:

[Code]...

I'm trying to create a System.Diagnostics.Process object. For what ever reason though, it always return Nothing instead of the object. Does anybody know what I'm doing wrong? I'm doing this in VB.net so all .net responses are accepted :)

View 2 Replies

WEBCLIENT Not Working - Not Get Text File From PHP/MYSQL Server - Invalid Username/Password Or No List Download Permission

Jun 1, 2012

I do the same thing with URLdownloadtoFile: IT WORKS.Wih the WEBCLIENT part I just DO NOT GET the Text file from the PHP/MYSQL server: I only get message "Invalid Username/Password or no list download permission: ||"

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim urlStr1, urlStr2 As String

Dim fileToStoreStr, fileToStoreStr1, fileToStoreStr2 As String

[CODE]...

View 4 Replies

C# - WCF Serialization And Interfaces - Error: List(of Object) Cannot Be Converted To List(of IMyInterface)

Oct 16, 2009

Does link text mean I have to return a concrete implementation? Even though I am using svcutil with the /r that includes my entites(where IMyInterface is defined). I get no errors but it changes all List(of IMyInterface) to list(of Object) and I cannot deserialize it on the client

Error: list(of object) cannot be converted to list(of IMyInterface).

View 1 Replies

Does An Object Retrieved From A List Get A Copy Of That Object Or A Reference To It

Feb 1, 2012

In VB.net, when I retrieve a value from a list do I get a copy of that value or a reference to it?

dim blah as someObject
dim listOfBlahs as list(of someObject)
listOfBlah.add(new someObject(1))

[Code]....

View 2 Replies

Why Is List.add() Adding Items To Object AND Source Object As Well

Jun 15, 2011

I need to be able to add elements to a copy of mylist.testlist without modifying the global mylist object. (Which seems to be happening via the below code.)When I am working on x, which should be a totally separate object, mylist is getting modified as well. How can I fix this? I have worked with lists extensively and never seen this behavior before. I have tested and reproduced the problem in .NET 3.5 and .NET 4.0 on Win 7 Pro 32bit.

Source Code:

Public Class Form1
Public mylist As New test
Sub Main()

[code]....

View 1 Replies

Create List Of Child Objects From List Of Parent Object?

Jun 2, 2011

I would like to create list of child objects from list of parent object. Like If i have list of bookingroom which has one member room then i would like to create list of room from it.

eg. code:

Dim BookingRoomList As List(Of BookingRoom) = New List(Of BookingRoom)
Dim RoomList As List(Of Room) = New List(Of Room)
BookingRoomList = BookingRooms.FillGrid()

[Code]....

Is there any short cut method instead of iterating over for earch?

View 1 Replies

Storing 2005 Connection String, Username And Password Outside The Application?

Aug 13, 2009

Does anyone know how to store the connection string in a file rather than hard coding it in the application. For example i have declared this connection string in the form to connect to oracle database and it works. But i assume this is not the right way to go by if one is looking for more secured environment.

strcon = "Provider=MSDASQL;" & _
"Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _

[code].....

View 9 Replies

Copy List Object To Another List Object

Jun 15, 2012

I am having a problem when setting VB.NET list object to another.I create an instance on ReadLocations and than create an object of ReadLocation where then I loop through ReadLocations and set ReadLocation1 equal to rl. What happens is that if I then go and change ReadLocation1 to something else (assdfhsd) it will also change the ReadLocations index. I am really confused why it would be doing that unless it is "=" sign means referencing instead of actually setting the value. Please help as I am a C# developer but the program I am modifying is in VB.NET.[code]

View 1 Replies

Class To Return An Object?

Nov 14, 2010

I have a class i've called "buttons", which passes in 1 variable, the button text, and then returns a new button with that text. however, i do not know how to get the class, when called to return a button.

similar to how 'toString' works, except it would return a button object instead of a string. (im not sure how toString works in vb.net. in java it is automatically called when you call the new class, so newclass and newclass.toString(); return the same) [code]...

View 2 Replies







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