Error On Returning List Of String Program Desktop Application
Nov 22, 2010
I'm trying to create a ntier desktop application using vb.net 2008.[code]...
By the way what i want to achieve is how to get the data as a List(Of String),because if i put the getMenu function into the presentation layer directly,it gives me the data as i expected..Also if i return as a string instead of List(Of String),it gives me the single data.
I am currently trying to develop an application which will backup large folders to a specified destination. To find all the files in the specified 'backup' directory I am using the following code.
[Code]...
I have tried putting my GetFilesRecursive function into a separate background worker to run first so I can update the GUI however I am struggling on how to return the List of found files back to my application (I get cross-threading exception) and how to update the progress bar to show the progress of the GetFileRecursive function so the user knows it is processing the list of files and has not crashed/frozen.
I'm coming from unix / server / c++ /java background with no GUI experience .i need to build windows GUI application , i need to build it fast i was told that the .net family is the exact thing for such job . but there is VB.net and c# what should i choose what is faster and better for such job ? what will be easier for none teachi user to install and for me to deploy the end product
We have a Windows Forms VB.NET application running on Windows Server 2008. Users access this app using Remote desktop.The app displays information in Excel, but Excel opens on the server.Is there a way for the .NET app to launch Excel on the users local desktop?
i have issue returning a list in a web method. here is the code
<WebMethod()> _ Public Function getTags(para_parents As String) As List(Of getTypeDetailsByParentName_Result)() Dim context As New PPEntities
[code]....
the error is
Value of type 'System.Collections.Generic.List(Of SaftyonRoad.getTypeDetailsByParentName_Result)' cannot be converted to '1-dimensional array of System.Collections.Generic.List(Of SaftyonRoad.getTypeDetailsByParentName_Result)'
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
I have a school project i am working on wich i am to build a program that randomly generates 500 alpha-numeric numbers (license plate numbers). the program needs to be able to search the 500 numbers and based on given criteria (a text box) that you put in return the matching results to another listbox. I got the 500 plate numbers to generate on form load but have been searching thru my textbook and cant seem to figure out how to take the imput from the text box and search the list box. Not asking for a ton of help but just a point in the right direction. i attached the assignment i was given from instructor.
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.
I am trying to make an application which will list all processes in a string when it starts. After it has listed them all I enable my timer, and in the timer there gets checked if the process is in the process list (string), and if it isn't it will add it to my listbox. The only problem is, it's not working, it's never adding an item.
vb.net
Public Class Form1 Dim AllProcesses As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'The first check For Each p In System.Diagnostics.Process.GetProcesses() If AllProcesses = "" Then AllProcesses = p.ProcessName Else AllProcesses += "|" + p.ProcessName End
I'm working on a small game that is based on a map of grid squares.I have a class (clsGrid) that stores a few properties for each grid square.The grid square objects are organized into a list(of clsGrid).A loop and stream reader are successfully reading properties from a text file, putting the properties into grid objects, and adding the grid objects to a my list of grids. When retrieving a grid from the list of grids, I'm getting unusual results. Regardless of the index I give the list, I always seem to get the last indexed grid in the list.The debugger seems to suggest that the right numbers are being read into the stream reader and they are being added to gridHolder. However, the message box at the end will always show me the LAST grid.id, regardless of the index I give it.
'A subroutine that generates a map (list of grids) Sub GenerateMap() Dim reader As StreamReader = File.OpenText("map1.txt")[code]....
Function runs fine on the listbox until i use the btnUp_Lanemgr click event
throws an exception in function (below in bold) "Unable to cast object of type system.string to type namespace.myitem"
what i can do to make this work?
'Button moves selected listbox item up Private Sub btnUp_Lanemgr_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUp_Lanemgr.Click
I want to define a function similar to:[code]My current definition is having an issue with the following statement:GetList = (From x In oDS.Tables(0) Select New T(x)).ToList.I can't figure out how to get to create a New object of type T, any suggestions?
Any best approach to what I'm trying to achieve (linq to sql, returning list of data to show in a grid/list etc etc)... Its complaining about anonymous type conversion, and from what I'm reading, thats not elegant way of doing it.
Public Function GetHistory(ByVal historyId As Integer) As List(Of ?????????) Using dc As New myDataContext(Application.GetConnection) Return (From t In dc.ActionTypes, a In t.MyTable Where a.HistoryID = historyId Select a.ActionOn, a.ActionBy, t.Description, a.ImpactedItem, a.ActionDescription).ToList End Using End Function
I have a Business Logic Layer that contains function that return datatables. I'm writing a function that will return just the records that begin with the string passed in. this is what I've come up with so far:
Public Function FetchBusinessAreas(ByVal area As String) As List(Of BusinessArea) Dim AreasList As New List(Of BusinessArea) Dim dt As DataTable
Let's say 10 desktop shortcuts, all with different names/icons, point to and can start the same exe application from the same directory. Is there any means for the application to know the distinct name of the shortcut that was doubled_clicked. Also is there any means for a running application to know if it was started by command line, by a double_click on the exe, by a double_click on a shortcut that points to it, or by another process' call?
I am trying to use Setup project. Want my setup to create a desktop shortcut with my application.I donot understand how to do it. Clicked on User's desktop, I created Shortcut to User's desktop, changed the properties Target and Working Folder as 'Application Folder'But it does not connect with MyApplication.exe When I ran the setup and tested Desktop short cut, it took me to the folder where application was installed, instead of running the application.How to make the application run using this shortcut?
I have got an xml document which looks something like this.
<Root> <Info> </Info> <Info>
[Code]...
How can i write a linqToXML query so that it returns me an IEnumerable containing each child element, in this case all five child elements of , so that i could iterate over them. The order of child elements is not definite, neither is number of times the may appear.
Question: I created an ASP.NET web application. Now it originally was meant for deployment on a webserver.That is working, so, so far so good.My question now is: Is it possible to deploy it as a desktop-application, too? That is to say the installer installs some kind of server, plus the web application, configures the server to run this application on a localhost URL, and then creates a link in the start menu/desktop, where it opens that url (website, the application) on localhost in a web browser?
I think it should be possible, though the server wouldn't be IIS, because this is a windows component which can't be separately installed. Is there anything like this already out there The nonplusultra would be that it only starts the server when you click on the shortcut.
I have an application that is written in VB.NET, using the System.Windows.Forms.Form as the front-end GUI. It runs perfectly on my Windows machine however recently there is a business requirement to convert this application to run as a web application so that people could view them in their blackberries when they go to the URL. Is there any quick way to perform such a conversion or I will have to translate the code line-by-line for such cases?
I am trying to call an external C++ function using VB.NET (answers in C# are fine, I can convert back) which returns a list of device names. This comes in the form of a pointer to a null-terminated array of null-terminated char arrays (correct me if I've misunderstood what I'm dealing with) with a function signature:
long GetNames(char*** names)
Most of the answers to similar questions I've found have involved something more like:
long GetNames(char** names, int length)
It appears from what I've read that I need to give it an IntPtr but I'm uncertain as to how this should be initialized, and in my case I don't know the length of the array. At the moment, in the VB module, I have:
<DllImport("MyExternal.dll", CallingConvention:=CallingConvention.Cdecl)> _ Function GetNames(ByRef names as IntPtr) As UInteger End Function
I've tried calling the function by passing an IntPtr initialized as IntPtr.Zero or using Marshall.AllocHGlobal, but I always get an AccessViolationException.
Any ideas on how I should be calling this function and how I get the return value into a managed string array would be greatly appreciated.
EDIT: I've found a sample function call in native C as follows:
I'm trying to list all files in my desktop folder.But strUserDir value is "0" any ideas why?
My code
VB.net Dim strUserDir As String = Environment.SpecialFolder.Desktop For Each foundFile As String In My.Computer.FileSystem.GetFiles(strUserDir) ListBox1.Items.Add(foundFile) Next
the system is going to have two front-ends - one web application and one desktop application.The desktop application is going to be coded using VB.NET, and the web application in PHP. There's really no reason why the desktop application can't be replaced by a web application as well - except that one of the programmers seem to really want to code it in VB...However none of us have experience working with either of these pairs .
P.S. hosting service will be gotten from some provider and not be on the client's own server.
I have built a DataTable from my database. Then I am looping through the rows and trying to access a string, however the value is being returned as each character in the string.
For Each theseRows In DisplayForm.MainTab.Rows If theseRows.Item("Last_Name") = userLast And theseRows.Item("First_Name") = userFirst Then
[Code]....
The Trap_Code values are two or three letter strings, the returned value is each letter once at a time. The loop seems to cycle through the individual characters of the string as an array rather than display the entire value, which is what I was hoping for.