However while function 1 works, function 2 doesn't - I get this unhelpful error: Overload resolution failed because no accessible 'New' can be called without a narrowing conversion: 'Public Sub New(path As String)': Argument matching parameter 'path' narrows from 'Object' to 'String'. 'Public Sub New(stream As System.IO.Stream)': Argument matching parameter 'stream' narrows from 'Object' to 'System.IO.Stream'. C:Usersfilms ratingsfilms ratingsForm1.vb I normally work in PHP and I've never seen an error of this nature before. What does it mean and can I re-write the function to get what I want?
I would like to open a file for editing that is stored in a folder called templates that has been added to my project. I know how to open a file that is all good, what i would like to know is a method to give a string the filepath to folder called templates that is (my dumb way of describing it) shown in the solution explorer of the ide.
I could give it the actual string as the location like "documentsandsettings etc etc" but incase the project is stored on a usb stick and used from there i would like to know the proper way of doing this.
I'm using vb.net 2008 with DB msaccess 2007 this method to Copy the file from place to another place [code] Is it possible to only write the name of DB file without filepath
I have used log4net in winforms before. First time using with a wpf console app. The console shows up and the console appender works exactly as in the winforms app. However in winforms I never had to give the full path to the log4net xml file. It is located in the same place where all the cs files are. (the default place where VS 2010 puts all its source files. So
works in a winforms app's Program.cs->main() but for the wpf version where I have my own Startup class with my own Main() (instead of the autogenerated and hidden main()) I have to change the line to look like this
This took me quite a while to nail down so I thought it may be worthwhile to figure why this is so. Anyone know ? I am using log4net ver 1.2.10.0. The log4net dll and xml both have copy to local = true in winforms and wpf.
I'm Currently using the following code to open up a folder containing Text and Bitmap files only and store them in arrays.
Dim d As New System.IO.DirectoryInfo("C:Documents and Settings" & GetUserName() & "My DocumentsWolfRiderGamesWaterGameMaps") Dim FileCount As Integer = d.GetFiles.GetUpperBound(0) + 1
[Code]....
What I need is an extra bit at the end that takes the first bitmap file found and puts it in a picturebox called "PicCenter".
I need to have this done through converting its filepath to the image itself.
I will also Need an explaination of how you did it (If its complicated) because i'll need to do it again later.
Im using Visual Studio 2010.
I Know how to do most simple things in VB which usually allows me to do a workaround for something like this, but this one I couldn't.
I want to do a form that can let user manual add in or delete tree node.When they add in, they can set the name and file path.Then it will store in oracle database.Each time my form run it will go through my database then execute all node from there.
I dunno this can work or not..I want to do a form that can let user manual add in or delete tree node.When they add in, they can set the name and file path.
I am using System.Configuration.ConfigurationSettings.AppSettings to determine the filepath of where to write an XML file. In upgrading from VB.NET 1.1 to 3.5, I get a warning claiming that the method is obsolete.
I need to aquire the full path and filename of a file to add them to a database. I'm currently using OpenFileDialog and in debug it shows that when I select a file, the Filename property is the files full path with the filename. What is the best practice for extracting the full path from FileName?
I want to create a listview with 2 columns, on the first column, a series of names and on the second a series of filepaths. I want each name to be linked to a filepath and then when the user clicks on the name in the first column, the filepath can be used in another bit of code. How would I do this, never used listviews before.
In my class i want to return the filepath into a tectbox on an other form, but it won't return the filepath after saving. Probally because it is a sub an't won't return a value am i correct? But what is the right way to fix this?
I am saving using file dialog box and I want to get the path of the save location because I want to copy files that was browse by the user . I am planning to to copy some image and to be save there where I save the data. Im planning to use this but I need first the save location.
I want to access this file which is in a particular url...[www.xyz.com/file]....when i type the address in browser im able to view all the files in that path..
I have a form linked to a ticketing system. The user can select what file they want to attach through the asp:fileUpload object. I was wondering how I can extract the full file path from the asp:FileUpload object; something like "C:Documents And SettingsMy Documentsinfo.txt" as an example.
FilePath for the Current Application's Default Configuration .I am writing several DLL's that each have their on configuration file. I am trying to set the Application Default Configuration to be the DLL's Default Configuration - not the EXE's Default Configuration. How can I determine the pathfile for the current Application Default Configuration??I have tried using FILEPATH of SYSTEM.CONFIGURATION.CONFIGURATION but can not get the syntax correct.
VS complains 'Too many arguments to 'Public Sub New (ItemPath As String)'You'll note that in this error message VS shows there is only ONE parameter expected.However, if you type <XmlData( - VS shows list of EIGHT parameters are expected.
im parsing an xml file using this code Private Function overview2(ByRef filePath As String)Dim reader As XmlTextReader = New XmlTextReader(filePath + "\movieData.xml")
[code]...
it works 80% of the time. What i mean is , i go through each node and when i find the overview node i read the data and send it to a text box. Im doing this for movies on disk. sometimes on certain movies it doesnt find the overview node even though it is there .
I am getting the following error when trying to open a vb .net 1.0 project using VS2002."Unable to open Web project 'ProjectName'.The file path 'FilePath' does not correspond to the URL 'ProjectURL'. The two need to map to the same server location. HTTP 404: Object Not Found."I have tried ALL of the links that Google threw at me (on the first page) on searching on "unable to open web project the two need to map to the same server location" term.I get this error when trying to open an existing vb.net 1.0 project and also when creating a new one.
I am getting the error:"Range variable 'sender' hides a variable in an enclosing block or a range variable previously defined in the query expression."for this
Imports System.Data.SqlClient Imports System.Linq Public Class Form1
[code]....
I can select any other item from the table without the error. "sender" has the same properties as "receiver" in the SQL table.
Public Class Form1 Dim x, c, number(0 To 19) As Integer Dim s As Integer
[CODE]...
The variables in the brackets [example] do not actually have brackets in them in the original code. These are where the issues are. For both variables, it says, "The type for variable [variable] will not be inferred because it is bound to a field in an enclosing scope. Either change the name of [variable], or use the fully qualified name (for example, 'Me.[variable]' or 'MyBase.[variable]')." Now, I'm not entirely sure if this is a stupid question or not, as I'm used to VB '98 because that's what we use in my programming class at High School. let me know why this won't work.
-Note: The intention of this program is to continually loop the generation of numbers for this list until I tell it to stop. Button1 ends the program, Button2 generates the list one time only, Button3 is supposed to loop the generation of the list, and Button4 is supposed to end the loop, but not the program.
Say that i have the following code that parse about 20k records from the DB.
Code #1
vb.net While reader.Read() list.Add(If(Integer.TryParse(reader(0).ToString, 0), Integer.Parse(reader(0).ToString), 0)) End While
And then another code which does the very same thing but it seems to be a little cleaner.
Code #2
vb.net While reader.Read() Dim storeowner As Integer = 0 Integer.TryParse(reader(0).ToString, storeowner) list.Add(storeowner) End While
This is what i am confused about; does the compiler creates a new variable automatically when i use the if statement without strictly declared variable? What approach is better in sense of performance?
I am looking for a good resource on variable naming conventions to illustrate variable type and where variables are declared. So I will have public variables, Private variables, private or local variables. I also may want to declare variables with the same name in different class code (i.e. in the code behind different forms). I am assuming good coding would dicatate a prefix for declaration location.
i have this error in the line of with xl.active......Object variable or With block variable not set.
Dim xl As Object xl = CreateObject("Excel.Application") With xl.ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:Documents and SettingsUserDesktop429MEDICA2.TXT", _ Destination:=xl.Range("$A$1"))