|
DJLarZ wrote: The reason I need this is that I use openfiledialogs and savefiledialogs which changes the current directory, and I have stored help files relative to the program path.
You should not be worrying about what the current directory is. You should be using absolute paths ALWAYS when dealing with files. You can always get the applications directory by using:
Dim appDirectory As String = Application.StartupPath
You can make a fully qualified path name by using something like this:
Imports System.Io
.
.
.
Dim myHelpFilePath As String = Path.Combine(Application.StartupPath, "myHelpFile.hlp")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you very much, all of you, it solved my problem.
----
Dim Sleepy as Boolean = True
If Me.Sleepy = True Then
Goto Sleep
End If
----
|
|
|
|
|
:-OHi - I have installed Visual Studio.net 2003 and it is working well with a few irratating exceptions that I cant solve - the books asume this knowledge so I I'm stuck.
First problem - in debug mode hovering the curser over a varable name in older versions gave the VALUE of the varable, in my setup I get a definition of the varable which is of no interest to me - how do I change the setup to get actual runtime values?
Second - There is no Draw toolbox - I have all the controls etc but I cant draw a line or a circle etc on a form - where is this hiding (its not in the available tools from the add dropdown).
H e l p! (please )
VB.net newbe
|
|
|
|
|
yorickthefirst wrote: First problem - in debug mode hovering the curser over a varable name in older versions gave the VALUE of the varable, in my setup I get a definition of the varable which is of no interest to me - how do I change the setup to get actual runtime values?
You don't change anything. You're getting the definition because the code either was not stopped (hit the pause button next to the run button), or your code was stopped and your trying to get the value of a variable that is no in scope. You code was stopped in one method (Sub or Function) and you're looking at a variable in another method.
yorickthefirst wrote: Second - There is no Draw toolbox - I have all the controls etc but I cant draw a line or a circle etc on a form - where is this hiding (its not in the available tools from the add dropdown).
It's not hiding anywhere. There are no such tools. You're expected to either draw these things yourself in code or use a PictureBox or some other control to load an image file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Do you know how to get path to the CD drive? If there are two CD drives, and you have inserted a CD to a drive, how do you get path to that correct drive
Thank You,
Chatura
|
|
|
|
|
I also want to know the answer.
I know the follow code.
System.Environment.GetLogicalDrives()
Useing this code I'll get the all drives letters. But It does not provide which is CD drive and which is hard drive.
If you found the solution. Share me your solution.
Have a nice day.
!alien!
|
|
|
|
|
Thanks for your reply. When I was surfing the internet, I found some interesting tips.
Although they were in VB6 format, I converted them into VB.Net format and combined them together.
This program has,
A label “lblCDDrives”
Tow buttons “btnClose” & “btnOpen”
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer<br />
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Integer<br />
<br />
Private Const DRIVE_CDROM As Short = 5<br />
Const ASC_A As Short = 65<br />
Const ASC_Z As Integer = ASC_A + 25<br />
<br />
' Return the CD-ROM drive letters.<br />
Private Function SearchCDDrives() As String<br />
Dim i As Short<br />
<br />
For i = ASC_A To ASC_Z<br />
If GetDriveType(Chr(i) & ":\") = DRIVE_CDROM Then<br />
SearchCDDrives = SearchCDDrives & " " & Chr(i)<br />
End If<br />
Next i<br />
End Function<br />
<br />
Private Sub btnClose_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles btnClose.Click<br />
'Close CD Door<br />
mciSendString("Set CDAudio Door Closed Wait", CStr(0), 0, 0)<br />
End Sub<br />
<br />
Private Sub btnOpen_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles btnOpen.Click<br />
'Open CD Door<br />
mciSendString("Set CDAudio Door Open Wait", CStr(0), 0, 0)<br />
End Sub<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
lblCDDrives.Text = "CD drives are: "<br />
lblCDDrives.Text = lblCDDrives.Text & SearchCDDrives()<br />
End Sub
chatura
|
|
|
|
|
Thank you for your reply. Your code is helpful to me.
Have a nice Day.
!alien!
|
|
|
|
|
Hellow to all
how can i put a field in a crystal report , that i can contorl the text in it , from the code of the forum ..
that i can access it , and change it to what ever i wanna to from the code itself ?
thxx
-- modified at 4:32 Thursday 16th February, 2006
|
|
|
|
|
Hi
I have a form with 7 Datagrids. I populate DataTables from a database. I create a Dataview of the tables, and apply various filters based on user selections. I then use the DataVeiw as the Datagrid DataSource. I have also used Tablestyles to give the Datagrid Columns 'Readable' columnnames, and have adjusted the width of certain columns and set the columnwidth to 0 on some columns in order to hide them. This all works great.
Now I want to add the option to Export what displayed by the datgrids to Excel.
This is easy with a Datatable, since I can use the Column Names as headings, and then use a loop
For Each Col as Datacoumn in dtMyTable.Columns<br />
<br />
For each Row as datarow in dtMyTable.Rows<br />
cells(Row,Col) = ...<br />
Next 'Row<br />
<br />
Next 'Col
I'm battling to get the datagrid back into a table format - and cannot Ctype(Datagrid, DataTable) directly.
Any ideas how I can do this. (I'd like to be able to use the column headings and column widths of the datagrid to format the Excel sheet)
Thanx
Richard
|
|
|
|
|
I wish I knew an answer. I've been watching this message since you posted it, hoping someone would have the answer. I've ran into the same problem recently. If you figure out how I hope you'll followup and let me know what you find. Thanks
Lost in the vast sea of .NET
|
|
|
|
|
Have you tried:
Dim dSource As Object
dSource = DataGrid.DataSource
If TypeOf dSource Is DataView Then
Dim tbl As DataTable = CType(DataGrid.DataSource, DataView).Table
'Export to Excel...
End If
Dean
|
|
|
|
|
Hi Dean
Thanks 4 your reply. That works, but the problem is that I have a table with 6000 records. This Table is that datasource for a DataView. I then apply filters to the dataview. (So for example now the Dataview only has 100 Records) It is these 100 records that I want to put in a new table for export.
Using your method, it returns the full source table with all 6000 records.
I'd be happy to loop through the Dataview and adding those rows to a table, but can't seem to get that right.
Richard
|
|
|
|
|
You can pull data directly from the dataview which would allow you to only use the filtered data:
Dim i As Integer = 0
Dim dr As DataRowView
For Each dr In MydataView
ExcelWs.Cells(i, 1).Value = dr("Field1")
ExcelWs.Cells(i, 2).Value = dr("Field2")
.........
ExcelWs.Cells(i, n).Value = dr("Fieldn")
etc
i += 1
Next
Dean
|
|
|
|
|
I have a product Using VB6.0. How to provide product security? How to generate the key code for my product? That product ket is unique.After release this product,The customer install 2nd time this product,we will give the error "The key code already registered".So plz give some for Product security and How to generate Product key code?
Learn lot,
vijay.
|
|
|
|
|
|
crystal report with vb.net when i deploy on other computer & when i open report form, err "can't find keycodeV.dll"
help me pls.......................
shekhar
|
|
|
|
|
Create Setup project to deploy application, you can solve that problem
|
|
|
|
|
Hello,
u will have to make a setup project u can add setup project as:
- Add New Project
- Select Project type as "Setup and Deployment Wizard"
- Select Setup Wizard From Template
- A wizard will ask u some questions just complete it
- Now u have to add merge modules for crystal report which u can add as?
* Right Click on the Setup Project
* Add --> Merge Modules
* Select Following
** Crystal_Database_Access2003.msm
** Crystal_Database_Access2003_enu.msm
** Crystal_regwiz2003.msm
** VC_User_CRT71_RTL_X86_---.msm
** VC_User_STL71_RTL_X86_---.msm
- Build the solution
- A setup will be created in Setup Project Folders's -->Debug
- Copy it and run it on client machine
Regards
Javed
|
|
|
|
|
|
You need to register with Crystal Reports first. Then in your setup directory include the proper DLLs as mentioned in CR's documentations.
- Malhar
|
|
|
|
|
Hello,
I want to place my application on server and place short cut on client to run the application.
Thanks
Javed
|
|
|
|
|
That'll work fine "provided" that all of the app's dependencies are installed on the client system.
Dependencies such as the vb runtime, any ActiveX's used, etc.
|
|
|
|
|
In addition to what Joshua said, in a .NET Framework environment, this also means (in most cases) changing the trust level for your application on each client machine. Code running from a network source runs in a more restrictive "sandbox". The affects of which will not be known until you test your code running from the network.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Our shop has a good many applications setup this way. You need to make sure the correct version of the framework is installed on each client.
Also, if you decide to use Crystal Reports in the application, there are merge modules that need to be installed on the client's machine. I believe VS 2005 addresses this problem, but we were using 2003 at the time.
As Dave already mentioned, security is a big factor. You have to adjust the trusts on the client's machine to execute an application on the server. We used a MSDN support call on the security issue and below are the links he gave us. Maybe this info can help with the security issues.
Because of some of these issues our shop is looking into clickonce deployment in VS 2005 to be a better solution for us in the future. We just installed VS 2005 this week so we're just starting to figure out the new features.
Good luck!
SAMPLES
No-Touch deployment - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchNo-TouchDeploymentInNETFramework.asp
.NET Security Samples - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_RoleBasedSecurity.asp
MODIFYING SECURITY
URL Security Zones: http://msdn.microsoft.com/library/default.asp?url=/workshop/security/szone/urlzones.asp
Configuring Permission Sets Using the .NET Framework Configuration Tool - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconusingnetconfigurationtooltoworkwithpermissionsets.asp
Project Folder Not Secure Dialog Box - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxurfprojectfoldernotsecuredialogbox.asp
Performing Common Security Policy Tasks Using the .NET Framework Configuration Tool - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconperformingcommonsecuritypolicytasksusingnetframeworkconfigurationtool.asp
Deploying Security Policy - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondeployingsecuritypolicy.asp
DEFINITIONS
Security Permssions - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritypermissions.asp
Name Permission Sets - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconnamedpermissionsets.asp (This has the definition for "Local Intranet", as I mentioned before this should be every computer within the domain)
Security Zones: - http://msdn.microsoft.com/library/default.asp?url=/workshop/security/szone/overview/overview.asp
Lost in the vast sea of .NET
|
|
|
|