C# - Which Takes More Memory - String Value Or Long Value

Apr 16, 2012

I have a client application that connects to a WCF service, i get the file size from the server as a long value then i convert it at the client to a string so it appears like ex:52.21 MB the application gets too many files sizes every time user changes the directory pathso the question is :should i convert the values to a string format from WCF service app then return it to the client as a string format or should i just return the size as a long value and let the client to convert it to a string format in other way which value take more bytes in the memory:

[Code]...

View 3 Replies


ADVERTISEMENT

Getting Mac ManagementClass Takes To Long To Fail?

Jan 28, 2009

I'm using the following code to fetch a mac address

Try
Dim cls As New ManagementClass("\" & IP & "
ootcimv2", "Win32_NetworkAdapter", New ObjectGetOptions(Nothing, TimeSpan.MaxValue, False))
Dim col As Object

[Code]...

It is working as expected. My problem is that it seems to wait far too long for devices which do not respond, and when the output of GotMac is "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)" How do I shorten the wait time for these types of events?

View 5 Replies

WPF Application Takes Too Long To Start

Dec 16, 2011

I am creating a WPF Application that uses Fluent library.

On my computer with Windows 7, 2GB RAM and AMD Triple Core processor, after double clicking on the program icon, The Splash image shows after about 1-2 seconds.

But on my brother's old computer with Windows XP, 512MB RAM and Intel Celeron 2.0 GHz Processor (Single core), after double clicking on the program icon, First, a process called PresentationFontCache.exe runs and it uses almost 100% of CPU for some seconds. And Total time is needed for displaying the initial Splash image is almost 30 seconds (or more).

I don't want that some users have to wait 30 seconds for displaying splash image and about 7-8 seconds for loading application. (my application load process takes 7-8 seconds)

View 3 Replies

Network Request Timeout If It Takes Too Long?

Feb 18, 2010

I've been using VB for exactly a week today and for that past 4 hours I've been pulling my hair out! My problem is that our software can only run on one PC on a site, if two instances are running they cause issues. So instead of checking each PC individually I created a program with VB to do this (and other tasks) for me. The problem with the network search is that if I cannot access a remote PC (usually access is denied) then it hangs for a long time before moving on to the next. Can I introduce a timeout feature where the program tries to access the c drive but if it does this for more than 5 seconds and gets nowhere then it moves on? [code]'testcpath' is \pcnamec$ and the other two paths look for the software I'd need to remove if found. So basically, if I have access to every c drive it works fine and completes within a few minutes. If I don't have access to even a small amount then it takes an absolute age.

View 2 Replies

Sql - Function Takes Long Time For Execution?

Jun 13, 2012

Actually, I am trying to find out whether the partno is existing in the database table or not and it takes long time in count = checkCommand.ExecuteReader statement

Public Function CheckProductNo(ByVal Partno As String) As Boolean
Dim count As SqlDataReader
Dim valid As Boolean = False
Using connection As New SqlConnection

[code]....

View 4 Replies

Terminate Code That Takes Long In Program?

Oct 25, 2010

How to terminate function/code (not entire page) when it takes some time, for example, more than 1 sec?[code]...

I found the command "Server.ScriptTimeou", but it stops the entire page instead of one command.

View 2 Replies

VS 2008 - Anyway To Time How Long It Takes A Message Box To Pop Up?

Sep 9, 2009

I'm trying to time how long an operation takes in Visual Basic (VS 2008) but its not working. the code I have is as follows:


[code]...

this is in an OnClick event, so what happens is that the user can click a menu item, and it goes and sends any changes it has to a database, and pulls down any new changes to a local data cache. This operation takes time, depending on how many changes are on the server and how many are cached locally. I've thought about making this a background task, so it doesn't draw away from the main app while it's running, but before doing that, I'd like to get an idea how long the operation takes. Since I can't exactly do a progress bar, I figured using the stopwatch would tell me how many ticks/milliseconds would occur between click, and when the "total synced" message comes up, but every time i run it and do an update the message always shows 0 ticks/ms. I don't think it's accounting for the delay, just from start to finish. Is there any way to make it so it detects a message popping up and times off that?

View 6 Replies

VS 2008 Seeing Long It Takes To Copy File

Aug 12, 2009

Here's the (Timer1's interval is set to "1" in the designer, and it is set to "Enabled" in the designer as well.)

