|
yes what u r saying is exactly right hi
|
|
|
|
|
You should also check tvXmlTree.SelectedNode to make sure something is selected. If you deselect a node then this event will fire and your code will fail.
|
|
|
|
|
How exactly are you deselecting a node? In a TreeView , you can't click on an object to deselect it. And, if you set
TreeView1.SelectionNode = Nothing
then, After_Select doesn't get called. Show me example code that will fire After_Select on a deselect.
|
|
|
|
|
Sorry, I didn't verify that. I thought that was the case but I suppose that is left over from working on an Access application . Which I know behaves that way. However, I do try to check all variables before using them, even when they are "guaranteed" to be instantiated.
|
|
|
|
|
I gotta say, this is badly written. First, why would you put an entire sub within a Try /Catch block? If you want the old VB6 On Error , you can still use it...though it's not suggested.
Only put the sections of code that you think could throw an exception within the Try /Catch . That's what it's there for.
Private Sub populateTreeview()
Try
*
*
* Me.Cursor = Cursors.WaitCursor
*
* Dim xDoc As New XmlDocument()
xDoc.Load(SelectTextFile())
*
*
* tvXmlTree.Nodes.Clear()
tvXmlTree.Nodes.Add(New TreeNode(xDoc.DocumentElement.Name))
* Dim tNode As New TreeNode()
* tNode = DirectCast(tvXmlTree.Nodes(0), TreeNode)
*
*
* addTreeNode(xDoc.DocumentElement, tNode)
*
* tvXmlTree.CollapseAll()
Catch xExc As XmlException
MessageBox.Show(xExc.Message)
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
Me.Cursor = Cursors.[Default]
End Try
End Sub
I've put asterisks besides the lines of code that should never throw an exception. So, there are only two lines that could possible throw an error...if the SelectFile() doesn't return a valid item for the xDoc.Load and if xDoc.DocumentElement doesn't exist, though if it doesn't it means that the xDoc.Load didn't work which should have already thrown an exception.
And, by the way,
DirectCast(tvXmlTree.Nodes(0), TreeNode)
in this line, all TreeView Nodes are TreeNodes . You don't need to DirectCast them.
|
|
|
|
|
Hello,
I would like to ask how can I to filter between certain range of date
and display it in my datagridview.
Below here is my sample code that I have tried but not yet working
adodc1.RecordSource = "SELECT * FROM studRecords where dateEnrolled _
BETWEEN DTPicker2.Value AND DTPicker1.value"
adodc1.Refresh
Any comments or suggestions are kindly appreciated
Thanks,
dfan23
|
|
|
|
|
If Database is Access
adodc1.RecordSource = "SELECT * FROM studRecords where dateEnrolled _
BETWEEN #" + DTPicker2.Value + "# AND #" + DTPicker1.value + "#" else If Database is SQL
adodc1.RecordSource = "SELECT * FROM studRecords where dateEnrolled _
BETWEEN '" + DTPicker2.Value + "' AND '" + DTPicker1.value + "'"
|
|
|
|
|
Hello,
Can I ask a follow up question if how do I will put the sql query of the between command so that the filter data will be only shown in the crystal report I will be creating.Like showing only the filter data into crystal report
Thanks,dfan23
|
|
|
|
|
Use selection formula in crystal report, that's all.
|
|
|
|
|
check the Date formats Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
We have a legacy Visual Basic application. It references a third party .Net DLL and that requires few keys to be set in the application's APP.Config. That DLL reads those keys from the APP.Config.
Not sure how to create APP.Config and add those keys. Any help is greatly appreciated.
Thanks,.RamDili
|
|
|
|
|
VB6 doesn't use app.config files, so I have no idea if this ies even going to work.
You'll have to put whatever information is required into a file that has the same name as your app's .EXE filename, with ".config" appended to the end of it. For example, if your applications .EXE has a filename of MyApplication.exe , then the app.config filename would be MyApplication.exe.config and would be in the same folder as the .EXE.
|
|
|
|
|
app.config is XML file , in vb6 you can Read /Write to XML. try using DOM Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Hi friends,
I was create a project in vb6. this project purpose is integrate excel. now am converted in vb 2008. it working fine but form could not visible form status, after load excel this will show while working i could not view the form. how can i solve this problem. help me...
|
|
|
|
|
Hi, I realise that English is not your first language and I am having difficulty understanding what you are trying to say without any code samples to back up your request.
May I suggest that if there is a Google translation facility for your language that you write your request again in your own tongue and have Google translate? Most of Googles translations are not too bad.
|
|
|
|
|
Since you are in the United States you may want to find a friend who is good at English to help you rephase your question.
|
|
|
|
|
Hi,
As the other responses indicate, your question isn't the best. But here is my guess at what your asking [more than likely a millions miles from the actual question, but hey ho, at least i tried!]
You are using Excel Automation and running this from inside VB.net code. You code is running, but you don't see the background automation happening. Close?
When you declare your excel.application object to use with the automation, it has a visible property. Have you set this to True?
|
|
|
|
|
Hello Experts,
Actually I want to know that how to get the Path of Send To Item(Folder,File).
I am Trying to Create a Application which Creates the Log of Data which is insert in Removel Media.You can say it is removable Monitoring application.
So i want to get the file path which is send by Send To.
ThanksIf you can think then I Can.
|
|
|
|
|
One method of doing this is to;
1) Enumerate the drives collection
2) Check which ones are marked removable
3) Export the data to the selected drive in what ever format you need.
|
|
|
|
|
But I want the Source Path Where from the data is coping . If you can think then I Can.
|
|
|
|
|
Ah! so you want to monitor all files that are transferred by the computer to removable media? So you want to know if a file has been copied off of the computer.
I do not think this is a simple as it sounds, you would have to hook into os to do this sort of monitoring.
|
|
|
|
|
Take a look at FileSystemWatcher. That should do what you want perhaps.
|
|
|
|
|
Here is a simple debug output test;
Private Sub printRemovableDrivesList()
Dim Count As Integer
Dim aDrive As System.IO.DriveInfo
Debug.WriteLine("Removable Drives:")
For Each aDrive In My.Computer.FileSystem.Drives
If aDrive.DriveType = System.IO.DriveType.Removable Then
Debug.WriteLine("Drive: " & aDrive.RootDirectory.ToString)
Count += 1
End If
Next
Debug.WriteLine(Count.ToString + " Drives Found.")
End Sub
I had one memory stick plugged into the usb port and ran the function above. Output was;
Removable Drives:
Drive: E:\
1 Drives Found.
|
|
|
|
|
I think you are not thinking the mean of my Question.
if I am sending file in removable media by using Sendto option (Byusing right click in any file or Folder).
Then How Get the Location of Current File Location (Where from the file is copied(Source Path)).If you can think then I Can.
|
|
|
|
|
Hi Experts,
I would like to Synchronize MS-Access database from sql server 2005 database realtime.
One way was to alter the code and make a separate connection string for MS-access in VB for inserts. But what modifying in code is not allowed.
So I have linked the MS-Access using addlinkedserver and established a connection in that and than I have created a trigger in Sql database so that whenever the table of sql will insert it will get inserted in MSAccess too.
Its working from sql server browser very well but not working from vb front. Giving error like 'linked server 'ecapacitor' does not support the required transaction interface.
My trigger is this:
create trigger updmth
on day_trn
AFTER insert
As
begin
commit
insert into ecapacitor...mth_trn
(ldaytrn_id,lgl_id,lacc_id,nentry_id,sdate,snchcltr,damt,nchqno,sparticulars,bdc)
select ldaytrn_id,lgl_id,lacc_id,nentry_id,sdate,snchcltr,damt,nchqno,sparticulars,bdc from inserted
begin tran
end
Please let me have a solution for this. An quick reply will be highly appreciable.
Thanks & Best regards
Jay Khatri
|
|
|
|