|
Unless the admin open up the rights to the Guest account, you're sunk. You simply have no options since the Guest account is not allowed, by default, to do what you want.
|
|
|
|
|
hi, im not very good at deployment and im facing this problem:
I've finished my application and build the executable file using Setup Project. Anytime i want to access the database the application trows an error.
This is my connection:
myConnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Selom\Documents\Visual Studio 2005\Projects\Printing And Copy1\Printing And Copy1\Database1.mdf;Integrated Security=True;User Instance=True")
Please I need help!
Please i need to know what is wrong with my connection.
modified on Wednesday, July 15, 2009 7:12 AM
|
|
|
|
|
Standard Question #1: What's the error message??
Does this path exist on the machine you're installing the app on:
C:\Users\Selom\Documents\Visual Studio 2005\Projects\Printing And Copy1\Printing And Copy1\Database1.mdf
Somehow, I doubt it. For examples of connection strings and what the proper format for each type of connection to each database would be, consult ConnectionStrings.com[^]
|
|
|
|
|
thanks for replying, actually, this my code:
Private Sub frmColour_Copy_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim con = = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Selom\Documents\Visual Studio 2005 \Projects\Printing And Copy1\Printing And Copy1\Database1.mdf;Integrated Security=True;User Instance=True")
Dim cmd As New SqlCommand
cmd.Connection = con
cmd.CommandText = "INSERT INTO customer(cust_name, cust_Age) VALUES( '" + strCustName+ "', '" + strCust_Age + "')"
cmd1.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Error while inserting record on table..." & ex.Message, "Insert Records")
Finally
con.Close()
End If
this code works on the pc it's being developed. the only problem is that after building the executable file using the setup Project and installed on the same machine, it displays the following error:
Format of the initialization string does not conform to specification starting ar index 0
thanks in advance for your help!
|
|
|
|
|
Again, if you didn't change the connection string you used to match where the database is installed on the client machine, you'll get an error like this. You used:
AttachDbFilename=C:\Users\Selom\Documents\Visual Studio 2005 \Projects\Printing And Copy1\Printing And Copy1\Database1.mdf
I'm willing to bet that this path doesn't exist on the machine you installed the app on.
|
|
|
|
|
Again, thanks for replying. You are right about the path.
my only trouble is how to change it so that it works after the installation of the application on any machine.
I have changed it into :
Dim constring As String
constring = Application.StartupPath.ToString() + "\Database1.mdf"
Dim con = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=" + constring + ";Integrated Security=True;User Instance=True")
and selected the option "embedded resource" for the database file but it still not working and giving the following error code:
"An attempt to attach an auto-named database for file C:\Program File\App\Customerdb.mdf failed. A database with the same name exits, or specified file cannot be opened, or it is located on UNC share."
Thanks for replying!
|
|
|
|
|
You cannot use the database if it's an embedded resource. Even if you could, it would be entirely ReadOnly. You wouldn't be able to add any data to it or modify it in any way.
The fullyqualified path to the database file should be either written to a config file at install-time or generated, using well-known folder paths, at run-time. It's then just a simple matter of inserting the path into the connection string when needed.
|
|
|
|
|
Thanks for keep on replying sir. I'm quite lost. can you please give me a very simple and well detailled sample.
Thanks for replying!
|
|
|
|
|
Hi every body i am making a windows application and i need to make a button in my menu bar like in the microsoft word where u can find the recent documents that u have opened so i need to display all the forms that i have opened from the newest till the older and when i click i need to open the document
many thanks
|
|
|
|
|
Basically, you keep a list of the files that were opened/saved, and provide menu-items.
An example on the MRU can be found here[^].
Good luck
What sig?
|
|
|
|
|
Whenever any form is opened in your application, check if it is there in the list of recent items. If not found, add it.
|
|
|
|
|
hi everybody
i really need you guys to help me on it, i'm new to VBA know nuts about it.
currently i'm doing a project using excel and macro.
For example i got a spreadsheet which acts like a data its something like this
Site service package price
A 1 78
A 1 78
A 2 128
B 3 175
B 1 78
C 3 175
C 2 128
then from another spreadsheet there is a button to generate them to
Site Total service Total sales
A 3 284
B 2 253
C 2 303
So how do you loop through the spreadsheet and become something like this??
besides that how do you run the form(created in VBA) when u click on one of the button you created?
Thanks
Veon
|
|
|
|
|
To answer the second question first, write a macro to do the job, then insert a button, assign the macro to the button.
Assuming you are running Excel in Office 2007, you click Insert, Shapes, [A Shape of your choice], Draw the shape where you want it to be, Right Click, Assign Macro.
As to the macro itself, I need to have a think and will come back to you, but it is fairly simple I think.
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
hi thanks for reply =)
just that i want a button that i created, and when it is being clicked it would run the Userform that i have created in VBA. its Userform not spreadsheet
so sorry
thanks
veon
|
|
|
|
|
Design the button you require, save it (as a gif say), then Insert Picture and assign a macro to the picture.
The macro would be...
Sub Macro1
Form1.Show
End
Where Form1 was your form to call.
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
Where can I find documentation about the byte() from RegionData.data. Specifically I am trying to figure out how to get a path from it. The regions I will be creating will have several polygons. I want to use the Region manipulation functions (Union, Exclude, etc.) and then create a path from the resulting RegionData.data.
|
|
|
|
|
I have never used RegionData.Data, but I found some stuff via google[^]. And
here[^] is microsoft's documentation.
|
|
|
|
|
I was looking to try to use the Region class to do some boolean operations on polygons too, not so much for graphics, but for other purposes.
Anyway, I managed to decode the RegionData structure enough to find out that it does not seem to give the resultant set of points after the operation that we are looking for. Essentially, all it appears to contain is the starting region and a record of the operations you have performed. I'm sure there's something buried in GDI+ that actually applies the operations, but I don't think RegionData is it.
For me, it is back to the drawing board.
|
|
|
|
|
I have an Isometric grid that gets drawn to a bitmap bigger then the screen, then the section of it that has been scrolled to is drawn. How can I figure out where on the grid the user clicked? Should I create an invisible normal square grid over the isometric one? It wouldn't perfect but it might work. Please help
Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php
|
|
|
|
|
I would have expected you to track the scroll position and the x/y coords of the mouse click to track where the user is in relation to the grid. I wonder if the scroll an absolute or is it diffetent for different resolution monitors?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thats basically what I'm doing but its an isometric grid (diamonds, not squares) so it isn't quite perfect.
Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php
|
|
|
|
|
Hi I have Visual Studio 2008 installed and I am working on a Windows Form with a menu.
I have builded all the elements of menu File...View ..Edit and also added shortcuts.
Everything seems fine on Ddesign View but when I build -run project I can see only the menu without shortcuts.What's going on??
BR
|
|
|
|
|
If by shortcut, you mean the underlined letter in each menu item, hold down the <Alt> key.
Otherwise, the MenuItems have a ShowShortcutKeys property, set it to true
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I tried with ALT and the property ShowShortcutKeys is set to true but the result is the same.
BR
|
|
|
|
|
Did you put an "&" character in front of the character that you're using as the shortcut key??
|
|
|
|