![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | MoW's blog: "working with csv files part one" works with RC2? Copied the helper functions exactly as is: http://mow001.blogspot.com/2006/03/w...-part-one.html I get an error seemingly from "fill" below: PS C:\> gc mow-getdata.ps1 function get-DataTable { Param ($name ) $cmd = new-object System.Data.OleDb.OleDbCommand("Select * from [$name]",$Conn) $da = new-object System.Data.OleDb.OleDbDataAdapter($cmd) $dt = new-object System.Data.dataTable [void]$da.fill($dt) $dt.TableName = $name.split("#")[0] return $dt } PS C:\> connect-csv c:\ TABLE_NAME ---------- test#csv PS C:\> get-datatable test#csv Exception calling "Fill" with "1" argument(s): "Fill: SelectCommand.Connection property has not been initialized." At C:\mow-getdata.ps1:6 char:17 + [void]$da.fill( <<<< $dt) |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: MoW's blog: "working with csv files part one" works with RC2? > Copied the helper functions exactly as is: > http://mow001.blogspot.com/2006/03/w...-part-one.html > > I get an error seemingly from "fill" below: I did something wrong, likely when loading the scripts/functions. I'm still having problems though. get-datatable doesn't retrun any human readable information at all: PS C:\> . get-datatable test#csv ÿ_n NoName --- ------ PS C:\> gc test.csv name,logon marco,111 shaw,222 PS C:\> import-csv test.csv name logon ---- ----- marco 111 shaw 222 |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: MoW's blog: "working with csv files part one" works with RC2? > PS C:\> . get-datatable test#csv > > ÿ_n NoName > --- ------ I probably need to take more care how I write my .csv files. I think I've gotten a small test working OK now. Marco |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: MoW's blog: "working with csv files part one" works with RC2? Glad you got it going, (I think you mixed unicode / ascii ) I also have some issues with RC2 and returning a DataSet or DataTable, it gets converted to an Array of objects when returned from a function in RC2 it was not like this before, workaround : change : return $dt to: return ,$dt (Note the comma that wraps it in another array ($null,$dt) , that second array gets "stripped off" and the dataset will remain. for the rest I think all works. if you got more problem please let me know Greetings /\/\o\/\/ www.ThePowerShellGuy.com "Marco Shaw" wrote: > > > PS C:\> . get-datatable test#csv > > > > ÿ_n NoName > > --- ------ > > I probably need to take more care how I write my .csv files. I think I've > gotten a small test working OK now. > > Marco > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Offline Files "Change Limits" button not working | Eriq | Vista networking & sharing | 3 | 06-17-2008 08:03 PM |
| OT > The live writer "blog this" button addon For FireFox, does not work now | Joe cann | Live Mail | 1 | 01-26-2008 12:33 AM |
| Works 8.5 in Vista: "Microsoft Works has stopped working" | Maggie472 | Vista General | 2 | 01-11-2008 04:15 PM |
| Internet Explorer 7 for Windows Vista not prompting me to "Open/Run" or "Save" files | Brandon Taylor | Vista General | 2 | 04-01-2007 04:45 PM |
| Blue Screen during the "expanding Files" part of the install | =?Utf-8?B?Q29ybmZsYWtlcw==?= | Vista General | 9 | 09-20-2006 04:35 AM |