Groups | Blog | Home
all groups > dotnet distributed apps > november 2007 >

dotnet distributed apps : VERY NEW to VB .NET need help with a dll


Randy
11/9/2007 12:44:01 PM
refLateChargesTableAdapterI am very new to VB .NET and I am having some
trouble. I want to create a DLL file that will house functions that other
systems can call. My major problem is that these functions need to use
tables to do their processing and I want the tables to be in the dll so that
I can distribute the dll to the various networks that are in my company. I
read that DLL files can contain tables as well as code and I have
successfully put tables in the dll project I created but I have no ideal how
to connect to these tables from my functions.

The tables are in a dataset called 'Dataset1'. The first table I am trying
to access is called 'refLateChargesTable'. I don't know what a
connectionstring would look like for these tables.

Any help would be appreciated.

Thanks,
Mohamad Elarabi
12/18/2007 3:01:01 PM
I'm trying to understand what exactly you're trying to do. So far I think
you're trying to use a dataset as a dynamic resource inside a DLL. This I
think isn't possible, although I don't have much experience doing that but I
believe that once a DLL is compiled it is really no longer changeable without
a recompile. So unless you're storing static data, you might need to
reconsider your approach to maybe accessing an XML file or a similar resource
type that is detached from the DLL itself.

You can however add the XML file (or the like) to your setup project to be
deployed alongside your DLL. This way it is guaranteed to be there, next to
your DLL in production.

In case your have a DataSet called MyDataSet here is code you'll need to
write to extract data out of your table.

This example select all rows with a charge over 50 dollars and sorts them by
the charge value descendingly.

Dim MySelectResults As DataRow()
MySelectResults = MyDataSet.Tables("refLateChargesTable").Select("Charge >
50","Charge Desc")

For Each oRow As DataRow In MySelectResults
MsgBox(oRow.Item("ID"))
Next

Also check http://msdn2.microsoft.com/en-us/library/way3dy9w.aspx for
additional examples.

Hope that helps.

--
Mohamad Elarabi
Lead Developer. MCTS, MCPD.


[quoted text, click to view]
AddThis Social Bookmark Button