My.settings Complex Object Is Nothing
Mar 26, 2010
I'm trying to save some settings in a complex object. If I make a dll of the class I can then add it in the projects properties settings list as that type.When the program runs though it won't show up as anything other than nothing. I read you have to have a sub new empty constructor which I have but don't know why else this would fail.First question is how to you do this. Second is there anyway to use a class inside the project as the target of the settings type or do you have to bring a in an external dll to do this every time? [code]
View 4 Replies
ADVERTISEMENT
Apr 1, 2009
I have an XML File that I am processing using LINQ. I want to basically serialize the XML data into custom objects but don't know how.
[Code]...
How can I finish the above LINQ query to populate the Children property of the Group object?
View 2 Replies
Feb 22, 2010
I am trying to send an object created in JavaScript to an ASP.NET PageMethod. This object mirrors the properties of an existing custom business object, so i was hoping that i could pass a single object instead of a parameter for each property. I am getting an error "Unknown web method SavePart when attempting to use this method.
Javascript:
function() {
var pt = { Id: 1, Onhand: 20, LowPoint: 30, __type: 'Custom.Objects.Part'};
$.ajax({
[Code].....
View 2 Replies
Feb 17, 2012
i have a complex object that holds a WPF Canvas with many child canvases, rectangles and, lines. The object includes some home grown classes as well. The main object and the home grown classes have the <Serializable()> attribute set. I tried the general formatter.Serialize(strm, rb_x) to serialize the object to a memory stream. I then found out that WPF classes are set as serializable. So after some research I discovered the System.Runtime.Serialization and found a generic Serialization Surrogate.So after some debugging I was able to serialize the object to a memory stream then copied the stream to an array of bytes then store that array in an OLE field in an MS Access table.
When I read back the access record and copy the OLE field byte array back to a memory stream and then de-serialize it back to the object I get a SerializationException "Error binding to target method."
So question #1 - is what I am trying even possible?Question #2, (assuming #1 is yes) do I need to do something special with WPF Baml type objects.
View 10 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
Mar 14, 2010
The issue is when I try to add a new item to the ArrayList with the following code, it gives me an error:
vb Private Sub btnLabelAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLabelAdd.Click
Dim result As String = InputBox("New Filter Label:", "Label List")
[CODE]................
Object reference not set to an instance of an object.
I'm not really sure what I'm supposed to be doing with this. It's a new setting I just added and it's empty, so I'm not sure if that has anything to do with it or not. Anyone know what's going on and what needs to be done to get it to accept a value and not want to be "initialized"?
View 9 Replies
Dec 28, 2009
I have a custom settings file that I designed using the designer. In my form, I have a function that creates a new instance of this settings by using a dim statement. Then I add this new settings object to a hashtable. After I exit this function, I no longer have access to the settings object without using the hashtable to retrieve it. If I want to remove the object from the hashtable, I can do a simple remove but the settings object still exists somewhere in memory. How can I dispose of this object as well since it inherits from ApplicationSettingsBase and does not have a built in Dispose() function?
View 5 Replies
Jul 17, 2009
I am trying to save a custom object as a user setting in a VB.net app. This object consists of a List(Of Pair(Of String, Object)). Pair is a custom class which has two read/write properties (a String and an Object).
If I put simple types like int, string, datetime as the second value of my pair, the setting is saved without any problem. But if I try to put something more complex, like a list, there seems to be a problem during serialization and my setting is not saved.
String values in my pairs are serialized like this:
<value1>Priority_1</value1>
Object values are serialized with a special attribute:
<value2 xsi:type="xsd:int">2</value2>
Seems like values of type Object are serialized differently, to "remember" what is the real type of the object. Why can't it do the same for more complex types like List(Of T)?
View 1 Replies
Dec 17, 2009
I have a sub that I want to receive a My.Settings object. I don't know, though, which kind of object to use in the declare line of the sub. For example:[code]
View 3 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 25, 2012
I'm pretty sure this has been answered on this thread before, but I'm having trouble searching for it, so I decided to make a new post. Anyway, My problem is that I have a Setting from "My.Settings.Navigation" that is a Specialized String Collection, and what I am trying to do is find a method in which I can attach "My.Settings.Navigation" to a ComboBox. I was also wondering if it was possible to make it only hold up to 20 items at a time?
View 4 Replies
Jan 20, 2012
I'm getting an intellisenxe error saying that the statement below is expecting a ')' and is positioning the correction ater the parenthesis following "Approved". I'm not familiar with this IF syntax and I can't seem to make the correction; trial and error isn't working ;o)) If (reader.Item("Approved"), True, False) = 0), (reader.Item("DoNotDisplay"), False, False) = 0)) Then
View 2 Replies
Jun 10, 2010
I am having a problem setting up my combo box to pull its menu from a SQL Server table and store to the main data table.Currently my drop down list displays correctly but saves 'System.Data.DataRowView' to the data table. My main data table is called 'Survey' with staffname as a column, then I have another menu table of staff member names which populates the drop down menu.I found that when I remove the DataSource and populate the Items collection instead the combo box saves the correct value as expected but when I use the datasource it saves the words ''System.Data.DataRowView',[code]
View 2 Replies
Sep 9, 2010
I have combox1 and i want to dispaly Foure Columns in combox1 and I make this
Dim dr As SqlDataReader = SqlHelper.ExecuteReader(conn, CommandType.Text, "select FirstName,FatherName,GrandFatherName,FamilyName from dbo.PersonalData")
Dim dr As SqlDataReader = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, "GetSpecialFieldOFPersonalData")
Do While dr.Read
Me.ComboBox1.Items.Add(dr(0) & " - " & dr(1) & " - " & dr(2) & " - " & dr(3))
Loop
View 5 Replies
Apr 18, 2011
How do I use complex numbers in Visual Studio 2008 and in Visual Basic, dont tell me I spent all this money on VS2008 Pro only to find out that it cant handle complex number arithmetic!
View 1 Replies
May 17, 2012
In my spare time i give myself programming stuff to do. Today i want to write a function that goes through a string, if the string contains any numeric value the function must return false, if the string has any special characters it must also return false else return true. For example the following strings would return as follows:
String Return Value
Travis True
78* False
[code].....
View 4 Replies
Sep 15, 2009
I am currently working on a project, which purpose is to call a webservice through a VB script. VB is by far not my first language and I simply reach the point where I do not know how to go on from here.
I have a Webservice descriped in a WSDL document that defines a service that takes a complex type as parameter and returns such one as answer.
The complex type is basically just a string that is wrapped inside a class object. So what i did was to create a new class module and added a public variable to it. I created a new instance of this class, gave it for the purpose of testing a value and tried to call the webservice. Everything goes well untill i reach the call to the webservice, where the program throws an exception that says:
"Class does not support automation or does not support expected interface"
My first thought was that the initialization of the object might have gone wrong but i am quite able to set and get the values on it. So i have to assume that the object is okay. I know that the url to the WSDL document is correct, due to the fact that I can call the document via the browser and it will throw an exception of "wrong type" when i feed the soap method with a primitive.
With out luck I browsed several pages on the net to find a clue what this could. So now i wanted to give this forum a shot.
You should know that i am not able to alter the WSDL file. I have to go with the way it is. In addition am supposed to stick to VB 6.0.
I used a Form in VB to make the call to the webservice.
Here is the call procedure:
Private Sub Command1_Click()
On Error GoTo ErrorHandler
Dim tS
[Code]....
View 4 Replies
Feb 8, 2011
I have a custom modelbinder built to handle my accountRequest class.This class consists of some boolean values and a UserViewModel.The UserView Model is made up of strings such as Firstname, Last Name, Address.Originally I was just passing the UserViewModel as the action parameter but I now I need to package UserViewModel inside of accountRequest.however, now my modelbinder will not map the strings in the httpContext.Request to my UserViewModel inside of AccountRequest. All of the booleans map just fine.Is there an easy way to get his data to map to the UserViewModel properties other than hardcoding it? [code]
View 1 Replies
Jul 29, 2009
I suppose this is more of an opinion question, but, when you start a big project, what do you think about before you even start Visual Studio? Do you setup structure and files before actually coding them, or do you code them one-by-one?
View 2 Replies
Nov 16, 2010
I have a product table which has around 90 columns in. Must of the columns are integers. When I search for an existing product and insert it into a row its fine but when I alter one of the columns and do an update using the command builder I get 'Expression Too Complex'. Does anyone know why this is happening and how to fix it?
View 4 Replies
Oct 3, 2011
Im making a herbal database program and I am having troubles setting up HierarchicalDataTemplates for my main data class.
[Code]...
View 1 Replies
Jan 13, 2011
The company has been using Visual Studio 2008 and .NET Framework 2.0 for approximately 2 years. During that time we released several versions (4.x.x) of our program to the public and were able to preserve the user's settings using My.Settings.Upgrade.During the past development cycle we upgraded the program to Visual Studio 2010 and .NET Framework 4.0 and changed the version to 5.x.x. Now, when a user upgrades from 4.x.x to 5.x.x they lose all of their settings.However, in all upgrades after that point (ie 5.0 to 5.1) all the user's settings are once again preserved.I checked C:Documents and Settings<USER_NAME>Local SettingsApplication DataCompanyName and it contains two directories:
ApplicationName_Url_aaa ApplicationName_Url_bbb
where aaa and bbb are 32 character strings. All of the user.config files for the 4.x.x releases can be found in the ApplicationName_ Url_aaa directory. All of the user.config files for the 5.x.x releases can be found in the ApplicationName_Url_bbb directory.Based on this information it seems like something changed when we converted our program to VS2010 and Framework4 that is now causing a different 32 character string to be generated. However, we have been unable to track it down.
View 9 Replies
Jan 3, 2012
I have the following structure:OLD: frmMain (WinForm)uscStat (UserControl with Grid) In frmMain I'm able to make some settings and load the result of the settings via LinQ into the Grid of the uscStat.
[Code]...
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
Sep 8, 2009
Is there a way to maintain application modified Settings in the settings files after a program update? i.e. I have 10 or so values in the settings file and the users can modify them... when I send a program update they revert back to what I initially programmed them to be.
View 3 Replies
Feb 9, 2012
I would like to know if there is any simple/fast way to create a complex XML file, when I say complex, I mean more than 20 elements encapsulated. Although this is VB.net,unfortunately literals will not work in this case
View 2 Replies
Feb 26, 2012
Imagine you want to draw a regular shape such as a triangle, rectangle ... all the way up to say a 10 sided figure ( a decagon ) or more. I know that when we try lots of sides it looks closer and closer to a circle or an ellipse. The problem I am thinking of is placing smaller circles ( or ellipses ) at the correct positions near the points of that shape as shown for a triangle below.Here comes the question(s) How could we: a) Correctly place the circles ( or ellipses ) at the points so that the sides are at a tangent to them andb) Can we combine the REGIONs of these to produce a figure with rounded points so the light blue bits get excluded? I guess that to produce a method to deal with all the mathematics involved would be quite a complex task.Has anyway previously tackled doing this or know of any .Net tools I could use for this problem?
View 11 Replies
Jun 16, 2010
I am currently trying to find a way to accurately print a complex form that I created in VB6.
I stumbled upon a company that has a very impressive package called Winform Reports.
[URL]
Currently it is only supported in .NET.
Does anything like this exist for VB6?
View 2 Replies
Aug 15, 2011
I wanna search items like MS windows search for example if i wanna search mp4 files i should write "*.mp4" its enough my searching but if i ll use filter function i cant do this on datagridview couse when i want to search something i need to know full name of this record... its to bad for me... is there any way? can i do it?
View 2 Replies
Mar 17, 2011
I have a control that looks similar to the following:
I need to add slightly round ends where all that extra end space is. I'm not sure how to add these. It should look similar to the round ends on this page.
View 1 Replies