|
|
Wow, that looks pretty perfect. Would that bind easily to my parent and child objects and allow me to filter the shown data without altering the "master objects Lists"?
|
|
|
|
|
Sorry, I've not used those controls before, so I can't answer that.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Let's assume I have a class with values:
public class MyClass
{
public string myString;
public int myInt;
} Further, let's assume I have a List of this class:
public List<MyClass> myList; I would like to display all the myString and myInt in a DataGridView with 2 columns, but I would also like to implement a filter that would restrict what would be shown in the DataGridView. For example, one filter would be to only show myInt values between 0 and 5, but please note that I don't what to alter the List itself, it contains "master data" that should never be thrown out or modified. What would be the best approach to achieve this? I would prefer to do this in .NET 2.0, unless there are major reasons to switching to something newer.
|
|
|
|
|
If you use a BindingSource to bind the data to the grid, you can set its Filter property to filter the items which are displayed without removing them from the underlying data source.
BindingSource.Filter Property (System.Windows.Forms) | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Post your question in the forum at the bottom of that article.
|
|
|
|
|
Im trying to consume this WS and response NULL. I dont know why because when I test it in boomerang tool work good. Please if someone can help me
The method dont receive parameters and return a string.
using Tassadar.Core.Interfaces;
using ServiceSeedReference;
using System.Threading.Tasks;
namespace Tassadar.Infrastucture.Repositories
{
public class FacturaRepository : IFacturaRepository
{
public string GetSeedSII()
{
string s2;
CrSeedClient seedClient = new CrSeedClient();
s2 = seedClient.getSeed();
return s2;
}
}
}
Is a public WS.
wsdl: https://palena.sii.cl/DTEWS/CrSeed.jws?WSDL[^]
Thanks!!
PD: sorry for my english!
|
|
|
|
|
You're going to have to contact the vendor for this one.
Everything is being done by the "CrSeedClient" class, but nobody but the vendor knows what the class is doing, what it is expecting from your code, or how it works.
|
|
|
|
|
getSeed requires a parameter of type getSeedRequest , and returns a getSeedResponse object.
Testing this in a console app:
CrSeedClient client = new CrSeedClient();
getSeedRequest req = new getSeedRequest();
getSeedResponse resp = client.getSeed(req);
runs OK but still returns null in resp . If I omit the getSeedRequest parameter it won't compile.
However, if I run the above code with Fiddler listening in, then I can see the response received does actually contain XML, and is not null. Not entirely sure what's happening here but I suspect there's no implementation of getSeedRequest.ToString() so it returns nothing. As a workaround, the following seems to work fine:
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using System.Xml;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
WebRequest webreq = WebRequest.Create("https://palena.sii.cl/DTEWS/CrSeed.jws?WSDL");
webreq.Headers.Add("SOAPAction", "");
webreq.Method = "POST";
byte[] bData = Encoding.ASCII.GetBytes("<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><q1:getSeed xmlns:q1=\"http://DefaultNamespace\"/></s:Body></s:Envelope>");
webreq.GetRequestStream().Write(bData, 0, bData.Length);
WebResponse webresp = webreq.GetResponse();
XmlDocument doc = new XmlDocument();
doc.LoadXml(new StreamReader(webresp.GetResponseStream()).ReadToEnd());
Debug.WriteLine(doc.InnerText);
}
}
}
|
|
|
|
|
|
Glad you've got it going. Hopefully you can modify this code for any other calls you need for that Webservice.
|
|
|
|
|
Suppose your API takes a ID and then it returns a JSON response with that the ID in it.
Ex: Get: http:/example.com/id="12345";
responsse:
{
id: "12345"
}
Is it possible to validate 100s of different APIs and their responses if they all contain the same parameter and its value you passed in the response, this could be any datatype and any attribute and check if response contains that. but they all are different.. and make it generic??
|
|
|
|
|
Maybe you should give us some more context info for this problem.
Like course number and title, which homework exercise, and the hand in deadline.
You could identify the college / university as well.
|
|
|
|
|
was that suppose to be funny? I am here just trying to get some ideas and help
|
|
|
|
|
Member 14779968 wrote: was that suppose to be funny? What makes you think it was? Care to explain?
We are just here to help; but no guarantees we'll be any.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
OK, then:
What type of application are you building?
Those "100s of APIs", are they developed in-house? Do you have access to their source code?
Could you give us a clue to why and how the solution you are searching should be applied to literally hundreds of APIs - are you (or your employer) actually developing (implementations for) hundreds of APIs that should use the same validation?
In these hundreds of APIs, could you give some hint to what kind of datatypes and attributes you will find?
Would it be an option to return to your superior and say: "I am convinced that it is a poor idea to make one super-general validation function for every possible data type and attribute in several hundred APIs. I suggest that we don't do that!" ?
... Noone here believes that your problem statement comes from a real-world software developments project. It shines bright and clear that this is an exercize given at a college or other educational institution.
So be honest with it: The professor has given us this assignment, and I here is what I have written to return the attribute name ("id") and value ("12345"): [...]. But he wants it to valid for "any datatype" - I don't understand what he means typ that; it comes as a string from the URL. How can it come as some other datatype?"
That would be a valid question that might generate responses. But the way you have presented it, it sounds more like: "I am too busy to do this homework assignment right now, so could someone please provide something for me to hand in?"
If you really are as totally blank as it seems, tell us. Indicate whichever pieces you have understood, if ever so small, and we could try to work it out from there. But be warned that you can only expect to get help to understand things enough to do the homework yourself. You won't get help so that you don't have to do it yourself.
|
|
|
|
|
Message Closed
modified 19-May-20 20:40pm.
|
|
|
|
|
Member 14779968 wrote: It is a real time enterprise application. On an OS that isn't realtime? Do explain that magic, or ask your money back.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Thanks for help.. I will ask for my money back
|
|
|
|
|
|
Member 7989122 wrote: The professor has given us this assignment Find a decent one.
He's the teacher, so I refuse to explain. He's paid, not me.
Anything else you desire?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
You're welcome, of course.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
This was exactly what I needed. Thank you
|
|
|
|