|
Member 14792393 wrote: I decided to improve some characteristics and I eliminated some properties and added some. A key question is what you did to the Forms that had instances of the UserControl that used the removed Properties: of course any attempted use/access of/to removed "anything" results in compile errors.Member 14792393 wrote: After I open the form I removed the old control and tried to add the new version, but it appears that only the old version is accepted This just doesn't make sense: did you edit the form code to remove any code that used the UserControl instance, and, then, re-build the Project/Solution? Did you re-build the solution after adding the new version of the UserControl?
There is (imho) a defect in Visual Studio that has never been fixed: you can modify a UserControl ... for example, add some new Control to it ... and, the change doesn't appear in currently open design-time Form Windows even after you re-build the solution. However, if you close the designer window, and re-open it: the view has been updated.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
"did you edit the form code to remove any code that used the UserControl instance, and, then, re-build the Project/Solution? Did you re-build the solution after adding the new version of the UserControl?"
Yes, but the application is too big and has many instances of the control.
What I intend to do now is to rename the new version of the control and add it to the project. Then I open each form, erase the old version and insert the new version. After that I can remove the old version. It's a hard job, but I think it's the only way.
What do you think?
Thanks.
|
|
|
|
|
If you really have removed Properties you have to realize that those Properties perhaps are used by the Designer-Script of your Form.
So you must open the DesignerScript of your Form, find those part which assignes the Properties of this Control and delete those Assignments which are not more existent ...
|
|
|
|
|
good point from a slightly different angle
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Maybe you're right. I'll take a look.
Thanks.
|
|
|
|
|
you will see it ...
And you are welcome ...
|
|
|
|
|
Here is some sample data i have been provided using json post
{
"PropertyInfos": [
{
"Identification": {
"IDValue": "102"
},
"PropertyName": "Casa Bella",
"ManagementCompany": {
"ManagementCompanyName": "ACME Trusts",
"Identification": {
"IDValue": "2"
}
},
"Address": {
"Address": "425 Slopestyle Skies Se",
"City": "Lincoln",
"State": "NE",
"PostalCode": "67123",
"Email": "test@example.com"
}
},
{
"Identification": {
"IDValue": "20"
},
"PropertyName": "Tall Tower",
"ManagementCompany": {
"ManagementCompanyName": "ACME Trusts",
"Identification": {
"IDValue": "2"
}
},
"Address": {
"Address": "789 Steele Street",
"City": "Denver",
"State": "CO",
"PostalCode": "80206",
"Email": "tall.tower@example.com"
}
},
{
"Identification": {
"IDValue": "92"
},
"PropertyName": "Z Emerson",
"ManagementCompany": {
"ManagementCompanyName": "ACME Trusts",
"Identification": {
"IDValue": "2"
}
},
"Address": {
"Address": "2199 112th St S",
"City": "Chicago",
"State": "IL",
"PostalCode": "60444",
"Email": "test@example.com"
}
}
]
}
How can I convert this into a list or dictionary so i can then work with each of the entries and import them into my system using c#. if they were in a list or dictionary i would be able to go through the list and do what i need with each data entry. I am very new when it comes to working with JSON api and what not. Any help or pointers in the right direction would be awesome. Thank you guys! 
|
|
|
|
|
Why not do what JSON is meant to do and convert it to classes? You can then use the classes directly in your code instead of trying to manually process the hierarchical data.
It's even easy to do: paste the JSON into your C# app in VS using "Paste special...Paste JSON as Classes" and VS will create the classes it represents for you. You can then use a JSON reader (I use Newtonsoft JSON.NET[^]) to process the JSON string and give you the filled out class data.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
 Lol im completely new to JSON so sorry for not knowing exactly what its supposed to do Heres the code to convert it to classes. I used quicktype.io to help me