vb.net
Public timeElapsed As Int32Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
timeElapsed = 0
Timer1.Start()

[Code]...

The issue is, timeElapsed always comes back as equaling 0, so fileCopySpeed always equals infinity. Also note that test.dat is a 100MB file. There's no way it's getting copied in under 1 millisecond!

View 12 Replies

Application Made In Studio Takes Very Long To Start Up

Dec 29, 2011

I wrote an app in Visual Studio and is about 20k+ lines, but I don't know why it takes so long to start up. I have a splash screen just to test it to see if the program is working, and it is, but I have to wait for so long for the app to actually get to the start up form. A splash screen for this app isn't ideal, but was only using a splash screen for test purposes.

View 1 Replies

Cut & Paste To Textbox Then Sql Server Update Takes Too Long?

Apr 20, 2011

I've written a small application that keeps track of my thesis notes and essentially I have a few textboxes for keywords, ideas and notes. When I type in the textboxes and hit my update button it works fine...when I cut and paste from a text editor into the textboxes and then hit my update button it takes way to long to return control to the form. Is there something I need to do to text that is copied and pasted into a text box before I send it to the database?

View 3 Replies

VS 2008 Get Administrator Members Takes A Long Time

Apr 18, 2011

I am using the below code to get the local Administrator members, but this code takes about 6-7 seconds to execute. More precisely the "GetObject" takes that long.Is there another way to get the same information but faster?Also, where can I find what other properties the objects holds ? (To see what other useful information I can get)[code]

View 1 Replies

VS 2008 Published App Takes A Long Time To Load?

Feb 10, 2010

Whenever I publish my app, or when I run the exe from teh debug folder it takes a couple of seconds before the splash screen shows.However, when I run it from within VB (by pressing the "play" button) the splash screen shows immediately.

What could be the cause of this?

View 2 Replies

Takes Long Time To Generate Excel File Using OPEN XML SDK Tool?

Aug 1, 2011

i have developed an application using OPEN XML SDK Tool 2.0 which generates Excel file. I have Data table of 100000 row and 30 columns and i want to generate excel file with these 100000 rows and 30 columns but it takes about 2 minutes of time to generate excel file. What can i do to reduce this time.

View 3 Replies

Function That Takes A String As A Parameter?

Jan 1, 2012

I have a function that takes a String as a parameter And in it I have variables, so if I call it it's like

Dim Text As String = MyStringConverter("Hello Mr. " & Name & " " & Surname "!")

View 4 Replies

Takes A Value In A Combo Box And Appends It To A String?

Jul 23, 2009

I have the following expression that takes a value in a combo box and appends it to a string :

Dim Expression As String = "COMPANY = '" & cmbCompany.Text & "'"

View 2 Replies

Takes A String Parameter And Runs A Command?

Mar 15, 2010

What function in VB.NET simply takes a string parameter and runs a command? It would work just like the OK button in the Start -> Run dialog.[code]

View 3 Replies

Write A Program That Takes A String Of Bits And Encrypts It Using DES Encryption?

Feb 19, 2010

Alright, So ive returned to using vb after several years now. Ive programed in VB6.0 years ago and I was quite proficient at it. However after returning to vb (now using Visual Studio 2010). Either Ive forgotten everything, or something has changed. For a university project. Im trying to write a program that takes a string of bits and encrypts it using DES Encryption.

[Code]...

View 3 Replies

Parsing A Long String?

Jul 13, 2010

I have a very long string. I need to parse this string so I can get information out of it. I know what each segment starts with and ends with. The length of the information will vary. I don't know what the easiest way of parsing this string.

Example data will be

ST*997*232898~AK1*HC*8888*~NM1*2*TESTING........

