473,624 Members | 2,453 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 12491
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
4947
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
15864
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
4861
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
5305
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
10208
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
13854
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
7202
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
1806
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
2833
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
8240
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
8625
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...
0
8482
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
7168
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...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
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...
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.