"Path cannot be null." Error trying to write DataSet to XML file

 I'm trying to write a DataSet to XML but get the error "Path cannot be null." Program uses VB to get desired records key IDs from a form, then forms a query with them, fills a dataset with the query results and saves the dataset to XML. Any help would be greatly appreciated and I'd be happy to post additional code if needed.

private sub Page_Load()
    Dim con As SqlConnection
    Dim cmd As SqlCommand
    Dim profschema, profxml As String
    Dim IDlist As String
    Dim keyidary
    Dim query As String
   
    query = "SELECT *****lots of column names***** FROM profiles_tbl WHERE (KeyID = '999999') "
    IDlist = Request.form("chosenIDs")
   
    keyidary = split(IDlist, ",")
    Dim makequery As New Stringbuilder(query)

    For Each ID as String in keyidary
        makequery.Append(" OR (KeyID = '" & ID & "')")
    next
   
    query = makequery.ToString()
   
    try
        con = new SqlConnection()
        con.ConnectionString = ********valid conn string********
           
        cmd = new SqlCommand()           
        cmd.CommandText = query
        cmd.CommandType = CommandType.text
        cmd.Connection = con
       
        Dim adpt As New SqlDataAdapter(cmd)
       
        Dim profiles As New DataSet
        adpt.Fill(profiles, "profiles_tbl")
        profiles.WriteXmlSchema(profschema)
        profiles.WriteXml(profxml, XmlWriteMode.IgnoreSchema)
    catch err As Exception
        Dim prterr = "<p><font color=red>Err: "
        prterr = prterr + err.Message
        prterr = prterr + "</font></p>"
        response.write(prterr)
    finally
        if con.ConnectionString <> "" then
            con.Close()
        end if
    end try
end sub

 Again, thanks for any help you can offer.
 

0
as
8/3/2007 8:16:00 PM
asp.net.xml-datasource 7181 articles. 0 followers. Follow

1 Replies
430 Views

Similar Articles

[PageSpeed] 3

Fixed this. Stupidly forgot to declare values for the variables used to store paths for new xml files.

Other bugs still but will continue on them until I get stuck again.
 

0
as
8/3/2007 8:47:06 PM
Reply:

Similar Artilces:

Is there a way to write Atlas "text/xml-script" script Into single file like ".js" or ".css" file
I have tried the following code: <script type="text/xml-script" src="Default.aspx.ajax"><script type="text/xml-script" src="Default.aspx.js"><script type="text/xml-script" src="Default.xml"> but they dit dot work. thanks.msn & email:lidong6@gmail.com I believe it does not work as the XML-Script processor takes the content within the script tags to do processing and ignores the src tag. I think this will be a nice feature to add in the next release....

datawindow.import(XML!,"file.xml") syntax error
I am using Pocket PowerBuilder 1.5 build 360 from the help file I saw [ImportFile method (DataWindows)] long dwcontrol.ImportFile ( {saveastype importtype}, string filename {, long startrow {, long endrow {, long startcolumn {, long endcolumn {, long dwstartcolumn } } } } } ) This statement inserts all the data in the file D:\TMP\EMPLOYEE.CSV into dw_employee starting at the first column: dw_employee.ImportFile("D:\TMP\EMPLOYEE.CSV") This statement inserts all the data in the file D:\TMP\EMPLOYEE.XML into dw_employee starting at the first column: dw_em...

"Error loading XML file :\windows\microsoft.net\framework\v1.0.3705"...does this mean v.1.1 code trying to run in a v.1.0 app?
I uploaded some new files into my existing third-party hosted site, including a .DLL into \BIN\, which is running AS.NET v.1.0. I got the following error message when browsing to one of the pages using the code in the namespace defined in the DLL: Error loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. (c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config) ...

superreview requested: [Bug 219355] XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" : [Attachment 131594] use NS_GRE_DIR
Benjamin Smedberg <bsmedberg@covad.net> has asked Darin Fisher <darin@meer.net> for superreview: Bug 219355: XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" http://bugzilla.mozilla.org/show_bug.cgi?id=219355 Attachment 131594: use NS_GRE_DIR http://bugzilla.mozilla.org/attachment.cgi?id=131594&action=edit ...

superreview granted: [Bug 219355] XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" : [Attachment 131594] use NS_GRE_DIR
Darin Fisher <darin@meer.net> has granted Benjamin Smedberg <bsmedberg@covad.net>'s request for superreview: Bug 219355: XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" http://bugzilla.mozilla.org/show_bug.cgi?id=219355 Attachment 131594: use NS_GRE_DIR http://bugzilla.mozilla.org/attachment.cgi?id=131594&action=edit ...

superreview requested: [Bug 444994] In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel : [Attachment 333790] Stop nulling variables
Kent James (:rkent) <kent@caspia.com> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 444994: In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel https://bugzilla.mozilla.org/show_bug.cgi?id=444994 Attachment 333790: Stop nulling variables https://bugzilla.mozilla.org/attachment.cgi?id=333790&action=edit ...