So i will want to get everything from ST to AK1then AK1 to NM1 and so on and so on.

View 10 Replies

String Must Be Exactly One Character Long?

May 15, 2012

error message i get during compile programe:

string must be exactly one character long. Couldn't store <1 > in scopee column.
Expected type is char.
this is my sql db:

[code]....

View 7 Replies

ToolTip Does Not Appear When Set To A Long String?

Dec 20, 2010

I am working in VB.Net 2010 framework 2.0.I am setting a big string to tooltip object. In this case tooltip is not appearing. If the string is short (say of 10 lines), tooptip is appearing properly.The following is the code:[code]....

If the "PanelText" is too long (say 50 lines), it does not appear. Sometimes it shows an empty tooltip.

View 3 Replies

Why Does The ToolTip Not Appear When Set To A Long String

Dec 20, 2010

I am working in VB.Net 2010 framework 2.0. I am setting a big string to tooltip object. In this case tooltip is not appearing. If the string is short (say of 10 lines), tooptip is appearing properly.

View 2 Replies

Adding Long String To Textboxes?

Apr 21, 2012

Is there another way to make it so I can add long text to a textbox instead of doing:
richtextbox1.text = "Long string"

View 8 Replies

Cast From String To Long Not Valid

Apr 22, 2011

I have a text file with names that have spaces and commas. For some reason when I read the file it gives me this error. Code is below. Also, I am reading the file into a combobox.

[Code]...

View 12 Replies

Create A String That Is X Characters Long?

Jan 10, 2012

A question: How can I create a string that is x characters long, but is made up of "space bar" characters?

View 6 Replies

How To Get String From Address Specified By Long Type

Oct 13, 2010

In vba, There is an address held by a long type which points to a null-terminated string, but I can't find a way to get the string from this address:
long str_address = ...
string str = ?

View 2 Replies

Calling A Sub To Count Commas In Long String?

Jul 7, 2011

look at this code and see how i can speed it up? Its calling a sub to count commas in long string.Calling part 'Sort the incomming messages Dim count_Coma As Integer = CountCharacter(_InMessToAction, ","c)

The sub. This takes about 0.7 of a second to count 20 commas in string _InMessToAction. Was hoping to get it down to 0.1... if at all possible.

[Code]...

View 5 Replies

Convert A List(of Long) Into A String Array?

Oct 26, 2009

I want to convert a List (of Long) into a string array.

Reason: it's a list of database IDs and I want to make a comma delimited string to pass into a stored proc.I tried this:

Dim commaDelimitedList As String = String.Join(",", itemIDList.Cast(Of String)().ToArray)

but I'm clearly not using the Cast correctly since it throws an exception:

System.InvalidCastException: Unable to cast object of type 'System.Int64' to type 'System.String'..

Is there a way to get Cast working for this, or am I stuck with ConvertAll and a delegate function?

View 3 Replies

Display Multirows When String Is Too Long On Datagridview?

May 22, 2009

Display multirows if the string is too long on datagridview?[code]...

View 2 Replies

Find A Set Of Numbes In Long String Using RegEx?

Oct 28, 2011

Ive been searching the Stackoverflow but couldnt find the exact thread that my problem is this, i want to be able to find and take out any occurances of 8 digits wihtin a string.

Dim SetOfMatches As MatchCollection
Dim MyRegex As New Regex("A^d{8}$A")
Dim TestString As String = "testing 12345678 testing"
myMatches = myRegex.Matches(TestString)
For each Row as Match in myMatches
console.writeline(row.value)
Next

this doesnt not generate any hits. but i want to find the 8 digit occurance in the middle of the string.

I am very basic in RegEx.

View 1 Replies

Split A Long String Of Data Into An Array?

Dec 29, 2009

I am trying to split a long string of data into an array:

[Code]....

Ive tried a few ways to write out the regex, but to no avail. Also, sometimes responseFromServer2 contains newlines, and sometimes it does not, depending on the response I get from the server...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved