|
You're using VB.NET and the old VB6 error handling?? Not a good idea...
Anyway, it's impossible to tell you what the problem is because we haven't seen your code. Don't post the entire project.
What you have to do is use a code profiler to find out where the problem is. Since the app works as an admin and bogs down as a normal user, I'd say you're doing something that requires admin rights, but your error handling is written so badly, it's burying all the errors.
|
|
|
|
|
How can i know that in which process takes a lot of memory.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Please use This[^] it will provide you bits and pieces on your system's memory utilization.
|
|
|
|
|
My application gets memory from 13000 to 30000 and CPU Usage is 0 to 1.
I am developing application in vb.net.And i am using image in application.
is Image or .Net framework or comment occoupies memory.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
I have tried to copy from Sheets("S") rows meeting condition and copy those rows to a new sheet, but not able to get the code to work. Here is my code. What could I be doing wrong?
Here is the spreadsheet fields.
Date Requested Requesting Entity Information Requested Contact Name Contact Telephone/Email OIG Contact OIG Contact Telephone/Email "Deadline Back
to Requesting Entity" "Deadline to theOIG Contact" "Actual Date Returned
to the OIG Contact" Status Comments
There is a funciton in A5 that sets the condition:
A4= 1/29/09 or =today
i12 and k12 contain dates
variable dates are being swapped out for Sheets("D").Cell("c9") based on whether the funtion computes to True for the selected row.
Funcitonion assigned to Cell A5:
=IF(S!A4<S!I12,IF(S!K12<>"Completed",S!C10," ")," ")
'Try this where you fire from the source sheet. Change wks2 to your
'destination sheet conditionally copy rows to another worksheet
'Declare variables
Sub findNew()
Dim rCell As Range
Dim D As Worksheet
Dim S As Worksheet
Dim SL As Range
Dim RD As Range
Dim RS As Range
Dim RA As Range
Dim RB As Range
Dim RC As Range
Dim RE As Range
Dim compDate As Boolean
'Initialize the worksheets
Set S = Sheets.Item("S")
Set D = Sheets.Item("D")
'Initialize the Ranges
Set RA = Sheets.Item("S").Range("a4")
Set RB = Sheets.Item("S").Range("I12")
Set RC = Sheets.Item("S").Range("K12")
Set R1 = Sheets.Item("D").Range("C9")
Set R2 = Sheets.Item("S").Range("C10")
Set RD = Sheets.Item("D").Range("a8:l8")
Set RS = Sheets.Item("S").Range("a8:l8")
'Initialize the Function in cell a5 from Sheet "s"
Set Sheets.Item("S").compDate = Sheets.Item("S").cell(a5)
'Select the Source Worksheet
Sheets("S").Select
'Set up Loop
For Each rCell In RD
rCell.Activate
'For i = 1 To Cells(8.Count, "a").End(xlUp).Row
'Run compDate for Sheets("S").Cell(5,1)to evaluate row
If compDate = True Then
Sheets("S").Select
Range("RS").Select
ActiveSheet.Copy
Sheets("D").Select
Range("R1").Select
Range("R2").Paste
Sheets.Item("D").cell(C9) = S!C10
Else
Sheets.Item("D").cell(C9) = " "
Exit For
End If
Next rCell
'Find LastRow in Worksheet "D" and increase values of input
'Set RB = Worksheet.Sheets("D").Range("a8:l8")
'If (S!A4<S1!I14,IF(S!K14<>"Completed",S!C9," "),S!C10)
'Continue with copy Paste Function
'Set Worksheet.Sheets("S") = ActiveSheet
End Sub
|
|
|
|
|
I have a multiline textbox control on a form. When a user focuses on the textbox I want to check and see if a certain string (user's name and todays date) are in the textbox. If not, I want to automatically add the user's name and todays date to the end of the textbox and position the curor and scroll to the bottom. I am having trouble with the scrolling/cursor positioning part. My code will scroll down, but the cursor ends up moving to where ever the user clicked in the textbox. Does anyone know of a way to ignore where they clicked so as to override where the cursor goes? Is there another event that fires that I can grab? Am I missing something obvious here?
Private Sub txtInput_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtInput.GotFocus
Dim strAutoLabel As String = gblstrUserName.Trim & " - " & Now.ToString("M/d/yy")
'If the textbox does not contain the auto label, add it
If Not txtInput.Text.Contains(strAutoLabel) Then
If txtInput.Text.Trim.Length <> 0 Then txtInput.Text &= vbCrLf & vbCrLf
txtInput.Text &= strAutoLabel & vbCrLf
txtInput.SelectionStart = txtInput.Text.Length - 1
txtInput.ScrollToCaret()
End If
End Sub
I'd appreciate any help or advice you can give me.
|
|
|
|
|
In the mouse click event for the tetbox you could try:
if not (Me.txtNvs.SelectionStart = txtInput.text.length -1) then <br />
Me.txtNvs.SelectionStart = txtInput.text.length -1<br />
Me.txtNvs.SelectionLength = 0<br />
end if
'it may be something similar to determine the current selected index in the if statement
good luck
|
|
|
|
|
Thanks for taking the time to help me. It's not quite what I was after, but it's a step in the right direction. I want the autoscroll to the bottom to happen only the first time they click...if they click once to get focus and then click again because they are trying to highlight a word or edit text it should not scroll. So I did this:
Dim intMouseClickCounter As Integer = 0
Private Sub txtInput_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtInput.GotFocus
Dim strAutoLabel As String = gblstrUserName.Trim & " - " & Now.ToString("M/d/yy")
'If the textbox does not contain the auto label, add it
If Not txtInput.Text.Contains(strAutoLabel) Then
If txtInput.Text.Trim.Length <> 0 Then txtInput.Text &= vbCrLf & vbCrLf
txtInput.Text &= strAutoLabel & vbCrLf
txtInput.SelectionStart = txtInput.Text.Length
txtInput.ScrollToCaret()
'Set counter to one so the mouseclick event will scroll to the bottom
intMouseClickCounter = 0
Else
'Set counter to one so the mouse click will not scroll to the bottom
intMouseClickCounter = 1
End If
End Sub
Private Sub txtSpecialReport_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles txtInput.MouseClick
If intMouseClickCounter = 0 _
AndAlso Not (txtInput.SelectionStart = txtInput.Text.Length) Then
txtInput.SelectionStart = txtInput.Text.Length
txtInput.SelectionLength = 0
txtInput.ScrollToCaret()
End If
'Increment counter so if user clicks inside textbox after focus has already been set,
'the code to scroll to the bottom will not run again
intMouseClickCounter += 1
End Sub
Private Sub txtInput_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtInput.LostFocus
intMouseClickCounter = 0 'Reset counter
End Sub
But this solution has flaws. It doesn't work the way I'd like when a user tabs into the textbox, and it will scroll when I don't want it to if the user activates another window/program and then returns to this form and this textbox. If anyone has any further suggestions I would appreciate it.
|
|
|
|
|
hi
i developed one project in visual studio 2005..... worked under vb.net with ms access 2003..... i did my project successfully........ when i came to publish i have attached my database successfully........ during setup.exe running one error occur like this " could not find installable ISAM..... anyone help me for this query....
|
|
|
|
|
Most likely, your ConnectionString is wrong. What does the code look like that throughs the error.
|
|
|
|
|
Hi,
I urgently need to get this program running. I'm trying to remotely connect to a server using WMI (which is all fine) and then run an executable as a process on the server.
I currently get the error "Public member 'string' on type 'Uinteger' not found". I think this is something to do with the InvokeMethod line, as most examples have 'null' where it has 'Nothing'. However null is not allowed in VB.NET 2005 - it suggests using system.dbnull which doesn't work either.
<br />
' Get the object on which the method will be invoked<br />
Dim processClass As New ManagementClass<br />
processClass = New ManagementClass("Win32_Process")<br />
processClass.Scope = scope<br />
' Get an input parameters object for this method<br />
Dim inParams As ManagementBaseObject = processClass.GetMethodParameters("Create")<br />
' Fill in input parameter values<br />
inParams("CommandLine") = patchcommand 'This is a string containing the command<br />
<br />
<br />
' Execute the method<br />
Try<br />
Dim outParams As ManagementBaseObject = processClass.InvokeMethod("Create", inParams, Nothing)<br />
Dim obj As Object = outParams("ReturnValue")<br />
<br />
'Check for an error<br />
If obj.ToString <> "0" Then<br />
'Error occurred<br />
End If<br />
Catch ex As Exception<br />
'This catches any other errors from trying to run the process<br />
MessageBox.Show(servername & " - Error running process - " & ex.Message & vbCrLf & ex.ToString)<br />
<br />
End Try<br />
modified on Wednesday, January 28, 2009 9:20 AM
|
|
|
|
|
|
I'd like to get it working today if possible. We're trying to roll something out urgently across a lot of servers and this way we can do it all remotely.
|
|
|
|
|
Well just so you know, take a look at this [^]thread, it explains etiquette on the boards. Posts with urgent don't typically get responses at all, nor do posts looking for source code.
|
|
|
|
|
Thanks. I've edited the title. I'm not looking for source code by the way, I just posted my code to show how I'm trying to do it.
I think the code is correct except for that one line being wrong in some way.
|
|
|
|
|
I've changed the way I'm doing it now. I'm getting a return code of 9 but I can't seem to find out what these codes mean.
New code -
Dim processClass2 As ManagementClass = New ManagementClass("Win32_Process")
processClass2.Scope = scope
Dim inParams2 As ManagementBaseObject = processClass2.GetMethodParameters("Create")
Dim startup As ManagementClass = New ManagementClass("WIN32_ProcessStartup")
startup.Scope = scope
inParams2("CommandLine") = patchcommand
inParams2("ProcessStartupInformation") = startup
Dim outParams As ManagementBaseObject = processClass2.InvokeMethod("Create", inParams2, Nothing)
'Check for an error
If (outParams("ReturnValue").ToString) <> "0" Then
'Add error to listview
Dim itms1 As New Windows.Forms.ListViewItem.ListViewSubItem _
(itmp, "Could not start process. Error code " & (outParams("ReturnValue").ToString))
itmp.ForeColor = Color.Red
itmp.SubItems.Add(itms1)
itmp.Checked = True
'Skip to next file
GoTo skipfile
End If
|
|
|
|
|
Win32_Process.Create returno codes are hidden here[^]
I suggest you check the contents of your patchcommand variable.
In January you said "Money in April" -
That was two years ago!
B. Python
|
|
|
|
|
Thanks very much for the codes.
I'm not sure about the escape characters in the variable. It's set to -
patchcommand = " ""\\server\folder\folder\WindowsServer2003-KB958644-x86-ENU.exe "" /quiet"
And I want it to run "\\server\folder\folder\WindowsServer2003-KB958644-x86-ENU.exe" /quiet
I've tried it with \\\\server\\folder\\folder\\WindowsServer2003-KB958644-x86-ENU.exe which also seems to fail.
The usual error code that comes back is 9 now - I was getting 8 before I started mucking around with escape characters.
|
|
|
|
|
hi all,
am using vb.net 2.0 how to develop print dialog
Regards
Vidhish
|
|
|
|
|
There is a PrintDialog class. Use that.
Visual Studio has a great feature called Object Browser. Try using it.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Im reading a file and taking a specific fields from it and then rewrite them in a new file.. some of these fields are empty so i need a code that when the fields is empty to write it in the new file as spaces
|
|
|
|
|
|
Hi all. I am currently looking to insert a value into a memo field in vfp using a odbc connection but keep getting a error (ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch). Does anybody know if this is supported by the odbc connection object or does anybody have sample code to do this. The sql is correct this thing just fails with the odbc connection.
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
You say that the SQL is correct, what type of database have you tested it on? The reason I ask is because I believe that the required type of data can vary between database engines.
If you haven't done so already (and I apologise if you have), I would test the SQL on the VFP database directly.
|
|
|
|
|
Could yo post the code. Perhaps the problem is in the parameter usage.
|
|
|
|