|
Hi All.
I am new here.I have a Visual Basic 2010 project.In this project I connect to Access 2007 DB File.Everything Is OK.Now I Want to publish this project.It is not ok and I have error message that "Unhandled Exception has occurred in your Applicaiton......"
I know application can't connect to access file but I don't know how to solve.
Please help me.
Thanks
|
|
|
|
|
Nguyen Tuan Anh wrote: Unhandled Exception has occurred in your Applicaiton This tells you that something fatal happened, and your application has not been written to trap and report the error properly. Exceptions should be caught in Try ... Catch blocks, and information reported to the user about what is happening, and where. If you don't know where the error occurred then you will need to run your application in the debugger to find out. Once you have done that you should be able to discover why the error occurred. See http://msdn.microsoft.com/en-GB/library/fk6t46tz.aspx[^] for more information.
|
|
|
|
|
Everything is OK before I Publish.After publish I Think Application can't connect to DB because it is not include in the setup file or .....that i don't know.
|
|
|
|
|
Nguyen Tuan Anh wrote: or .....that i don't know. Well I am afraid there is no way anyone here would know. It is no good trying to guess what is wrong. You need to do some serious debugging of your application to find the problem and fix it properly so it does not happen again, or if it does, that it produces some useful information about the exception.
|
|
|
|
|
Hopefully, you didn't put the Access database in the same folder as your application under Program Files. If you did, the Program Files folder, and everything under it, is READ ONLY to normal users. They won't be able to open the Access database because of that.
You have to put the Access database in a folder more appropriate, such as under CommonApplicationData[^] somewhere.
|
|
|
|
|
Yes.
After I Publish.
1. I run Settup.I Install my application to the folder.
2. I copy access file to this folder at the step 1 then application run.
Question 1. How to manual the folder at the step 1?
Question 2. How the settup include the DB file?
|
|
|
|
|
I have no idea what you're talking about. "the folder" and "this folder" do not tell me EXACTLY which folder you're talking about.
Nor do I have any idea what you're using to package up your application into a Setup.
|
|
|
|
|
I Mean The Folder after I Install the application.
My Skype: nguyentuananh921
Please help me.
|
|
|
|
|
|
How do you create your setup project / which tools do you use for that?
Where do you define the connection string to the database?
Do you adjust that when the user executes the setup?
|
|
|
|
|
This is My First Project that connect to DB so I am not sure, just use the publish tool in Visual Studio 2010.
Please leave your Skype ID so I can ask you more detail.
Thanks.
|
|
|
|
|
I finish my application on vb.net 2013. After I have used a software called .NET reactor to protect my .exe file .
This software put these protection :
Necrobit
Anti ILDASM
Anti Tampering
Control Flow Obfuscation
String Encryption
After , I run Ngen with the protected .exe file , and I get an error :
NGEN failed because of the following error :
The module was expected to contain an assembly manifest.
What can I do ?
Thank you !
|
|
|
|
|
Try contacting Eziriz support. You've paid for a commercial tool, so I'd expect them to support it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I just have a question ( because I don't know very well how ngen works and if is change something to .exe file )
My question is :
If I have 2 version of exe file : one protected and one unprotected.
If I run ngen on user's computer with the unprotected .exe.
After can I use the protected exe ?
Thank you !
|
|
|
|
|
You'll be able to run the protected exe, but it won't have a pre-compiled native image, as it's a different assembly.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Quote: Hi everyone!
I'm making an application which requires users with different permissions/previleges to login and use the application.For example, if the user is "admin", all menu items in the menu bar are shown and enabled. If the user is say "user_group1", some of the menu items are to be hidden. The same for "user_group2", "user_group3", "user_group4" and so on.
I could put a code for each specific user in each form but that's a great deal since users and their user groups may be added after application deployment. So it has to be something flexible.
I want the user "Administrator" to be able to assign/change permissions to others users of the system.
How do I do this?
I have been thinking of creating a table that will include user_groups and permisions, say like a row: user_group (user_group1, user_group2,user_group3) and permission (File,Edit,Backup,Manage Users (these being menu items)) and then for each user I will be setting either "Yes" or "No" under each permission/menu item indicating that the menu item is to be hidden of shown.
But, I can read these permission to a dataset but I can't see how to link them with the menu items.
How should I accomplish this please?
What I have done so far:
I had to come up with 5 tables just for this, as a result, I can run an SQL query that will bring a user and the menu items which he/she is supposed to see. I have attached an image showing the results of such a query. Now I need to take what is in the table and effect it by enabling only the shown menu items ('permissionName' in my table). How can I? Since I have them in a dataset, is it possible to do some loop to accomplish that?
Sorry, it seems I can't upload an img in codeproject.com
|
|
|
|
|
savedlema wrote: How do I do this? Read up on roles, groups and users. There's an awfull lot of people who faced the same problem and who left an incredible amount of knowledge to start from.
savedlema wrote: But, I can read these permission to a dataset but I can't see how to link them with the menu items. You check what role someone is in, and only create those menu-items that are required for that specific role. That part would be done when you build the form.
savedlema wrote: I can run an SQL query that will bring a user and the menu items which he/she is supposed to see Good; create menus with those items
savedlema wrote: How can I? Since I have them in a dataset, is it possible to do some loop to accomplish that? Looping a dataset should not be a problem; Your question basically boils down to creating a menu-item during runtime. There's MSDN, Google, and the keyword "menu".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks a lot Eddy, but look, I'm not going to just create menu items at runtime, I have my menu items in a MenuStrip already. ToolStripMenu items are also stored in the database and will be fetched together with other items when I run a query to bring up a user and a list of menu items that he is allowed to see.
My problem is to take these permissions from a dataset/table and effect them by actually hiding and showing some menu items among many existing menu items.
To explain more, if the result of my query for permissions of "user5" is "FileToolStripMenuItem", "FileEditToolStripMenuItem" and "FileBackupToolStripMenuItem", now, how can I programmatically enable only those menu items in my MenuStrip1?
|
|
|
|
|
savedlema wrote: but look, I'm not going to just create menu items at runtime, I have my menu items in a MenuStrip already. Not very secure; what if (due to a bug) some items aren't hidden? It'd be better to create just the items you need in the first place.
savedlema wrote: now, how can I programmatically enable only those menu items in my MenuStrip1? Set the Enabled[^] property, e.g. "FileToolStripMenuItem.Enabled = false".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello !
I finish my application in vb.net 2013.
Now if I run the application (The final .exe outside Visual studio ) on my computer where I have created the application , everything works ok.
I install my application on another computer.But when I try to run I get an error :
Unable to find an entry point named "Draw ThemeBorder" on DLL "uxtheme.dll".
The application is created for .NET 4.0 (installed on both computers ).
Both computers have Windows 7 x32.
What can I do ?
Thank you !
|
|
|
|
|
|
Ok , but why I'm getting this message only on one computer. This is a problem with System or a problem of my program ?
Thank you !
|
|
|
|
|
Hello !
I found that the problem is the following Sub that is run when the main form is loaded :
Public Sub DoPrecompile()
For Each an As System.Reflection.AssemblyName In System.Reflection.Assembly.GetEntryAssembly().GetReferencedAssemblies()
Dim asmb As System.Reflection.Assembly = System.Reflection.Assembly.Load(an)
If Not asmb.GlobalAssemblyCache Then
For Each type As Type In asmb.GetTypes()
If Not type.IsInterface AndAlso Not type.IsGenericTypeDefinition Then
Dim ci As System.Reflection.ConstructorInfo = type.GetConstructor(System.Reflection.BindingFlags.[Static] Or System.Reflection.BindingFlags.[Public] Or System.Reflection.BindingFlags.NonPublic, Nothing, type.EmptyTypes, Nothing)
If ci = Nothing Then
For Each method As System.Reflection.MethodInfo In type.GetMethods(System.Reflection.BindingFlags.DeclaredOnly Or System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.[Public] Or System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.[Static])
If Not method.IsAbstract AndAlso Not method.IsGenericMethodDefinition AndAlso Not method.ContainsGenericParameters Then
System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod(method.MethodHandle)
End If
Next
For Each prop As PropertyInfo In type.GetProperties(BindingFlags.DeclaredOnly Or BindingFlags.NonPublic Or BindingFlags.[Public] Or BindingFlags.Instance Or BindingFlags.[Static])
For Each accessor As MethodInfo In prop.GetAccessors(True)
If Not accessor.IsAbstract AndAlso Not accessor.IsGenericMethodDefinition AndAlso Not accessor.ContainsGenericParameters Then
System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod(accessor.MethodHandle)
End If
Next
Next
End If
End If
Next
End If
Next
End Sub
If I remove this Sub everything is ok.
But on the computer where I have created the application everything works ok even with this Sub.
On another computer I have this error message.
|
|
|
|
|
You have not shown where the error occurs so it's difficult to guess. However it is quite possible that on the computer where the error occurs the version of the DLL in question is not the latest.
|
|
|
|
|
I'm copying a table from word then pasting the copied table in an Excel file.
Here is a code sample:
tbl.Range.Copy()
oSheet.Activate()
rng = oSheet.Range("A1")
rng.Activate()
rng.PasteSpecial(Excel.XlPasteType.xlPasteAll)
But when I do this, the table is pasted as a picture.
can anyone please help me with this?
|
|
|
|