|
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
|
|
|
|
|
Hi Christian
Many thanks for your prompt reply. Just to clarify the values in the array are strings. Basically I have created a form that collects user input the input is checked by a class and if the strings are valid they are added to the arrays. When I diplay the values in array1 in a treeview I want to tke the selected index of the treeview and read the matching 32 items from the second array to a listview. I am not sure if I am missing something but it seems very difficult and cumbersome to code.
|
|
|
|
|
OK - you cannot change the state of a string ( they are immutable ). Is tracking changes an issue ? If not, then stick to what I said.
Yes, there is no built in support for a container to contain ranges of items from another container, not without actually doing what I said.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
in my vb.net project when i click a button it should start a wizard and i need to parse a dice job bord resume
mail me at rajesh.batchu@cesltd.com
|
|
|
|
|
braejsh wrote: mail me at rajesh.batchu@cesltd.com
So let me get this right - you've posted two jobs to this forum, with your email address. No sign you've tried to do any of this yourself, are you really hoping someone will take the time to write all this and email it to you ?
What version of .NET are you using ? .NET 2.0 has a wizard control. As for parsing a web site, there's articles on how to do that. Putting a web site into your app is trivial.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i am using the .net 2.0 but where is the wizard control i am unable to find it plz help me
mail me at rajesh.batchu@cesltd.com
|
|
|
|
|
Perhaps there's only one for ASP.NET. No matter. Just create your wizard pages as controls and write a control which contains them and shows them one at a time.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
in my vb.net porject i need to have tosend mail but it shoul have the same interface of ms outlook can any one help me
mail me at rajesh.batchu@cesltd.com
|
|
|
|
|
braejsh wrote: mail me at rajesh.batchu@cesltd.com
No - that's not what the forums are for. If you registered with this email, the forum will mail you.
braejsh wrote: but it shoul have the same interface of ms outlook
You mean it should look entirely like outlook ? There are some controls about on this site and others that emulate parts of the outlook UI. You're going to have to find them, or buy a library and make the UI yourself. Sending the mail itself is trivial, as I'm sure you are aware.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello,
I am alex i am a .net programmer in my application i want to produce crystal report but the fields are coming from different tables ie, the fields are decided at the time of running.my problem is how can i bound these values into an unbound field in crystal report ,Can anybody give me a valuable suggestion..
i am waiting for your replys..alex.
|
|
|
|
|
I need the value in "\d*" to replace the "5". Is there an easy way to move that value over there?
Equation = Regex.Replace(Equation, "sqrt\d*", CStr(Math.Sqrt(5)), RegexOptions.IgnoreCase)
|
|
|
|