473,890 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Argument Exception: Empty path name is not legal.

1 New Member
hi,

i am getting an exception while populating the data in the datagrid.

am getting the values into datatable and binding it to the datagrid but it is not
displaying the data and giving an exception like

System.Argument Exception: Empty path name is not legal.
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.Strea mWriter.CreateF ile(String path, Boolean append)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append)
at Common.Logger.W rite_line_to_Lo g(String message, String logFile)
Jul 18 '07 #1
2 12537
Plater
7,872 Recognized Expert Expert
That error message relates to File IO. That doesn't seem like something that would happen from a databind.
Check the line location for the error and post the code associated with it?
Jul 18 '07 #2
TRScheel
638 Recognized Expert Contributor
hi,

i am getting an exception while populating the data in the datagrid.

am getting the values into datatable and binding it to the datagrid but it is not
displaying the data and giving an exception like

System.Argument Exception: Empty path name is not legal.
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.Strea mWriter.CreateF ile(String path, Boolean append)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append)
at Common.Logger.W rite_line_to_Lo g(String message, String logFile)

I am going out a limb here, but you have a StreamWriter somewhere. On the initialization of that StreamWriter, you passed an empty string as the file location.

Something like:

Expand|Select|Wrap|Line Numbers
  1. string FileLocation;
  2. StreamWriter SWriter = new StreamWriter(FileLocation);
  3.  
That will throw just that exception.
Jul 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4970
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
11
15912
by: Keith Patrick | last post by:
Could someone explain to me the relationship between these two classes? I am ripping my hair out trying to divert an HttpRequest to a new location via an HttpWebRequest, but I cannot get my session xfer to work, possibly due to the cookies not being compatible. I've spent over a week trying to get the HWR to integrate nicely with my app, but I cannot get the session to transfer, and it'd probably take me even longer if I tried to digest...
18
4893
by: Atara | last post by:
In my apllication I use the following code: '-- My Code: Public Shared Function strDate2Date(ByVal strDate As String) As System.DateTime Dim isOk As Boolean = False If (strDate Is Nothing) Then isOk = False ElseIf Not (strDate.Length() = 6) Then isOk = False
4
5317
by: Chas Stapleton | last post by:
I have recently uninstalled VB5 and installed vb.net 2002. In working on an application, I attempted to add a picturebox and add an image... I immediately received an "empty path name is not legal" error. I attempted uninstalling it and reinstalling to no avail... I have also upgraded to Visual Studio.net 2003 and am receiving the same error message. Additionally, I tested adding an image at design time to an ASP.NET Web Application...
6
10223
by: Don | last post by:
I'm having problems working with a streamwriter object. After closing the streamwriter and setting it to Nothing, I try to delete the file it was writing to, but I always get the following error message: "The process cannot access the file "whatever" because it is being used by another process." I've even tried opening another file using the same streamwriter object before deleting the original file, but it's no use. Something keeps...
3
13892
by: Juhan | last post by:
Hi! I have a strange error in a console application that is hosted by IIS 5.0 and invokes a web service hosted on the same machine. A request form the web comes in and it is dispatched to a service class which uses a helper class to create an instance of the automatically generated webservice proxy class. The instance creation fails on this row: _10._0._40._252.ETISXTeeService srv = new
6
7231
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
2
1816
by: Lambuz | last post by:
Hello everyone, I have an applciation that uses remoting. When the application is run via a local copy it works. When it is run via an HTTP address RemotingConfiguration.Configure fails. Apparently this method can not find the configuration file even though other parts of my application can use ConfigurationSettings.AppSettings with no problem.
6
2853
by: =?Utf-8?B?QkJN?= | last post by:
Hi, I have an app that is crashing due to a System.ArgumentException. At this point it's just a simple app to test some basic object values. The main app is a Windows App that looks like this. Public Class DesTestForm Private Sub DesTestForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
0
9979
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11234
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10829
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5854
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.