superreview denied: [Bug 444994] In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel : [Attachment 333790] Stop nulling variables
neil@parkwaycc.co.uk <neil@httl.net> has denied Kent James (:rkent) <kent@caspia.com>'s request for superreview: Bug 444994: In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel https://bugzilla.mozilla.org/show_bug.cgi?id=444994 Attachment 333790: Stop nulling variables https://bugzilla.mozilla.org/attachment.cgi?id=333790&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil@httl.net> No, I don't think this is right. ...

File write error on file "acct" in module "GWEACCT".
--____HHJZYVOOFXDLYDIWHUSF____ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Content-Disposition: inline; modification-date="Tue, 24 Sep 2007 10:15:42 -0400" VGhlIG1vcm5pbmcgb2YgV2VkLiBTZXB0IDE5dGguIHdlIHN3aXRjaGVkIG91ciBHV0lBIG92ZXIg dG8gdmVyc2lvbiBHVzYuNSBTUDYgZnJvbSB2ZXJzaW9uIEdXNS41LiAgVGhlIG5leHQgbW9ybmlu ZyB3ZSBzdGFydGVkIGdldHRpbmcgdGhlIGZvbGxvd2luZyBlcnJvciBpbiBvdXIgR1dJQSBsb2cg ZmlsZTsNCg0KMDktMjAtMDcgMDg6MjI6MTAgMCBVbmtub3duLCBlcnJvciBjb2RlID0gODIxMA0K MDktMjAtMDcgMDg6MjI6MjEgMCBNU0cgNDAwIERlZmVycmVkIGRlbGl2ZXJ5IGZpbGUgbWVtb3J5 IGVy...

File write error on file "acct" in module "GWEACCT"
Getting this on GWIA 6.02 scrolling across the screen. Runs on a Win2ksp3 box. Searching TID's...... JG I'd probably whack most of the subdirs under gwia and let gwia rebuild. -- Michael J. Bell Novell Support Connection Volunteer Sysop Author of Guinevere (http://www.openhandhome.com) PLEASE: Do not e-mail me privately unless specifically asked. I'm a volunteer, not a Novell employee! All opinions and advice provided are MINE alone and NOT Novell's unless specifically identified as such. Novell does not officially monitor these forums. Enhance...

Error found "Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. "
Hi guys! i'm trying to solve the error "Err Msg: "Object reference not set to an instance of an object" in ASP.NET app" but when i followed the instructions in the http://community.crystaldecisions.com/library/kbase/articles/c2011144.asp link, this error appeared ""Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. " What's going on? i already went to the iis to add new virtual directory (CrystalReportWebFormViewer) but different error appeared when i compile and browse my application. pls help ...

superreview granted: [Bug 444994] In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel : [Attachment 333894] Fix regression per Neil's suggestion
neil@parkwaycc.co.uk <neil@httl.net> has granted Kent James (:rkent) <kent@caspia.com>'s request for superreview: Bug 444994: In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel https://bugzilla.mozilla.org/show_bug.cgi?id=444994 Attachment 333894: Fix regression per Neil's suggestion https://bugzilla.mozilla.org/attachment.cgi?id=333894&action=edit ...

superreview requested: [Bug 444994] In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel : [Attachment 333894] Fix regression per Neil's suggestion
Kent James (:rkent) <kent@caspia.com> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 444994: In <folderWidgets.xml>, "Error: aFolder is null", loading "Junk Settings" panel https://bugzilla.mozilla.org/show_bug.cgi?id=444994 Attachment 333894: Fix regression per Neil's suggestion https://bugzilla.mozilla.org/attachment.cgi?id=333894&action=edit ------- Additional Comments from Kent James (:rkent) <kent@caspia.com> So this is what you had in mind, right? ...

When I get .XML document with Request.Form["xml"].ToString(); it gets error.
XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(Request.Form["xml"].ToString());  I want system doesn't interrupt the code execution. How can I do system doesn't give error message?  Thanks.  Error Message  A potentially dangerous Request.Form value was detected from the client (xml="...8859-9" ?><BORCELIK><Tarih>09/...").  ...

PB11 .NET "smart client" PUBLISH ISSUE... "Error when transfering files."
Before I start I should state that I'm not the Microsoft server admin... I have gotten this to work as recently as two days ago, but then it mysteriously stops working without any reason. It pushes most of the files out to the server correctly, but I did notice thatthe "CONFIGURATION.XML" file is missing. The "Publish Application" takes a while before failing and eventually fails with the message... "Error when transferring files." PLEASE HELP. Here is a list of what it is able to put on the server... ../publish.htm ../setup.exe ../tes...

Web resources about - "Path cannot be null." Error trying to write DataSet to XML file - asp.net.xml-datasource

Resources last updated: 1/19/2016 3:04:11 PM