VS 2008 System.Collection.Hashtable In Project Settings?
Mar 24, 2010
I've defined a setting called CustomActions as a System.Collection.Hashtable. I also have a form with two textboxes (Name & CommandLine) that I want to add as a Key/Value pair to the CustomActions settingHowever, when I come to add the kvp to Hashtable I get the dreaded "Object reference not set to an instance of an object". I know what the error means I just don't see why it's relevant here.
Dim CustomActionForm As New DefineCustomAction
If CustomActionForm.ShowDialog = System.Windows.Forms.DialogResult.OK ThenMy.Settings.CustomActions.Add(CustomActionForm.txt_CAName.Text,
[code].....
View 1 Replies
ADVERTISEMENT
Jan 27, 2010
I am using a hashtable to cache incoming UDP messages before my application processes them. After adding pairs to the hashtable, I am experiencing strange behaviour when interogating the collection, such that a containsKey() enquiry returns false, even though the key exists and is visible in the locals window. Spelling etc is correct, manually calling GetHashCode on the key (String) at each point (add() and containsKey()) is returning different values for the same key. To complicate things more, some keys are matched successfully.
View 2 Replies
Apr 19, 2012
i have one project that manage my database connection (DBServer) and one project as the main system (MainSystem).In DBServer I store all my connection data that i already managed to my.settings (ServerName, DatabaseName, connectionString, etc).
View 2 Replies
Apr 4, 2011
I use Project Setting in visual studio 2008 and everything works correctly and save my information when the application is closed. However the information it lost when the application is Uninstalled. The information is not available with my new install.how to keep Project Settings through uninstall and installs!
View 4 Replies
Oct 9, 2009
It must be to close to the weekend, but I thought I read at some time an article of an easy way to have a common settings file for both application and user settings across a solution.
I currently have a Solution that contains 4 projects. Each of these projects need to access the same set of settings and be able to update the user settings. Is there a way to do this utilizing the My.Settings functionality?
View 2 Replies
Dec 30, 2009
I am trying to export a dataset to a csv file
VB
Private Sub ExportDatasetToCsv(ByVal MyDataSet As DataSet)
Dim str As New StringBuilder
For Each dr As DataRow In MyDataSet
[code]....
I am getting an error on this line: For Each dr As DataRow In MyDataSet The error is Expression is of type 'System.Data.DataSet', which is not a collection type.
View 3 Replies
Jan 14, 2009
I just wondered if you can or can't save arrays using the settings system object. There seems to be no way of entering it at designtime. It seems implied you cannot create new user settings.subobjects at runtime. I'm looking to find the easiest way to save a populated array of PictureBox's. If the only way is a self/custom made/managed .ini file then I need to know so i can start on that but I was hoping to use some of all this phaff in the new frameworks usefully.
View 3 Replies
Oct 15, 2009
Is it possible to initialize a My.Settings value in a Visual Basic Deployment Project (VS 2008)? I can add the Radio Button Dialog to prompt the user, but I don't see how to use that to set the My.Settings value.
View 1 Replies
Apr 14, 2008
I'm trying to save a collection of key/value settings in my application's "user settings" (they're column widths), but while I see no errors, when I run the code (in the IDE) my collection in "My.Settings" is always nothing at startup. I do a "My.Settings.Save" when the application exits, and barring the "serializers not found" errors in the IDE, no other errors occur. When I run my application as an exe, it behaves the same way..
View 7 Replies
Aug 17, 2011
i have an app, and i want to add a string into a collection in my.settings.'there is a collection: My.Settings.items
My.settings.items.add("string")
'this gives a nullreferenceexception
Dim selected() as string = {"string")
My.settings.items.addrange(selected)
'also a nullreferenceexception so, it turns out you can't do anything.how do I add the "string" into "items"?
View 9 Replies
Jun 8, 2009
I'd like to store a set of key/value pairs in the application settings of my ASP.NET web app, but I'm not finding a straightforward way to do that. For example, these two questions tell me that StringDictionary etc. won't serialize to XML and suggest that I'll have to roll my own implementation. But it seems like this should be easier to do; after all, web.config is XML and < applicationSettings> is essentially a collection of key/value pairs, so it feels like I'm missing something obvious. Given my specific case below, do I really have to roll my own serialization, or is there an easier workaround?
The web app in question is a basic contact form that sends email to different recipients based on the value of a parameter; e.g. [URL]...The goal is to be able add or remove recipients (or change their addresses) by editing the web.config file so that I don't have to recompile and can easily maintain different configurations in test and production environments. For example:
// I can use something like this for the sender address SmtpMsg.From = New MailAddress(My.Settings.EmailSender)
// And then just edit this part of web.config to use different addresses in different environments.
<setting name="EmailSender" serializeAs="String"> <value>webcontact@exampledomain.com</value>
[Code]...
View 2 Replies
Feb 26, 2009
I'm trying to create a favorite box in my web browser using this code in Favorites.vb
Public Class favorites
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
[Code]....
Now I have it so when you click the add button it will put the URL in the string FavList, and place the URL in Listbox1 however I have no idea how to save it, and load it.
So the next time the user opens it, it will have the URL in the string and URL box, so when they click the URL in listbox1 it will redirect the WebBrowser. I think it works like that already I just need to know how to save it, and load it.
View 2 Replies
Aug 24, 2011
currently i am doing a billing system project using vs2010 and sqlserver 2008. i got 2 form, one for invoice & one for delivery order, and a button to submit the invoice details to DO form.
would like to ask a few question,
1) once i add new transaction, the invoice number will be auto increment and save all details into database table.
2) the invoice number cannot use again even after the transaction being canceled.
3) how to make the DO number and invoice number the same as per transaction done / undone.
View 7 Replies
Jul 4, 2010
Im trying to make a simple send key system on my project but it dosent send to the window in in why ?
SendKeys.Send(X)
My.Computer.Keyboard.SendKeys(X)
View 11 Replies
Sep 30, 2011
is there a way to see the My.Settings of one project from within another project within the same solution?I'm guessing the answer is no, they are scoped at the project level
View 3 Replies
Dec 11, 2010
I am making a small tool that require some calculation. I am using hashtable to store values that I need to calculate. This tool continuously extract data on specific time interval(30 seconds) from webpage and add those data into the hashtable. Now the problem is I need to store the previous extraction data and when new extraction occurs, I need to deduct the previous data from new data.Here is the process I am currently following:
HTML
Dim MyTable as New Hashtable
MyTable.Add("Data1","200")
MyTable.Add("Data2","100")
[code]....
On first run it shows the result of Data3 = 100 which is currect. But on second run I need to redefine the value of Data2 = Data1 . So I need a result of Data3 = 0 on second run. This may not be the proper way to do this sort of operation. I have also tried using listbox, listview and even textfile to store the Data2 and recall that on second run.
View 2 Replies
Mar 24, 2010
I am using a Hashtable which stores unique names and objects associated with those names. Now those objects have a property called "IsDynamic" and some of them have it set to false whie some of them have it set to true. So when I retrieve any object using the key property, it goes to find me that object. How do I override that find method?
[Code]...
View 6 Replies
Jul 24, 2009
I don't know why or how but my project just turned into a not working system with hundreds of warnings... I didn't touch any of the assembly or anything that could do this and I don't have a clue. I have backups but one days' work will be gone if I can't resolve this.I got warnings like these:Warning1Could not find type 'crm.MyTextBox'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built.00 Warning2The variable 'txtQty' is either undeclared or was never assigned.L:MartynascrmEquipmentSale .Designer.vb3270Warning3Could not find type 'crm.Mycombox'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built.00 Warning4The variable 'cmbProduct' is either undeclared or was never assigned.L:MartynascrmEquipmentSale.Designer.vb3310 Warning5Could not find type 'crm.MyTextBox'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built.00
View 6 Replies
Apr 21, 2011
a company offered me to develop a project for our attendence system in which finger recognition system is used. now i have quitely no idea that what i do and what do i do with this finger recognition system project.
View 3 Replies
Aug 11, 2011
I would use the System.Linq.Dynamic. I added the specified Dynamic.vb file, that starts like this:
[Code]...
to my (VB.NET)solution. Now Visual Studio does not recognize anymore in the project files the System.XXX references, proposing me to change them to Global.System.XXX
View 1 Replies
Aug 5, 2009
I am rewritting my application to conform to ms standards. We used to save all settings to registry for user settings, servername, size and locations.so we are now saving them into My.Settings app.config the only problem is that each time there is an update clickonce will isntall the newupdate but now all settings are loist and user has to save everything all over again..
I am trying to follow the book here but it seems i keep getting stuck somewhere. registry has worked fine for years but i understand we must move on, but if stuff like this happens then i just wasted a long time converting all code to conform for it to not work..
View 1 Replies
Apr 19, 2012
I have one project that manage my database connection (DBServer) and one project as the main system (MainSystem). In DBServer I store all my connection data that I already managed to my.settings (ServerName, DatabaseName, connectionString, etc). How can I get all the my.settings value in DBServer (ServerName, DatabaseName, connectionString, etc) from MainSystem?
View 2 Replies
Jan 16, 2011
I make project 1. I add 10 settings in the Properties->settings section.
I now make a new project. Project 2. But I want to have the same settings as project 1. It would be easier to import the settings from project1. but can this be done.
Ive seen the setting file in the explorer but this code is auto generated so if its copied into project 2 after you save its regenerated again from the properties->settings values.
View 4 Replies
Oct 4, 2011
I have a project that has several different interfaces (a website, a local application, and some webservices), that all use the same class library. The library is an API to a database. Some settings, like log level, database connection etc, i want to store in a single place, and I want them editable. What is the best way to accomplish this? I am concerned both about ease of editing, and ease of access for the dll, as there will be a lot of calls to it and a lot of lookups for the values. I have considered using app.config, a standalone XML file, and writing values to the registry, but I cannot find any good comparisons.
View 2 Replies
Mar 10, 2009
I want to add a setting that uses an enum defined in form1.vb. All the research I've done suggests support for enum type settings is built-in and handled automatically by the VS IDE ... I assume this means it's as easy as defining font or color settings. However, I'm not having much. Are any of you gurus aware of how to set up an enum setting via the Project Settings UI?
View 8 Replies
Oct 30, 2009
I have created a settings-file for my plug-in-based app. When the mainApp writes the settings to the file, the pluginApp should read the settings from the settings-file (when opening or at runtime even better), but somehow it reads the settings from the app.config-file. This means that the pluginApp never will read the settings according the values of the file.
View 4 Replies
Nov 26, 2010
In a VB.Net project, you can use the Settings tab of the properties page to define application settings. To reference the settings in code, you use the syntax My.Settings.SettingName in VB.
On the Settings tab, you get to choose the Access Modifier. It may be "Friend" or "Public". Presumably, when you choose "Public", you are making the settings accessible to other assemblies. However, once "Public" is chosen, I can't figure out the syntax to reference the settings of one project from another. In fact, I can't observe any difference between using "Internal" vs. "Public" as the access modifier.
My question: Does choosing "Public" as the access modifier make settings accessible to other assemblies? If so, what is the syntax to reference the settings from other assemblies? If not, what does "Public" do?
View 4 Replies
Feb 25, 2009
I get this error
Format of the initialization string does not conform to specification starting at index 34.
When I take my connection string and store it in the project settings. I know that this works.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\Employees.accdb
Because if I use it like this
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\Employees.accdb")
conn.Open()
The connection succeeds but if I try this
Dim conn As New OleDbConnection(My.Settings.Default.employeeConnection)
conn.Open()
I get that error.
name:employeeConnection
type:string
scope:application
value:Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\Employees.accdb
View 3 Replies
Jun 10, 2011
I am trying to retrieve a value saved in project A settings from project B in same solution set. Is this possible in VB.NET? If possible what namespace and function would I use?
View 3 Replies
Mar 5, 2009
I like the way one saves settings in VB.Net, that is, with the project properties. However, I want to develop a mobile project that includes saving some settings. Problem is that the project properties doesn't include "Settings" when developing a mobile project.
View 3 Replies