|
thank you for the answer, then I opened a new instance and connected the webservice to the remote debugger, then I started a second instance of the windows application, when I get to the point where I call the webservice and I press f11 to enter the webservice method, it tells me to connect the process, I do it but then it tells me that a debug has already started.
|
|
|
|
|
I am trying to figure out how to handle the situation where a decimal is inserted into a text box as the only character.
If I clear the textbox and begin inserting a value without starting with a 0, (Say I want 0.0086, but start to type .0086) I get the error:
System.FormatException: 'Input string was not in a correct format.'
as soon as the decimal is typed. I used something like:
if (tbAI0LineSlope.Text.Length == 0 & tbAI0Offset.Text.Length == 0)
to handle empty box, but not sure how to deal with the decimal issue.
float test1 = 1;
float test2 = 0;
if (tbAI0LineSlope.Text.Length == 0 & tbAI0Offset.Text.Length == 0)
{
tbAI0Val.Text = (iData[7] * test1 + test2).ToString();
}
else if (tbAI0Offset.Text.Length == 0)
{
tbAI0Val.Text = (iData[7] * float.Parse(tbAI0LineSlope.Text) + test2).ToString();
}
else if (tbAI0LineSlope.Text.Length == 0)
{
tbAI0Val.Text = (iData[7] * test1 + int.Parse(tbAI0Offset.Text)).ToString();
}
else
{
tbAI0Val.Text = (iData[7] * float.Parse(tbAI0LineSlope.Text) +
int.Parse(tbAI0Offset.Text)).ToString();
}
|
|
|
|
|
Simple: & is not a logical operator, it's a binary operator.
As such it has a different operator precedence and it's trying to do a binary AND between an i nteger and a string...
Change
if (tbAI0LineSlope.Text.Length == 0 & tbAI0Offset.Text.Length == 0) to a logical AND:
if (tbAI0LineSlope.Text.Length == 0 && tbAI0Offset.Text.Length == 0) And see what happens.
"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!
|
|
|
|
|
You could simplify that code and make it easier to debug:
float test1 = 1;
int test2 = 0;
if (tbAI0LineSlope.Text.Length > 0)
{
if (!Float.TryParse(tbAI0LineSlope.Text, out test1))
{
}
}
if (tbAI0Offset.Text.Length > 0)
{
if (!Int.TryParse(tbAI0Offset.Text, out test2))
{
}
}
float test3 = iData[7] * test1 + test2;
tbAI0Val.Text = test3.ToString();
|
|
|
|
|
Sorry, new to the format, but Richard's solution worked perfectly for me. I did try to use && at first, but I still got the exception at the same line when I tried to run. I don't see the way to mark Richard's suggestion as the solution.
Thank you!!
|
|
|
|
|
Member 14872128 wrote: don't see the way to mark Richard's suggestion as the solution. You cannot do so in these forums. But don't worry about it, your comments are enough. Good luck with the rest of your programming.
|
|
|
|
|
Hi,
Good day, I need some assistane to generate auto testcases generation in .Net.
For example let's talk about simple employee screen that allows admin to add/delete/read/update
the employee details. Here add/delete/update/read all four methods.
Now my requirement is to develop some utility that will automatically generate test cases for the above four methods.
Also utility can easily plug-in to any other projects.
Please share URL's or any details on the creation of auto test cases.
Note :- Testcases should generate automatically something IntelliTest
Thanks All
|
|
|
|
|
Hi
You've stated a few requirements though without enough information to help with anything concrete. Any answers given on the basis of this are likely to be equally vague to the point I doubt anyone will actually answer as it won't be helpful.
If you want help I suggest you take a look at the How to get an answer to your question sticky at the top of the forum. It's generally good advice, mostly the point about being specific. Closely related to this is adding what you have tried - it provides a starting point to discuss what you are having problems with at the very least.
|
|
|
|
|
Wow, you wrote that like we are biding on your job, or we are a member of your programming staff.
So lets talk about this simple CRUD module ...
Simply write code to perform your unit testing of your CRUD operations!
Or write code to simulate multiple scenarios like real time use of the application.
Automatically generate test scenarios?
I think it would be faster to just write code, than to setup an automated test.
I can't see how an automated test would produce a test of durability, reliability and speed for a CRUD operation.
CRUD is so simple in design, and requires very few lines of code if planned correctly.
Unit Testing Tutorial: 6 Best Practices to Get Up To Speed
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Any test that has been automatically generated has no value at all.
|
|
|
|
|
A master plan for your commercial project, in other words. People pay for that information.
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
|
|
|
|
|
Hi All,
For one of the projects, we need to have the functionality to manage different versions of the documents. I am just wondering if there is an application with which we can integrate instead of re-inventing the wheel. Git like system would be ideal.
Thanks
|
|
|
|
|
Have you considered Git?
Adding a server isn't difficult: set up a git server - Google Search[^] or just create a GitHub / BitBucket / other repository and use that.
"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!
|
|
|
|
|
OriginalGriff wrote: Have you considered Git?
It's certainly "git-like" which ticks the only box in his requirements.
".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
|
|
|
|
|
OriginalGriff wrote: Have you considered Git?
Can git be integrated easily and will it work with all the file formats? For instance, the user will log in to our system, upload document, and then we can integrate with git to manage and keep track of all the versions of the document uploaded. User can anytime retrieve the old versions. This is a typical scenario we would like to achieve. How is Git performance-wise if the file uploaded is relatively big 500MB+?
Thank you.
|
|
|
|
|
cp-andy wrote: Can git be integrated easily
Apparently so: Operate Git with .NET Core - Edi Wang[^] (works with Framework and Core, but I haven't tried it myself)
cp-andy wrote: will it work with all the file formats?
Git is primarily text based, but it can track binary formats as well - just not with the fine resolution it uses for text changes. I'd suspect most "git-like" systems do much the same, as it'd be a PITA to track inserts and deletes in binary files (it's bad enough with text files!)
cp-andy wrote: How is Git performance-wise if the file uploaded is relatively big 500MB+?
No idea - I've never tried! They do mention a size limit, but I don't know what it is: Working with large files - GitHub Docs[^]. TBH, unless you are hosting your own service, I'd suspect there will be a file size limit with any system - storage is cheap these days, but that doesn't mean they will just give it away!
"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!
|
|
|
|
|
Amazon WorkDocs. It has a simple to use API.
|
|
|
|
|
SharePoint, Team Collaboration Software Tools
If I recall, unlimited "free visitors" and about $5 per month for a "user". PDF's, Doc's, Excel, etc. Versioning, approving. Web sites. Custom tables and views. REST. Can't remember anything that was missing.
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 want to Pad two fields like this, one is Id integer and other one is Number string, for example if Ids are as follows: 1189, 758, 756, I want to generate numbers as: T01189, T00758, T00756. Can somebody please suggest me how can I do it in C#? Thanks in advance.
|
|
|
|
|
string result = Number + Id.ToString("D5");
"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!
|
|
|
|
|
|
You're welcome!
"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!
|
|
|
|
|
string x = string.Format("T{0}", number.ToString("00000"));
".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
|
|
|
|
|
Even simpler:
string x = string.Format("T{0:D5}", number); Or:
string x = $"T{number:D5}";
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
isn't the "$" notation for PHP or some other stupid language? Or is it a new pointless operator in C#?
".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
|
|
|
|