|
Well that was uplifting!
At least I designed my model right.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
This actually worked after modifying the document and taking out Hawaii.
I didn't think of it when I posted the first time, but it makes sense now.
I just appended && c.states.Contains(stateCode) to the filter.
I was hoping my model of states would work as like a continuous string of values.
var results = new List<QuotedShipRates>();
var filter1 = Builders<WEBSITE_SHIPSERVICES>.Filter
.ElemMatch(c => c.Countries, c => c.Abbr == countryCode && c.States.Contains(stateCode));<br />
var shipRates = await _context.WebsiteShipServices.Find(filter1).ToListAsync();
foreach (var shipRate in shipRates)
{
results.Add(new QuotedShipRates()
{
Name = shipRate.Name,
Code = shipRate.Code,
Alias = shipRate.Alias,
Rate = 5.99M,
GuaranteedDate = DateTime.Now.AddDays(shipRate.Days_Max),
Selected = false
});
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
|
Please don't repost if your question does not appear immediately: both of these went to moderation and required a human being to review them for publication. In order to prevent you being kicked off as a spammer, both had to be accepted, and then I have to clean up the spares. Have a little patience, please!
I've deleted the spare.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Hi,
I got issue with reading data with proper encoding from DBF file.
Can you please help me to fix it? I can already read it but I can't find a way how to read the stream and convert it on the fly. All internet findings are not enough for me to adjust my code properly.
Her is the the code I use to read with wrong encoding:
private void WczytajTabeleSubiekta(string nazwaTabeli, string parametr, string parametr2, out DataTable dt)
{
dt = new DataTable();
try
{
OleDbConnection oConn = new OleDbConnection("Provider=VFPOLEDB.1;" + "Data Source=" + subiektPath + @"\DBFS\" + nazwaTabeli + ";Collating Sequence=machine");
oConn.Open();
System.Data.OleDb.OleDbCommand oCmd = oConn.CreateCommand();
oCmd.CommandText = "SELECT " + parametr + " FROM " + subiektPath + @"\DBFS\" + nazwaTabeli + " " + parametr2;
dt.Load(oCmd.ExecuteReader());
oConn.Close();
}
catch (Exception ex)
{
MessageBox.Show("Błąd podczas wczytywania tabeli - " + nazwaTabeli + "\n" + ex.Message.ToString(), "Komunikat");
}
}
|
|
|
|
|
What do you mean by "proper encoding"? Are you getting any errors?
|
|
|
|
|
Thanks for reply. The issue I got is that signs are not printed properly. I assume DBF encoding is in Latin2 (852) and stream converts data into Windows native one. I saw many similar problems where it was stated to read it via bytes[] and then convert to what I need. But as I am not C# proffesional and I am a hobbyst developer I got issue to adjust the code from solutions to my example. Hence I am looking for someone that will help me to write working example within my code of this:
[^]
Can you please help me to catch the data before it will be written into DataTable, encode it with 852 and then write as UTF-8?
|
|
|
|
|
Check out the first three answers here[^].
|
|
|
|
|
I would use some version of SQL Server (Management Studio) to import the DBF, or even into Excel and then export as CSV, etc. Then you can use "native" tools and API's.
That's if you want to skip having to deal with the DBF's directly.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
you will need an event target (e.g. a button), az event list, and events. To solve this problem, create the required data structures for event management, and test every required functionality. For optimal testability, every registered anonymous function must write different text on the console.
Base structure:
Event class, which stores the event function registered by the user (anonymous function). It gives two arguments to the listener function: the event's target (need to use base class, see later), and itself. It stores a public bool member, which if set true, the event chain stops, and further events are not run. This member has a default value of false and can be set from the listener function.
Event list class, which stores events. It can add and remove events. When adding new events, a bool argument defines if the event goes to the beginning or the end of the list. It can run every list in it sequentially with a method, and in the method, it uses a custom iterator for iteration.
Event target class. It has an event list, which gets the event target. It has a method for registering new events.
Button class. Inherits from the event target class. Has a click method, which runs the registered events.
Test cases:
1. Register an event to a new button. See if the button object is available from the event listener function.
2. Register two events to a new button in a way that the events are appended to the end of the list. Register a third event to the beginning of the list. See if they are in correct order.
3. Register three events to a new button. In the second event listener function stop the event chain. Make sure that the third listener function does not run.
|
|
|
|
|
Is there a reason you are posting your homework on the web?
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Because i want to know how it works. For me it is difficult.
|
|
|
|
|
Life is difficult. The challenge is to use your skills, and learn new ones, to overcome its challenges. Start by reading through the assignment a few times. Make some notes about what specific items need to be addressed, as mentioned in the section headed "Base structure:".
|
|
|
|
|
if i could do it, i would have done it sir.
|
|
|
|
|
Yes, but just dumping your assignment here and saying, "please do my work for me", will not help you move forward. If you do not understand the question, or where to start, then you need to discuss the problem with your teacher. Maybe you missed some lessons, or need some extra teaching.
|
|
|
|
|
please solve it for now for me next time i`m gonna do it by my self
|
|
|
|
|
No, I am sorry, but no one here is going to do your work for you.
|
|
|
|
|
No, you won't - because the next exercise is going to harder: it assumes that you can do the "easier" task you have here. If you can't do this, you have no chance whatsoever of doing the next one - and when you get to the exams, you will have no-one to write it for you and will fail the course.
That's why you are given homework, that's why it's important to do it: it teaches you skills (which you only ever develop by using them) which you are going to need.
So pull your finger out, stop trying to get others to do your homework for you, and try it yourself. We can't do it for you as it's:
1) Not fair on you as you don't develop the skills you need.
2) Not fair on your classmates who do put in the effort.
3) Not fair on your teacher who is trying to help you improve.
4) Not fair on us: we do the work, you get the credit.
Your inability to do this exercise - or even try it yourself - strongly suggests that you haven't done your earlier homework yourself either. In which case you need to rethink your priorities: when you get out of school there will be no "cheat safety net" to help you in the real world. And there, you don't get a "fail" on your grades, you get to eat or you starve. Think about it for a bit, why don't you?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Maybe you should consider taking a job where you run the machine that puts ridges on the sides of checkers.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You need to create a foormglogle project with craplestobs, wire up the fodgetra to the kladrop and trap the bandersnatcth as it passes through the quantum girdle. Once you have the bandersnatch in the wompon you need to beat it with the fraglerot till it tells you where it came from. After that is it a simple excercise of doing you schoolwork like everyone else.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
It seems to me that if your instructor assigned you homework, then he must have covered the necessary info in class. It might just be me, but maybe you should have taken better notes during the lecture(s).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Think "delegates". "Events" are "similar", though represent an "older" thought pattern.
c# - How to store delegates in a List - Stack Overflow
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
good evening
I have a little problem with the rdlc (report) in my application. When I start printing a receipt with my thermal printer I have cut text!
I wanted to know is there a way to set the margins so that it is printed on roll paper?
If possible help me with a solution.
thank you in advance for your help
|
|
|
|
|
Member 14192216 wrote: If possible help me with a solution. You need to define a 'page' size that is large enough to hold all the data. See rdlc set margins - Google Search[^].
|
|
|
|