|
Hi,
In regards to your question I would like mention that
IsError is a Method which returns a Boolean value indicating whether an expression is an exception type.
IsError returns True if the expression represents an Object variable that derives from the Exception class in the System namespace.
The following code snippet will explain how we can use the IsError Method.
Sub demonstrateIsError(ByVal firstArg As Integer)
Dim returnVal As New Object
Dim badArg As String = "Bad argument value"
Dim errorCheck As Boolean
If firstArg > 10000 Then
returnVal = New System.ArgumentOutOfRangeException(badArg)
End If
errorCheck = IsError(returnVal)
End Sub
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
|
i want you to Say with me
next time i will google before i post in a Forum
here is what you are looking for in Google.
http://www.google.co.za/search?hl=en&q=byref+and+byvalue&meta=[^]
it will help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
This question (and your other one) suggest that you haven't learnt the basics of the language yet.
You shouldn't really ask questions like this in the forum. This information is freely available in the documentation[^]. I suggest you read it and learn the language fundamentals before posting again.
Paul Marfleet
|
|
|
|
|
the actual value is stored in variable in by val and in byval reference is stored in the variable and actual data is stored in the heap
|
|
|
|
|
Actually, you're answer is very wrong.
You might want to Google it yourself too.
|
|
|
|
|
Every variable or literal is stored somewhere in memory.
When you 'pass a variable by reference' the address of the actual variable is passed to the subroutine/function. You are working with the actual data value. Passing by reference is good for large data structures, and objects. Changing the values of 'by ref' parameters is sometimes called a 'side effect'. Normally one does not do this.
When you 'pass by value' the runtime makes a copy of the variable. The subroutine receives the copy. Whatever changes the subroutine makes to the variable - will not affect the calling program, since the 'by value' copy will be discarded, when the subroutine returns. There is no way you can have the 'side effect'.
|
|
|
|
|
Hello
I m using crystal report 9 in my vb.net Application my problem is that when i Called the Report whose Data Source is a text file, from my vb.net application the system gives me the runtime error
Query Engine error :HY000 [MICROSOFT][ODBC TEXT DRIVER] THE MICROSOFT JET DATABASE IS CANNOT OPEN THE FILE (UNKNOWN).IT IS ALREADY OPEN EXCLUSIVELY BY ANOTHER USER OR U NEED PERMISSION TO VIEW ITS DATA
ERROR IN FILE C:\DOCUMEN~1\USER\LOCALS~1\TEMP\CRRPT.RPT QUERY ENGINE ERROR
however i m using the code to for crystal report viewer control as
Me.CrystalReportViewer1.Refresh()
Dim strPathName As String
Dim reportDocument1 As New CrystalDecisions.CrystalReports.Engine.ReportDocument
strPathName = "D:\CrReport.rpt"
reportDocument1.Load(strPathName)
Me.CrystalReportViewer1.ShowExportButton = True
Me.CrystalReportViewer1.ShowPageNavigateButtons = True
Me.CrystalReportViewer1.ReportSource = reportDocument1
please please help me out
|
|
|
|
|
Well, I don't use CrystalReports. By the error message either the file you gave the report doesn't exist (or the path to it is wrong), or the file is already held open by some other code in your app or some other external application.
Did your code open this file somewhere else and not close it??
|
|
|
|
|
i can't find all the nodes...using DOM
Let me expalain the problem
here is my xml
[CODE]
<study>
<document>
<title>title of file</title>
<file-tag info-type="2">
<property info="3">1</property>
</file-tag>
<file-tag info-type="4">
<property info-type="5">2</property>
</file-tag>
<file-tag info="6">
<property type="7">3</property>
</file-tag>
</document>
</study>
[/CODE]
i just want to remove to remove the "property" tag and place them after the "title" tag
i have code it like
<br />
objDomUpdate.Load ("\\Path of XML")<br />
objDomUpdate.async = False<br />
objDomUpdate.validateOnParse = False<br />
objDomUpdate.preserveWhiteSpace = True<br />
Dim i, iCou As Integer<br />
Set oNodeList = objDomUpdate.getElementsByTagName("document")<br />
<br />
Dim Count As Integer<br />
For Count = 0 To oNodeList.length - 1<br />
Set oNode = oNodeList.Item(Count)<br />
For i = 0 To oNode.childNodes.length - 1<br />
If StrComp(oNode.childNodes(i).nodeName, "file-tag", vbTextCompare) = 0 Then<br />
If oNode.childNodes(i).childNodes.length > 0 Then<br />
For iCou = 0 To oNode.childNodes(i).childNodes.length - 1<br />
''Set oDemonode = oNode.appendChild(oNode.childNodes(i).childNodes(iCou))<br />
Set oDemonode = oNode.insertBefore(oNode.childNodes(i).childNodes(iCou), oNode.childNodes(1))<br />
'MsgBox (oNode.childNodes(i).childNodes(iCou).nodeName)<br />
Next<br />
End If<br />
End If<br />
Next<br />
Next<br />
objDomUpdate.Save ("C:\test.xml")<br />
from the above code i just move 2 property tag but i can't move the last one.
why???
where i am wrong ???
please help..
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
I'm no expert in XML, but it would appear that you could do this much easier with an XML Transform. Though, I don't know for sure, nor do I know exactly how to do it.
But, back to your code. XML and XPath give you LOTS of power to do searching and retrieving of nodes and you're not using it at all. There's definitely lots more code here than there needs to be. First, get the document node and hold onto it. Then get a collection of the property nodes. All you need to do is enumerate that collection and call InsertBefore on the document node for each property node:
(assuming VB.NET!)
' Find the first 'document' node wherever it shows up in the XML.
Dim documentNode As XmlNode = objDomUpdate.SelectSingleNode("//document")
' Get all of the 'property' nodes, no matter where they show up inside the 'document' node.
Dim propertyNodes As XmlNodeList = documentNode.SelectNodes("//property")
' Move each 'property' node to before the FirstChild node of the 'document' node.
For Each propertyNode As XmlNode In propertyNodes
documentNode.InsertBefore(propertyNode, documentNode.FirstChild)
Next
Done!
|
|
|
|
|
helloo....
i have problem page navigation in my report viewer,,,the first load page navigation always display total page is totalpage-1
for example, i have 10 page.....
in first load pageNavigation will say 1 of 9, but if I click next page, PageNavigation will say 1 of 10,,what is false in me program
please help me,,,,
|
|
|
|
|
If you click back to the first page, does it still say 1 in 9, or does it say 1 in 10, if the report is 10 pages long??
This post[^] may shed some light on the issue.
|
|
|
|
|
If click back to the first page, it still say 1 in 10,, the problem is only the first load....
what must i do?
|
|
|
|
|
Nothing. The ReportViewer hasn't finished its internal rendering, adn therefor, page count, when you see the first screen. If your report was a thousand pages long, you'd see the same thing. There's really nothing you can do about it.
The reason for this is imple. Say the report is 300 pages long. Would you really want the user staring at a blank screen while the RV control figures out how many pages are in the report? Or would you want the user to start looking at the report's first few pages while the control does its internal rendering and figures out how many pages are in it??
Something else you haven't run into yet is that the number of pages you see in the report (even after rendering is finished) CAN and probably WILL be different than the number of actual pages printed!
|
|
|
|
|
so...
page navigation don't have method to setting it? only to show or hodden it?
thank you..
|
|
|
|
|
No, you can't set the number of pages in the report.
|
|
|
|
|
Thank you very much
|
|
|
|
|
I wants to create a Msi to install software addin (dll). I created msi which copy the dll to the destination folder but how to register the dll using msi? now I have a batch file to do this and I am executing after installation (manually). Is there any good practice to register the dll while installation or to run the batch file during installation?
(vb2005)
Saseendran Kombath
|
|
|
|
|
Saseendran Kombath wrote: I created msi which copy the dll to the destination folder but how to register the dll using msi?
If you did this, there should be an option in the properties for that file, called Register, to register the .DLL. If it's a COM-based .DLL, you set this option to vsdraCOM . Done. No batch file required.
|
|
|
|
|
Below is the code I used in batch file to register the .DLL
c:\windows\microsoft.net\framework\v2.0.50727\RegAsm.exe /codebase "name.dll"
I tried using vsdraCOM but it doesn't worked for my application
Saseendran Kombath
|
|
|
|
|
Saseendran Kombath wrote: :\windows\microsoft.net\framework\v2.0.50727\RegAsm.exe /codebase "name.dll"
This is a .NET DLL, not COM-based.
Saseendran Kombath wrote: tried using vsdraCOM but it doesn't worked for my application
It didn't work because you told the MSI to register a COM-based DLL and that's not what you have. RegAsm registers a .NET assembly as a COM type, IF and only IF the assembly has been properly decorated and coded to support COM, AND is strong-named.
There is no option for a .NET DLL. You'll have to run the batch file from a custom action in the installer. For this, open Visual Studio and hit F1. Search for "custom actions" in the help for examples.
|
|
|
|
|
Thanks a lot for the clarification
Saseendran Kombath
|
|
|
|
|
Hi
I am trying to code in VB.Net 2003 i am a beginner, and i must retrieve a small amount of data from an oracle database. I have been searching online for the last 4-5weeks and cannot seem to get anywhere fast, the internet is just a mine field if you find some code that looks good it comes with errors and as it is new to me it is pretty difficult. I have designed the tables in oracle just need some code to return a small amount of data in VB.NET 2003.
Any help would be appreciated
Thank You beforehand
|
|
|
|
|
Instead of jumpng from article to article, snippet to snippet, you should take a snippet that you find online, read the article, check the error messages you get, and work out what it is that you're doing wrong. Copying and pasting code from the web that you don't take the time to understand is never going to work. Getting another snippet from this site won't make it better. You CAN use this site to ask questions about why the code you're using is not dogn what you want, however. That would make more sense.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|