|
You are referencing dsAllData.Tables(0)...but does your DataSet have a table in it yet? I'm not familiar with the DataSet.ReadXML so I wasn't sure if that would automatically setup the tables for you... I would set a breakpoint on the line that is causing the error and take a look at what your DataSet object contains.
Hope this helps.
|
|
|
|
|
I wish to persist some user settings such as a list of filenames and thought My.Settings would be the best way to go. However, the number of filenames in the list is unknown. For example...
Setting...
Name Type Scope Value
File1 String User "filename_1"
File2 String User "filename_2"
File3 String User "filename_3"
. . . .
. . . .
. . . .
Filei String User "filename_i"
Where 'i' is unknown at design time. Each time the app is run 'i' may get bigger or smaller.
Is it possible to add and delete user scope settings in My.Settings at runtime?
If not is there a better alternative?
Cheers
Tim
|
|
|
|
|
You are probably looking for the definition of an array!
simply have:
Dim Files() as String, NumberOfUsers as Long
Dim i as long
'Here write the code to get the number of users
Redim Files(NumberOfUsers)
For i=0 to NumberOfUsers
Files(i) = "filename_" & i
Next
|
|
|
|
|
Thank you for your response. Unfortunately you misunderstood my question.
Your response, however, did get me thinking what are the available data types in My.Settings and I found that there is a StringCollection type and this is exactly what I am after .
Thanks for the push in the right direction.
Cheers
Tim
|
|
|
|
|
Hi all
I would like to use the DirListBox, DriveListBox and FileListBox controls in Excel.
I used them in Visual Basic 6.0 (they are alsoa known as File System COntrols).
Do you know if it is possible and how to import these control in Excel forms without having Visual Studio or Visual Basic installed on the machine?
Regards
ManuStone
|
|
|
|
|
Without VB6, those controls don't exist. They come with VB6, so you'll have to get them off of a machine that has it installed. But, there may be a licensing issue here. I don't know if you'll be able to use the controls because of a possible designer license issue. You'll just have to try it and see. Copy the controls to the Windows\System32 folder, then register them using REGSVR32.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave!
Ach...I imagined it that could be an issue like this!!
Despite this I will do an attempt;
thank you very much for your response!!
Have a Nice day
Manu Stone
|
|
|
|
|
Hi,
I have an ASP page that draws up a report and display it to the user. If the user wishes to do so, he can click a "print" button which activates the printer dialog via javascript. This would be the same as if they selected "File > Print" from the browser menu.
My problem is that at hte top of the page, page numbers are added automatically, and at the bottom the URL of the page that was printed. Is there a way to get rid of this extra information, so that a "clean" document can be printed with only the results from the report.
Any help would be appreciated,
Thanks.
Mr.mark
|
|
|
|
|
You might get an answer if you ask this in the ASP.NET Forum. Your question has nothing to do with VB/VB.NET.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Problem:On Adding a control to designer at a specified Mouse Position
Effect: Control moves to some Default Position
Expected Result:Control should be placed on those specified co-ordinates where mouse pointer is pointing
Jhony
|
|
|
|
|
Drop all the "Problem, Effect, Expected..." garbage and just ask the question.
Are you seeing this with all the controls or just certain ones, which ones? Which version of VB.NET are you using? Are the controls snapping to a grid if you move them around with the mouse?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am working on a complex project. To make it easier I decided to produce some components in 4 different namespaces. These components were later imported in to the main project with an import statement at the top of the main project.
The program works well and i was considering writing all my projects as classes and components until this afternoon when i decided to deploy.
I produced the installer without error. I was able to install in another computer but the program just would not run in this second computer. The error message was
Processid=0x5e8(1512), thrad id = 0x2dc(732)
what does this mean and what did i fail to do.?
ihe
|
|
|
|
|
It sounds like your .DLL's for your components didn't get added to the installation, or are not installed where the Loader can find them.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
So what am i to do ?
The latest build history is :
------ Rebuild All started: Project: DriLCaLc Installer, Configuration: Debug ------
Building file 'C:\Program Files\NAWA\DriLCaLc Installer\Debug\DriLCaLc Installer.msi'...
WARNING: This setup does not contain the .NET Framework which must be installed on the target machine by running dotnetfx.exe before this setup will install. You can find dotnetfx.exe on the Visual Studio .NET 'Windows Components Update' media. Dotnetfx.exe can be redistributed with your setup.
Packaging file 'NAWADrilcALclLibrary.dll'...
Packaging file 'DriLCaLc.exe'...
Packaging file 'NAWADrilcALclLibrary.dll'...
Packaging file 'InstMsiW.Exe'...
Packaging file 'Setup.Exe'...
Packaging file '3box.ico'...
I noticed that the 'NAWADrilcALclLibrary.dll' is twice so i decided to prepare a merge module it made the matter worse. So what am i to do
ihe
|
|
|
|
|
Why are there two .DLL's with the same name in your Setup Project?? Where did both of them come from and where are they being installed??
If you're app is using 4 different library .DLL's, I only see one in this project. You're missing 3 of them. You'll have to straighten out your duplicate .DLL problem and add the other three missing assemblies to your Setup Project, at least.
Adding Items to a Deployment Project[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Because of the difficulty I experienced I decided to rewire the program a little
The original Windows Application had 4 Windows Control Library it needed to function properly.
I decided to lump all the user control inside a single WindowControlLibrary.
This is what I did:
I created a project in vb.net using a WindowsControlLibrary I called it NAWADriLCiLibrary.
It houses several user controls that are all used in a WindowsApplication1 I call DriLCalLc.
The database is in MS Access and is called Hydraulic.mdb
The database is in the window application.
The command buttons to save, edit, delete into the records of this hydraulic database are in the window application. These buttons are linked to methods and property of the user controls in the windowControlLibrary.
In my developer PC after I have produced the NAWADriLCiLibrary I build it, using the build menu – build solution on top.
Then I copied the NAWADriLCiLibrary.dll generated from the NAWADriLCiLibrary/bin/ NAWADriLCiLibrary.dll into the DriLCalLc folder. After this I set a reference in the code of DriLCalLc pointing to this. I did this by right clicking the add reference and selecting this .dll when the “add reference “box came up. To enable me use it in my code I then at the top of the code add an import statement
Imports System.Drawing
Imports System.Windows.Forms
Imports NAWADrilcALclLibrary
Public Class Form1
End Class
What am I required to do? How should I produce my Installer?
Also thank you for your guide I will read the text at the hyperlink now.
ihe
|
|
|
|
|
Do not set a reference to the .DLL file itself. Make your control library project part of the same solution as your application. In your application project, set the reference to the control library project. Do NOT copy .DLL's into the bin folders of your windows app project. This will lead to "unable to find version errors", or problems where you make a change to the library code and can't figure out why the changes don't show up in your windows app.
To this solution, add your installer project. Pick the Setup Wizard to make this a little easier and make sure you add the Primary Output from both the Windows application and Control Library projects.
That should about do it...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you very much for your help.
I did exactly as you directed. The build history is as below:
------ Rebuild All started: Project: NAWADrilcLclLibrary, Configuration: Debug .NET ------
Preparing resources...
Updating references...
Performing main compilation...
Building satellite assemblies...
------ Rebuild All started: Project: DriLCaLc, Configuration: Debug .NET ------
Preparing resources...
Updating references...
Performing main compilation...
Building satellite assemblies...
------ Starting pre-build validation for project 'DriLCaLc Installer' ------
------ Pre-build validation for project 'DriLCaLc Installer' completed ------
------ Rebuild All started: Project: DriLCaLc Installer, Configuration: Debug ------
Building file 'C:\Program Files\NAWA\DriLCaLc Installer\Debug\DriLCaLc Installer.msi'...
WARNING: This setup does not contain the .NET Framework which must be installed on the target machine by running dotnetfx.exe before this setup will install. You can find dotnetfx.exe on the Visual Studio .NET 'Windows Components Update' media. Dotnetfx.exe can be redistributed with your setup.
WARNING: Two or more objects have the same target location ('[targetdir]\nawadrilcalcllibrary.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\nawadrilcalcllibrary.dll')
Packaging file 'NAWADrilcALclLibrary.dll'...
Packaging file '3box.ico'...
Packaging file 'MudCirculatorySystem.rtf'...
Packaging file 'NAWADrilcALclLibrary.dll'...
Packaging file 'Setup.Exe'...
Packaging file 'InstMsiW.Exe'...
Packaging file 'DriLCaLc.exe'...
Packaging file 'Hydraulics.mdb'...
Packaging file 'InstMsiA.Exe'...
---------------------- Done ----------------------
Rebuild All: 3 succeeded, 0 failed, 0 skipped
I noticed that it runs on my developer PC ( before this time if I remove ALL source code and install in my developer PC it would not work.) Now it works. Thank you
How ever I tried to test it on another PC that I have. It installs very well no error but when I try to run it I get the following result.
See the end of this message for details on invoking
Just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for "DriLCaLc.Module1" threw an exception. ---> System.InvalidOperationException: The .Net Data OLE DB Provider(System.Data.OleDb) requires Microsoft Data Access Components(MDAC) version 2.6 or later. Version 2.53.6306.0 was found currently installed.
at System.Data.OleDb.OleDbConnection.CreateInstanceMDAC()
at System.Data.OleDb.OleDbConnection.GetObjectPool(Boolean parsing)
at System.Data.OleDb.OleDbConnection.CreateProvider()
at System.Data.OleDb.OleDbConnection.Open()
at NAWADrilcALclLibrary.Properties_Mud..ctor()
at DriLCaLc.Form1..ctor()
at DriLCaLc.Module1..cctor()
--- End of inner exception stack trace ---
at DriLCaLc.Splash.Splash_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
DriLCaLc
Assembly Version: 1.0.2461.13417
Win32 Version: 1.0.2461.13417
CodeBase: file:///C:/Program%20Files/NAWA/DriLCaLc/DriLCaLc.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/winnt/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
NAWADrilcALclLibrary
Assembly Version: 1.0.2461.13419
Win32 Version: 1.0.2461.13419
CodeBase: file:///C:/Program%20Files/NAWA/DriLCaLc/NAWADrilcALclLibrary.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/winnt/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/winnt/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/winnt/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
What does it mean?
I tried the whole process again and tried another PC . It also installed well and it also threw this message:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for "DriLCaLc.Module1" threw an exception. ---> System.InvalidOperationException: The .Net Data OLE DB Provider(System.Data.OleDb) requires Microsoft Data Access Components(MDAC) version 2.6 or later. Version 2.53.6200.0 was found currently installed.
at System.Data.OleDb.OleDbConnection.CreateInstanceMDAC()
at System.Data.OleDb.OleDbConnection.GetObjectPool(Boolean parsing)
at System.Data.OleDb.OleDbConnection.CreateProvider()
at System.Data.OleDb.OleDbConnection.Open()
at NAWADrilcALclLibrary.Properties_Mud..ctor()
at DriLCaLc.Form1..ctor()
at DriLCaLc.Module1..cctor()
--- End of inner exception stack trace ---
at DriLCaLc.Splash.Splash_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///f:/winnt/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
DriLCaLc
Assembly Version: 1.0.2461.14474
Win32 Version: 1.0.2461.14474
CodeBase: file:///C:/Program%20Files/NAWA/DriLCaLC/DriLCaLc.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///f:/winnt/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///f:/winnt/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
NAWADrilcALclLibrary
Assembly Version: 1.0.2461.14475
Win32 Version: 1.0.2461.14475
CodeBase: file:///C:/Program%20Files/NAWA/DriLCaLC/NAWADrilcALclLibrary.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///f:/winnt/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///f:/winnt/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///f:/winnt/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
Also I have some questions to ask
1: What if I am developing the User control for third party use and do not want to share my source code.
2: How can I install the dotnetframework at the same time to avoid the message that always appears in my deployment build history?
Message:
WARNING: This setup does not contain the .NET Framework which must be installed
3: If the developer of the window application is not privy to the source code of the WindowControlLibrary How would the developer of the window application use this .dll
Thank you for your patience.
ihe
|
|
|
|
|
ihe wrote: System.TypeInitializationException: The type initializer for "DriLCaLc.Module1" threw an exception. ---> System.InvalidOperationException: The .Net Data OLE DB Provider(System.Data.OleDb) requires Microsoft Data Access Components(MDAC) version 2.6 or later. Version 2.53.6200.0 was found currently installed.
This means that the machine needs MDAC 2.6 or better installed and it doesn't currently have that. It's a requirement of the .NET Framework so you have no choice but to upgrade it. You can get the latest versions here[^].
ihe wrote: 1: What if I am developing the User control for third party use and do not want to share my source code.
Then look into an obfuscation utility to make it harder to read. You can't encrypt it or make it the code can't be seen, but you can make it harder to read. The Professional version of Visual Studio .NET (and higher) comes with Dotfuscator, Community Edition. You can buy the Professional Edition, but I don't remember what it costs.
ihe wrote: 2: How can I install the dotnetframework at the same time to avoid the message that always appears in my deployment build history?
You can add a Merge Module to the project to get rid of the warning. Right-Click your installer project name, click Add..., then Merge Module... In the list that comes up, find dotNETFXRedist_x86_enu.msm and click on it, then OK.
ihe wrote: 3: If the developer of the window application is not privy to the source code of the WindowControlLibrary How would the developer of the window application use this .dll
The same way we any of the .NET Framework classes. Your .DLL (assembly) is just another set of classes. The developer adds a reference to your .DLL, then either imports its namespace or adds your control(s) to the toolbox.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Hi all,
I'am thinking if there's someway i can call an vb exe file when i try to access a certain folder, like at first your gonna select a folder where you're goin to bind your exe, then when u try to access that folder your exe will be launched instead of windows showing the content of that folder...
-::maximus::-
|
|
|
|
|
I doubt that is possible, if it is, it would involve a system wide hook. Not sure you can hook on the opening of a folder.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I don't know of any way to do this. It MAY be possible by writing a Shell Extension (warning! This involves LOTS of COM interop), but I don't know of any examples that are triggered by the selection of a folder, or anything else for that matter.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I don't know if this would work, but if you were to hide the folder and create a shortcuct to your program with the shortcut named the folder name and the folder icon. So when the user clicks on the what they think is the folder, it opens your program, and say, if your program is already open, it just redirects to the folder or something.
Posted by The ANZAC
|
|
|
|
|