|
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[^].
|
|
|
|
|
I'm working on a WPF app that hits SQL on a network. Next year I will be adding in a tablet app which will include adding in a WebAPI and hosting the BL & DAL on a server, probably in IIS.
In each table I have the following columns
CreatedById INT NOT NULL FOREIGN KEY REFERENCES Users(UserId),
CreatedDT DATETIME NOT NULL,
LastModifiedById INT NULL FOREIGN KEY REFERENCES Users(UserId),
LastModifiedDT DATETIME NULL,
DeletedById INT NULL FOREIGN KEY REFERENCES Users(UserId),
DeletedDT DATETIME NULL
The question is this.... How would I pass the PK of the logged in user to the back end? Right now, with the WPF app, once the user logs in, I know their PK but I don't do anything with it.
My app has VM's which call the BL, which calls the DAL. Would you pass the User's PK to each method??
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
While that is common to do, it would be more appropriate to have that in a separate table and link to it from the tables that require the fields.
Kevin Marois wrote: How would I pass the PK of the logged in user to the back end? From where? A sproc, inline SQL? The UI should know the username, so fetching the key and getting/using the pk in the backend should be straightforward.
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.
|
|
|
|
|
Yes, but pass what from the UI? Being stateless t seems like I'd have to pass that along with every call
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
You DAL should have a "common point" for adding user ids, etc. to anything it passes along. The foreign key references are an unnecessary overhead for basic "audit" data that never changes.
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
|
|
|
|
|
Based on your response, as well as Eddy's, I'm going to assume that my question wasn't clear. So let me clarify.
I need to write out the ID of the logged in user to records that are added, marked as deleted, or modified. There are probably over 50 methods in the DAL. The Create and Update methods take an entity, and the Delete methods take an int Id of the record to mark as deleted.
So, in the UI, the user clicks Add, fills out the data, then clicks Save. or makes changes to an existing record:...
Company ViewModel
public void SaveChanges()
{
if (Company.Id == 0)
{
Company.CreatedById = CurrentUser.Id;
Company.Id = AppCore.BizObject.AddCompanyAsync(Company);
}
else
{
Company.LastModifiedById = CurrentUser.Id;
AppCore.BizObject.UpdateCompanyAsync(Company);
}
}
Again, the question is, how or where does the ID of the user get assigned to EVERY entity being passed to the back end?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Lots of options.
The constructors of the entities could set the information; calling a "shared" user "lookup".
Maybe user ids and actions should be logged; with only a reference to the entity id and a timestamp column value.
You could "crawl" the entities waiting to be committed and apply your "auditing" then.
Maybe you're tracking too many entities and only need to consider the parent / root of an object graph.
A combination of audit techniques that work well with the least fuss. Can you determine if someone is fudging with the data? Then your controls are adequate.
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
|
|
|
|
|
I have tried unit testing before, but I have only worked with very simple strings where I inserted some values. I wanted to try something different, so I found this template which is made for practising. It has a class containing an empty linked list.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace UnitListX
{
public class ListXwithErrors
{
private Node list;
private int size;
public static object Add;
public static int Size;
public ListXwithErrors()
{
list = null;
size = 0;
}
}
}
I have not gotten very far with the test code.
I would appreciate if anyone could provide me with an example of how to make a unit test of this kind of code.
My test code.
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UnitListX;
namespace UnitTestProject1
{
[TestClass]
public class ListTestClass
{
[TestMethod]
public void TestList()
{
ListXwithErrors node = new ListXwithErrors();
}
}
}
modified 13-Dec-19 14:40pm.
|
|
|
|
|
Okay, so I tried this.
I am not sure if this is the correct way to write it.
ListXwithErrors node = new ListXwithErrors();
node = null;
Assert.IsNull(node);
|
|
|
|
|
You're not getting far because your don't have a "list"; you have something you called a list.
And an "empty" list is "not null"; it is just "empty".
List<string> list = new List<string>();
bool isEmpty = (list.Count == 0);
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
|
|
|
|
|
I have tried this method, but when writing
List<string> list = new List<string>(); I do not get the option to refer to the class in my other cs file.
Remember, I have two files here: Program.cs and UnitTest1.cs.
This is why this one is so confusing to me.
For example, if I had a ordinary class with normal strings such as:
public class Car
{
private string model;
private string colour;
public Car(string model, string colour)
{
this.model = model;
this.colour = colour;
}
I would just write this in my test:
[TestClass]
public class CarTestClass
{
[TestMethod]
public void TestCar()
{
Car mycar = new Car("Renault", "flame red");
Car myothercar = new Car("Volvo");
string mymodel = mycar.Model;
string mycolour = mycar.Colour;
string myothermodel = myothercar.Model;
string myothercolour = myothercar.Colour;
Assert.AreEqual("Renault", mymodel);
Assert.AreEqual("flame red", mycolour);
Assert.AreEqual("Volvo", myothermodel);
Assert.IsNull(myothercolour);
}
This is the method I am used to, which is why this list is confusing me.
|
|
|
|
|
So far so good, but I am basically coding in blindness at this point.
I got the first test to run.
[TestMethod]
public void Index()
{
List<string> list = new List<string>();
bool isEmpty = (list.Count == 0);
Assert.AreEqual(0, list.Count());
}
The next part of the code that I am going to test is this:
public int Length()
{
return size;
}
Using knowledge from the last test, I am... guessing this how I am supposed to test this part, but I am not sure what to write in Assert.
public void NumberOfObjects()
{
List<int> lenght = new List<int>();
lenght.Count();
}
I have googled and searched on places like Youtube, but I have yet to find a tutorial that talks about conducting unit testing on linked lists.
If you know of any website or tutorial that explains it, then I would be very happy.
|
|
|
|
|
How to code in C# to crate a printdocumentto preview like a filling form with boxes.
Bimal
|
|
|
|
|
You don't: a PrintDocument is not an interactive control, it provides no mechanism for user input.
You could conceivably add code to open a new form to fill in in the PrintDocument, but that really isn't what it's for (and the same code is called for the actual print do it's gonna get messy if you want anything to work properly).
Instead, create a form for the user to input his data, validate it, and store that - then pass it through to the PrintDocument for format for output.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I am using Mysql.data.dll in c# project.
Now I called c++ dll function. But after calling c++ dll function, my sql connection fails.
Error code is
Project.exe Error: 0 : Unable to connect to any of the specified MySQL hosts.
Exception thrown: 'MySql.Data.MySqlClient.MySqlException' in MySql.Data.dll
Help me. How can i solve this issue?
|
|
|
|
|
That's not a "memory crash" or even close - it almost certainly means that your connections string is wrong, in some way.
Use the debugger, and look at exactly what your code is doing - we don't even have access to your code much less when it's running, so there is nothing at all we can do to help.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks for you answer.
But until before call the c++ dll function, the gridview shows data of mysql db.
But if i click button, it calls c++ dll function and mysql connection error(Unable to connect to any of the specified mysql hosts) occurs. So datagrid not show data of database.
|
|
|
|