|
please explain ur problem.
|
|
|
|
|
First, you have to create an association for your file's extension in Explorer. Open MyComputer, then Tools, Folder Options, File Types tab and you can add your extension there.
Next, your application has to be written to accept command line arguments. You can read more about getting your command line arguments from the Environment[^] class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am making a program for a procurement company, i have a database full of suppliers i need code to search, filter search from the database, any other code ideas for this program are welcome. I also need other Ideas of functions to include, that would make my Project better
LynnNhari
|
|
|
|
|
|
I am making a program for a procurement company, i have a database full of suppliers i need code to search, filter search from the database, any other code ideas for this program are welcome.
LynnNhari
|
|
|
|
|
Hello, Iam having a problem with the amount of memory consumed by the aspnet process when performing find and replace operations on large strings. I have a scenario where iam reading a 26mb file into a string using streamReader and then performing upto about 40 find and replace operations.
The problem is, when I do this the aspnet process eats upto 500mb of RAM which is quite obviously not an acceptable overhead! Obviously reading a 26mb file into a string type probably wasnt the intended use for this variable type which why iam seeing such high ram usage.
Does anybody have any ideas of how to perform a find and replace on a large volume of data without the RAM usage spiralling out of control.
PS Ive already tried invoking a fast command line F+R utility which has worked and reduced the memory footprint - but the performance has dropped and the F+R operation now takes 2 minutes longer then before which isnt acceptable either!
I would be very grateful for any input or ideas on this!
Thanks Very Much , Michael
|
|
|
|
|
How are you doing it now ? string functions, or regex ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Dim stylesDataSet As DataSet<br />
Dim stylesDataTable As DataTable<br />
Dim stylesDataRow As DataRow<br />
<br />
Dim tempDataSet As DataSet<br />
Dim tempDataTable As DataTable<br />
Dim tempDataRow As DataRow<br />
<br />
<br />
Dim stylesCounter As Int16<br />
Dim token As String<br />
Dim replaced As String<br />
Dim SQLEval As String<br />
Dim oFile As System.IO.File<br />
Dim oRead As System.IO.StreamReader<br />
Dim oWrite As System.IO.StreamWriter<br />
Dim EntireFile As String<br />
<br />
Dim SQL As String<br />
'SQL = "EXEC tokenReplaceListExec <<CustomerID>>,<<ClientID>>,0,'" & paths("StyleFolder") & "','," & fileName & "'"<br />
SQL = "EXEC tokenReplaceList <<CustomerID>>,<<ClientID>>,0,'" & paths("StyleFolder") & "'"<br />
SQL = queryTokeniser(SQL)<br />
<br />
stylesDataSet = ExecuteDataTable(SQL)<br />
stylesDataTable = stylesDataSet.Tables(0)<br />
stylesCounter = 0<br />
<br />
oRead = oFile.OpenText(fileName)<br />
EntireFile = oRead.ReadToEnd()<br />
oRead.Close()<br />
<br />
<br />
<br />
<br />
<br />
EntireFile = Replace(EntireFile, vbCrLf, "")<br />
<br />
If Debug_Status = 1 Then<br />
oWrite = oFile.CreateText(fileName & ".test")<br />
oWrite.Write(EntireFile)<br />
oWrite.Close()<br />
End If<br />
<br />
<br />
fileFindAndReplace(fileName, vbCrLf, "")<br />
TOCReplace(fileName)<br />
<br />
Do While stylesCounter < stylesDataTable.Rows.Count<br />
stylesDataRow = stylesDataTable.Rows(stylesCounter)<br />
token = stylesDataRow("token")<br />
If Not stylesDataRow("Eval") Is System.DBNull.Value Then<br />
SQL = stylesDataRow("Eval")<br />
SQL = queryTokeniser(SQL)<br />
tempDataSet = ExecuteDataTable(SQL)<br />
tempDataTable = getLastTable(tempDataSet)<br />
tempDataRow = tempDataTable.Rows(0)<br />
replaced = tempDataRow.Item(0)<br />
Else<br />
If Not stylesDataRow("replacement") Is System.DBNull.Value Then<br />
replaced = stylesDataRow("replacement")<br />
Else<br />
replaced = ""<br />
End If<br />
End If<br />
<br />
<br />
EntireFile = Replace(EntireFile, token, replaced)<br />
stylesCounter = stylesCounter + 1<br />
Loop<br />
<br />
<br />
<br />
<br />
<br />
oWrite = oFile.CreateText(fileName)<br />
oWrite.Write(EntireFile)<br />
<br />
oWrite.Close()<br />
Hope this helps , iam basically using string = replace(string,find, replace)
|
|
|
|
|
Strings are immutable, so every time you do a replace, you create a new copy of the string.
You could try to use a StringBuilder instead. It uses a mutable string internally, so it doesn't create a new string for every replace.
---
b { font-weight: normal; }
|
|
|
|
|
hmm thats interesting and something I didnt know - I will try that as it sounds pretty uesful and bit more effecient. I have since discovered some improvements using binaryStream Reader/Write. By reading 5000 chars at a time doing the replace, then writing them to a new file ive lowered the memory footprint and kept a reasonable amound of speed. The problem with doing this is that if an item I want to replace is split accross two blocks then it wont be replace which is a bit of a pain in the ass!!
Does anybody know of a DLL or library item (third party or otherwise..) that I could use for a replace of this kind? Ive googled to no effect so far! Iam tempted to write a DLL in C++ to do a fast job and just include it in my .net project if possible, but I would rather use something already written as time isnt on my side!
|
|
|
|
|
Hello,
I want to be able to update a connection string that I have in my app.config file. This is so that the customer can change the connection to another server or database.
Can anyone give me any example code. I am using Visual Basic 2005.
Many thanks in advance,
Steve
|
|
|
|
|
That's odd - didn't I answer this ? .NET 2005 has a new settings file setup that will save your settings for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello
I am using my.settings to create a application scope connection string.
The customer would like to change this if they want to connect to another database, and this should update the app.config file with the updated connection string.
My problem I have into the setting and create a connection string (easy). But I don't know and can't find out to update and save the new connection string.
My.Settings.cnnString = "This is example connection" 'Error read-only property
I am using vb.net 2005
Can anyone help,
Thanks in advance,
Steve
|
|
|
|
|
I think you may have the cnnString setting variable defined as "Application" scope which is read only. If you change it to "User" scope your error should go away.
Make the change in the My Project > Settings tab.
Cheers
Tim
|
|
|
|
|
Hello Tim,
I have changed the setting from application to user. However, if you select connection string, then you cannot select user. It always defaults to application.
Is there another way?
Thanks very much,
Steve
|
|
|
|
|
The only other way is to load the app.config file as an XML Document, make the changes you need to that, then resave the XML Document back over the original config file.
You can find more by Googling "read write app.config file[^]". The first link in the list goes to an article right here on CP.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You have gone a bit further than I can help, but try this in VB help...
ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/wd_adonet/html/1471f580-bcd4-4046-bdaf-d2541ecda2f4.htm
Cheers
Tim
|
|
|
|
|
|
Before you update the tree, you have to save the current state of each child node, expanded or collapsed. After the update, you then have to go through and reset each of the child nodes that you found expanded. You'll probably have to save the name and expanded state of each node if the treee data can add/delete nodes while your app is running.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I found this function in the data report.
Whis the first one is SUM,MAX,MIN...
but there is some function i not so sure is it those i want ...
anyone know wat is stand for?
Rcnt
Vcnt
Sdev
SeRR
I was looking some function that will calculating the percentage of the sub total.
|
|
|
|
|
All the remaining documentation for an old DataReport object is here[^].
You might want to try looking at this[^] example for adding a calculated field to your report.
I really can't tell you how to do it, 'cause I haven't used VB6 in about 6 years. But, from what I can remember, RCNT returns a RecordCount and SDEV returns a Standard Deviation.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to open a wizard in vb.net when i press a button and this wizard is for parsing the dice job board resume and bringing name mail id and phone no
mail me at rajesh.batchu@cesltd.com
|
|
|
|
|
Please don't ask the same thing twice.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Everyone
I am new to VB however I am trying to find a way to link elements in an arraylists. I have created three classes to validate and populate the arraylists with data and this seems to work ok.
The arraylists have fixed sizes Array1 = 16 Array2 = 512 Array3 = 8192
What I am trying to do is have the first element of array1 point to the first 32 elements of array2
array1(0) array2 0 – 31
array1(1) array2 32 – 47
.
array2 (0) array3 0 – 31
array2 (1) array3 32 – 47
By example if I selected an item from a tree view say array1 index 1 it would make index items 32 – 47 appear on a list view.
I would very much appreciate your assistance
Many thanks
Rob
|
|
|
|
|
Sounds like you want array1 to be a list of lists. Element 0 is a list which contains the first 32 items from array2. If the objects in the arrays are classes, they will be assigned by reference, so they will point to the same objects.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|