I am working on a project that takes an xml schema and xml data files and places them into a DataTable, the 2 files are generated from a working table that i have written to disk. I wish to load these 2 files into a DataTable. Here is What i have
vb.net Friend Function CreateTable(ByVal tableName As String) As Boolean Dim table As New DataTable(tableName) table.ReadXmlSchema(tableName & ".xsd")
this however produces the following error on line 3
System.ArgumentException was unhandled Message=DataTable 'get_item_list' does not match to any DataTable in source.
get_item_list is the parameter passed into this function (tableName)
I am using Visual Studio 2005 and am writing a SSIS package. In the package I have a VB.Script that looks at a directory on a server and creates a list of the files. I then have a store Proc that looks at a table and gets a list of files that matches the files in the first array. The result is a fullresultset. The next step I need to create a 3rd array that only contains the rows from the first that are not in the second. However, I am getting the following error. Error: The script threw an exception: Unable to cast object of type 'System.Object' to type 'System.Collections.ArrayList'.
I've created a new access 2007 database + added a OLE Object field, that i've then pasted images into.in vb2008 I've connected to the database + put the table into a datatable. so far it works ok.when i try to convert the byte array to an image, it causes an error:
'A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll'heres the code i'm using[code]....
I am using Linq to convert an array of any object to a CSV list:String.Join(",", (From item In objectArray Select item.ToString()).ToArray())
This is giving me the strange error: "Range variable name cannot match the name of a member of the 'Object' class."I can get round it by wrapping the string in a VB StrConv method, with a setting of "Nothing":String.Join(",", (From item In oArray Select StrConv(item.ToString(), VbStrConv.None)).ToArray())
However, this seems like a bit of a hack and I would like to avoid it.Does anyone have any ideas when this problems occurs, and any better ways to get round it?
in my project I use an Excel workbook as template. Right now, this workbook is located in the same directory as the exe-assembly and can be opened and manipulated by the user. To avoid this, I thought about adding the workbook to a ressource. That works. Problem: how can I convert the resulting byte-array/stream back to a workbook-object?I tried like this, but - obviously - the conversion fails:
Public Shared Sub test() Dim wkb As Excel.Workbook Dim bytes As Byte() = My.Resources.Template_1
wrote a procedure that accepts as input a parameter of type decimal, or type Long as well as an array type ar() as Boolean. First thing I will do in the procedure is establish just what type of parameter I received. No problem with the scalar types, I'll use the .GetType,determine whether it's Long of Decimal, and assign the parameter I just received to a variable of that type by using convert.toInt64 or convert.toDecimal, then do what I need to do. Not so if the parameter I received happens to be an array. .GetType will tell me what it is, for example returns "system.int64" if its an array of Longs, but then I fail to assign it to a variable for further processing as there appears to be no conversion method to do that.