|
It depends on the device and the type of receipt. I have a bunch of receipts from credit cards and other purchases over the last month and there are at least 4 different paper widths, and 5 or 6 fonts.
Use the best guess
|
|
|
|
|
That is not depends on the number of characters, that is depends on the Papersize(width).
--RA
|
|
|
|
|
Hallo
I'm consuming a webservice returning an XML with 5 nested complexType (i.e. 5 relationed tables); I should write those data into corresponding tables in a mssql db, updating or inserting when needed.
Do DataAdapters provide such functionality?
Actually, the Update method synchronizes a dataset and its original data source. What if the dataset comes from a different datasource?
Update uses the RowState property to determine the kind of SQL command to be issued: in my case I should need something like an hash comparison (checksum) between each row in the source dataset and each row in the target db, for each table.
I'm considering to transfer to the db the whole process of hashing and comparing.
Could you give me your advice?
Thanks in advance
|
|
|
|
|
|
Your question isn't clear.
For starters the XML and web services part would seem to have little to do with it.
If you have a set of data, regardless of source, which must put into the database as one go then the normal solution is a transaction.
If there are multiple target data sources then a distributed transaction MIGHT be a choice however at least some people prefer to use a non-transactional approach in that case.
|
|
|
|
|
Schematically, I'm dealing with two datasets with the same schema: they have 5 tables.
I need to synchronize the two dataset, being Dataset A the source (XML from webservice) and Dataset B the destination (the database).
|
|
|
|
|
LordZoster wrote: I need to synchronize the two dataset, being Dataset A the source (XML from webservice) and Dataset B the destination (the database)
Yes I understand that you are starting with XML.
However that has nothing to do with writing the data in a consistent manner to he database.
If you need to read the XML data in a consistent manner than that is still a different problem UNLESS you need to provide some transaction across both sets. If so then, because the first appears to be a file, you are still going to be dealing with a transaction on the database side and for the file side there are mitigations possible but none are ideal.
|
|
|
|
|
Hello Team,
I have a jar file which has some classes.I want to access those class files from .net environment.I mean i want to pass some parameters from .net environment to class files and process the parameters in class files and send response back to .net environment.
please help me
|
|
|
|
|
|
1. Write a jave app that uses the classes and models the functionality you need.
2. Write a communications API on that using either stdio, files or sockets.
3. Use Process (or whatever it is called in .Net) to run and manage the java exe
4. Use the communications API, from 2, in your net code to talk to the executable.
Advantage to this over in process functionality is that it is easier to debug.
|
|
|
|
|
There's a very handy library, called IKVM[^], that you should really look into. It makes working with Java and .NET an absolute cinch.
|
|
|
|
|
I am new in developing apps(C#.net),my problem is I want to print a panel using enter key and cancel using escape key when mouse pointer is inside the panel area
|
|
|
|
|
Add a key event handler to your panel, which will call the appropriate method according to which key is pressed. See the tutorials here[^] on Delegates and Events.
Use the best guess
|
|
|
|
|
hey all, Sorry its me again. This time I have a question that I think is fairly general. I am using code that is almost exactly the same over and over again within a controller.
My question was, is there a way to store this code somewhere within the project? to repeat it in the place that i need in code
in c# windows application??
e.g:
like include PHP
all that i need is to repeat specific code in my function but in different locations
any ideas???
|
|
|
|
|
Such common methods can be added to "helper" classes that you can reuse across the application.
You can think about making this class a singleton.
|
|
|
|
|
thanks for your reply
but do u have tutorial to make it coz i am a beginner in c#
|
|
|
|
|
A common way to do this is to create a class library that you use to hold common methods. Suppose, for instance, that you have a piece of code to check whether or not an integer is between two values, and you use this in many projects, you could add the code to a static class like this:
public namespace RangeExtensions
{
public static class Range
{
public static bool IsInRange(this int value, int startRange, int endRange)
{
return value >= startRange && value <= endRange;
}
}
} This is known as an extension method, and as long as you add the DLL that contains this code and add the namespace declaration as a using statement to any class that uses it, you can do things like this:
private void GetValueAndValidateIt()
{
int value = GetValueFromSomewhere();
if (value.IsInRange(0, 10))
Console.WriteLine("The value is between 0 and 10");
else
Console.WriteLine("Drat it you fool, you just blew up the planet");
} Now, if you drop the this statement from the Extension method, you would call it like this:
private void GetValueAndValidateIt()
{
int value = GetValueFromSomewhere();
if (Range.IsInRange(value, 0, 10))
Console.WriteLine("The value is between 0 and 10");
else
Console.WriteLine("Drat it you fool, you just blew up the planet");
} So, what's the difference? Well, the this keyword at the start of a method declaration parameter list indicates to the compiler that this is an extension method; that is, a method that allows you to extend the functionality of an existing type.
|
|
|
|
|
If the code is repeated in the same controller you should extract out to a single method. From your description it sounds like you have the same block of code in several controllers, in which case you extract out the method into a common base controller and inherit from it. e.g.
public abstract class MyBaseController
{
protected void CommonCodeMethod()
{
}
}
public class MyController1 : MyBaseController
{
public void Foo()
{
CommonCodeMethod()
}
}
public class MyController2 : MyBaseController
{
public void Foo()
{
CommonCodeMethod()
}
}
You should put the base in it's own file (as your controllers probably are). You might not need the abstract on the class, and you might want to make CommonMethod public or internal .
If the function is used outside of controllers, then the base class isn't suitable: create a separate class that contains the common method, try to give the class used a descriptive name (for example, if the common methods all create ViewModel called FooViewModel , consider FooViewModelCreator as the class name and Create as the methodname). If you have several such methods, try to keep ones that fit naturally together in the same class, so the class is only really responsible for one category of thing and you have [potentially] several classes.
[Edit]
Countered Univotes. Note sure why your question was downvoted, seemed to me to be a sensible newbie question - perhaps the downvoter could elucidate.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
modified 18-Jun-13 8:44am.
|
|
|
|
|
Just added my 5 to his vote.
|
|
|
|
|
I am trying to reference 2 identical assemblies with only their filename and version to be different. I need this in order to support several versions for backward compatibility.
I've created an alias name for one of them and the other stayed "global". Also added the "extern alias" declaration at the start of the source code.
I'm getting compiler error (my real module name was switched with [module name] here):
"An assembly with the same simple name '[module name], Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side."
One of these two assemblies does have a version 1.0.0.0, but the other has 1.5.0.0 and I can see that when I highlight them in the solution explorer in the properties window.
The assemblies are not signed, and I do not currently wish to make them as such. Why is this error? The versions are clearly different… is there a way to solve this?
i'm using VS2012.
|
|
|
|
|
Using different AppDomains would solve it.
|
|
|
|
|
It won't solve it since i need to load both assemblies in the same domain.
|
|
|
|
|
Try this[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
i already found this before, but it does not offer a working solution:
i cannot change the assembly info since it is a compiled module and as i said - the assemblies are not signed, but they have a different version.
Any other way to make it work?
|
|
|
|
|
impeham wrote: Any other way to make it work? Remove the reference and load the assembly dynamic.
If you want to use the simple names, you'd have to abide by it's rules.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|