<pre>
namespace quicktype
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public partial class Welcome
{
[JsonProperty("PropertyInfos")]
public List<PropertyInfo> PropertyInfos { get; set; }
}
public partial class PropertyInfo
{
[JsonProperty("Identification")]
public Identification Identification { get; set; }
[JsonProperty("PropertyName")]
public string PropertyName { get; set; }
[JsonProperty("ManagementCompany")]
public ManagementCompany ManagementCompany { get; set; }
[JsonProperty("Address")]
public Address Address { get; set; }
}
public partial class Address
{
[JsonProperty("Address")]
public string AddressAddress { get; set; }
[JsonProperty("City")]
public string City { get; set; }
[JsonProperty("State")]
public string State { get; set; }
[JsonProperty("PostalCode")]
[JsonConverter(typeof(ParseStringConverter))]
public long PostalCode { get; set; }
[JsonProperty("Email")]
public string Email { get; set; }
}
public partial class Identification
{
[JsonProperty("IDValue")]
[JsonConverter(typeof(ParseStringConverter))]
public long IdValue { get; set; }
}
public partial class ManagementCompany
{
[JsonProperty("ManagementCompanyName")]
public string ManagementCompanyName { get; set; }
[JsonProperty("Identification")]
public Identification Identification { get; set; }
}
public partial class Welcome
{
public static Welcome FromJson(string json) => JsonConvert.DeserializeObject<Welcome>(json, quicktype.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this Welcome self) => JsonConvert.SerializeObject(self, quicktype.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters =
{
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
internal class ParseStringConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
long l;
if (Int64.TryParse(value, out l))
{
return l;
}
throw new Exception("Cannot unmarshal type long");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (long)untypedValue;
serializer.Serialize(writer, value.ToString());
return;
}
public static readonly ParseStringConverter Singleton = new ParseStringConverter();
}
}
Now ive created a class in c# where i can access these classes. How do i get JSON to put my POST data into these classes. Or are you able to point me to a video, guide, etc that could help me learn this
|
|
|
|
|
As I said, I prefer Newtonsoft, so follow the link in my original response, and it'll show you how to deserialize it. It's only one line of code!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
There is a requirement to send and receive data over TCP/IP with a Fiscal (tax) device which acts as a gateway to the Tax authority server.
The application runs on c#.
Can anyone suggest suitable c# libraries which can be used for this purpose?
The data is to be packaged in JSON format.
Any help would be very much appreciated.
|
|
|
|
|
|
ICARUS999 wrote: There is a requirement to send and receive data over TCP/IP with a Fiscal (tax) device which acts as a gateway to the Tax authority server. Have you researched the API, and/or requirements/protocols/syntax/authorization, for interop with the specific device you describe ?
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
hello
have searched google a lot but couldn't find any.
i am trying to create a report in visual studio 2019. data is coming from SQL server and using
reportViewer1 to print the report.
can someone show me a good tutorial on it.
|
|
|
|
|
The reportViewer control has print controls on it. Did you try those?
|
|
|
|
|
i can't get to show data in the report.
i even tried with report wizard too.
first created a dataset then in the dataset created data table.
after this report filed headers are added to the report and when i run report shows only header names but no data.
|
|
|
|
|
It's been a long time since I have used it so I don't remember any specifics but it sounds like either the sql is not being executed or it is and it's not returning data.
Try using Sql profiler on your database to see if any sql is being executed.
|
|
|
|
|
|
Hey,
The idea is very simple, as Blazor can run ether as a Webassembly or over SignalR, shouldn`t it be possible when using a SignalR connection, to mirror the whole website of a user?
Like for support purposes, to inject a support person directly into what the user is seeing by mirroring the connection and replay all actions from one user to the output of another one?
|
|
|
|
|
Hi all hacking members I am new join
|
|
|
|
|
Wrong site: this is not a hacking site, and we do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.
You will get no help hacking anything here.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
That's why I didn't add a report in S&A.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What's wrong with hacking? I had a parrot doing it all the time!
|
|
|
|