|
the easiest way to create custom installation programs is to get DevStudio from InstallShield. Visual Studio used to ahve a copy that worked with C++. I haven't seen it with VS 2005(but I haven't looked that closely either). As far as customizing the setup wizard that comes with VS, it's very limited.
|
|
|
|
|
well , thanks i got all the first paragraph but actualy what i didn't get is that line :
My.Computer........
this is how we declare a connection object :
Public Con As New SqlConnection("workstation id=ORDI_AMINE;packet size=4096;integrated security=SSPI;data source=ORDI_AMINE;persist security info=True;initial catalog= GHotel")
now can you tell me how to do that
i added the two files "MyDataBase.Mdf" & "MyDataBase.Ldf" to application folder in an other folder that i had created in & i named it Data
so now i have ApplicationFolder\Data\"MyDataBase.Mdf" & "MyDataBase.Ldf"
tell me please how to make that work
GHotel : is My Data Base
ORDI_AMINE : is the name of ma PC
aahhh !! i forgot , i tried to write localhost instead of ORDI_AMINE & it doesn't work
please try your best with thanks
try to be good if you can't be the best
|
|
|
|
|
Sorry....I should have specified that the My.Computer....code only works in Visual Studio 2005. To do this in Visual Studio 2003 you can use this:
System.IO.Path.GetDirectoryName([Assembly].GetExecutingAssembly().GetName().CodeBase)
But you will need to include Imports System.Reflection
I'm not familiar with your method of creating a connection. Whenever I make a connection object I give it the full file path to the database file. Like in this connection string:
<br />
strDataBaseLocation = "C:\Program Files\MyApplicationData\MyDataBase.mdf"<br />
strConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename='" & strDataBaseLocation & "';Integrated Security=True;Connect Timeout=30;User Instance=True"
But since users may want to install to a different location, I just make sure that my database is always in the same relative location to my .exe.
Does this help you any? I just don't understand how your program knows where your database file is without the full path in the connection object.
|
|
|
|
|
Oh yeah sure i learned a new way to declare connection thank you
but actualy the f***en problems stills the same it doesn't want to work
i think it want to jock i will break the f***en mind of this PC
actualy i don(t understand too how it can know the way of the database without giving it the location
but i think it knows the server & the server show the way to this stupide programme
well i will thank you a lot if you can speak all the code you wrote abt that new classes & assemlies & stuffs plus i want to tell you that i added the two files Mdf & Ldf
to the application file in the deployement project
i hope this will work later when we know how to tell him to attach a database
i hope you want to help me & thank you for all what you did for me
try to be good if you can't be the best
|
|
|
|
|
I have a DataGridView control in a Windows Application project with the first three columns being image columns. (They contain icons for navigating to other forms for editing, viewing, and deleting) There isn't a property to set on these columns for changing the cursor from the default arrow into a hand, so I wrote the following code to manually make that happen:
Private Sub gvMast_CellMouseEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles gvMast.CellMouseEnter
Select Case e.ColumnIndex
Case 0, 1, 2
Select Case e.RowIndex
Case -1 'Header row
Cursor = Cursors.Default
Case Else
Cursor = Cursors.Hand
End Select
Case Else
Cursor = Cursors.Default
End Select
End Sub
Private Sub gvMast_CellMouseLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles gvMast.CellMouseLeave
Cursor = Cursors.Default
End Sub
The problem I'm having is that after the user sorts a column by clicking in the header row of the DataGridView, this code doesn't work anymore. The cursor remains the default arrow. Debugging is a mess because everytime you hit a breakpoint you will hit the CellMouseLeave event, but it appears to be hitting the code that sets the hand cursor.
Anyone have any ideas?
|
|
|
|
|
Your code looks good. Is it possible that your sort is causing you to loose focus on the gridview? The way I get around break points is to fire a Messagebox.show method with the information I'm looking for.
Add: Messagebox.show(e.columnIndex + vbCrLf + e.RowIndex) into your cellmouseenter event and that will get the values displayed before you leave it. That will at least let you know what values are being passed to it. If none are being passed, then your control isn't capturing the mouseenter and mouseleave events.
|
|
|
|
|
Using a messagebox doesn't work either, since after you click okay on the messagebox it hits the cell mouse enter method again...creating a loop. But working off this idea I added code to change the text of a label instead. Every place I changed the cursor in code I added a different message to change the label text to. It appears as though it is hitting all of the code correctly, it is just not displaying the hand cursor. (My label text gets changed to the word "HAND" appropriately)
I'm still at a loss.
|
|
|
|
|
Interesting. I'll have to play around with that a bit and see if I can reproduce it.
|
|
|
|
|
Hi all. I'm in the process of updating a dataset to my web app. Here is the scenario...
I added a location field to the 'clients' table in the database. The database is already represented in the .xsd file. I added the location field to the table in the .xsd file. I bound the field to a text box in one of the web screens (this screen has client name, id#, and location (new field)). I also had to update 2 stored procedures (clients_add, clients_modify) to include the location field name.
Now that the changes were made, I cannot update an existing client via the web interface. I can still add a new one though. I even tried to remove all the changes I made in hopes of reverting it back to the previous state - no luck. Please let me know if you have any ideas. Thanks.
- J
-- modified at 12:06 Wednesday 24th May, 2006
-- Edit: there is a 'managers' table in the dataset too. I have not touched it, and the edit piece is still functioning correctly. Not sure if this helps.
|
|
|
|
|
The first thing i would do is start ruling out different aspects of the process.
Load up SQL Profiler and watch the commands that come through fromthe website. You should see it execute the stored procedures as you modify them. It will also let you knwo what parameters are being passed. Make sure they're correct. If not, it will give you an idea of where the problem is in the page.
If everything is hitting the SQL server correctly and the stored procedure is failing, then use Query Analyzer to step through the stored procedure. Use the same variables you used in the initial test so that you can narrow down where the issue is. Also, don't forget that SQL is case-sensitive.
HTH
|
|
|
|
|
Thanks. That helped me find out the sproc is getting called. I also ran the sproc manually and it completed correctly. However once the sproc runs, the data isn't getting transferred into the database. Any other ideas? Thanks in advance.
- J
|
|
|
|
|
If you run it manually and it works, but doesn't run properly from code, then there's an issue with how the code is calling it. Make sure you have all of the connection strings correct, the SP spelled correct and all expected parameters are formatted correctly.
If you go back to the profiler, you can adjust the settings to show every time something attaches to the database and what's being passed. If you click the button on the form and nothing shows up in the log, then theres an issue with the connection string. If a connection shows up in the log, but the sp is never called, then it's probably spelled incorrectly. If the sp is called but never runs, then there's probably an issue with the parameters.
A way to test your parameters is to hardcode the parameters into your button and click it. If it runs that way, then add one variable parameter at a time until it no longer runs. Keep in mind that certain data types need certain formatting on the parameter side. A way to verify this is using named parameters (which you should already be doing to prevent SQL Injection).
Let me know if that works.
|
|
|
|
|
The profiler lists the following when the sproc is called...
exec sp_executesql N'EXEC Clients_Modify (parameters following - they are correct)
Does this mean the sproc has run or has been called?
Sorry for the extra questions, I'm fairly new at this. Thanks.
|
|
|
|
|
There should be another column that shows something like batch started, batch comleted, etc. Theres several entries that it goes through in order to be considered complete. If memory serves, it's batch started -> statement started -> statement completed (may loop here) - > batch completed.
If there isn't a lot of information on your trace, stop it and open the properties. Click on the Events tab and add more parameters. The parameters will be displayed in your trace so you can easily see what is what. If you're not real familiar with what each one does, just add everything that looks like it would hit and the run it. Go through and read the information and pull out the categories that don't really apply.
I'd recommend you spend some time playing with profiler to get very familiar with it. It can save you a LOT of time in debugging issues when you're accessing a database.
|
|
|
|
|
Thanks for the info about the Events tab. It helped me narrow down the issue. It was in regards to the parameters. Thanks again!
- J
|
|
|
|
|
In a treeview I have several nodes. Depending on which node the mouse hovers over a contextmenu appears and stays there until I click the mouse away from that node. The problem is when I hover over the next node the prior contextmenu is still there. It does not disappear until I click my mouse. Is there a way to fix this?
"The things that will destroy us are: politics without principle; pleasure without conscience; wealth without work; knowledge without character; business without morality; science without humanity; and worship without sacrifice."
-Mahatma Gandhi (1869-1948)
|
|
|
|
|
I would like to develop a custom control that holds cross-tab information. Developed, maybe, by inheriting from datagrid. It would be a cross-tab of the number of apointment slots available at a particular time and on a particular day. Has anyone ever done something like this?
How would I start?
SannQuest
|
|
|
|
|
Hi,
I have an intranet application that uses remoteserver to access the Business and Data Access layer. The remoteserver is singleton. The application is working fine but with time the remoteserver size in memory increase and then closes down throwing OUT OF MEMORY exception. The size when it is started is 30 MB but within hours it grows to 1 GB.
Can any one help me solve this problem?
|
|
|
|
|
It sounds like you're loading classes multiple times and not calling the dispose method. These are very tricky to diagnose. I would start it up on your development PC and track the resources being used in the locals window.
|
|
|
|
|
Since it is Singleton the objects are created when there is a call and all future calls are served by the same object. I have used memory profiler and it shows only 1 instance of each object so that is not the issue.
|
|
|
|
|
Yes, Singleton will have only one instance of that class running. However, that's not to say that the objects within it aren't spawning out of control. Using memory profiler will show the full memory useage of the class itself. It won't let you break down the different components. That's why I suggested to use the locals window of VS.
|
|
|
|
|
Seems you are correct. The Handler class that communicates with the UI and DatAccess layer has more than 1 instance which I think should not happen if Remoteserver is Singleton. What do you say?
|
|
|
|
|
hmmmm....I can't think of any "good" reason for it to have multiple instances. Theoretically, the app should only have one data _connection_, but could spawn off new instances until it runs out of memory. Considering that it's singleton, it should only be able to use one instance at a time. Try creating your instance in a global scope and see if that helps. either that, or add a dispose to instance each time it's called. That will mark it for cleanup through the garbage collector. Either way should narrow that down to one active instance. Once that's done, I'd recommend scanning the app again for any other objects that are being handled in a similar fashion.
|
|
|
|
|
Hello,
I have a form with a tab control on it with 5 different tabs. Each tab pulls data from a database. When the tab control is loaded, the first tab is automatically selected. If I go to tab 4, I can see data on that page as well.
I have a command button that saves data to a local database, however, it only saves the data on tabs that I have viewed. How do I set up the tab control so that data can be passed to a database whether or not the tab has been accessed?
Thanks,
Rashar
|
|
|
|
|
how can i change form skin (theme) using dll file
i mean when i run my form under XP my theme form will be vista them with out change windowa
origenal theme .
|
|
|
|