|
By the way, I have one question.
I want to get data in tag when I ctrl+mouse click on webbrowser, for example
<div>abc...</div>. Then when I press ctrl+mouse click on webbrowser I will get abc...,
so how can I do that?
thanks!
|
|
|
|
|
Hi CodeProject, I'm looking for a C# class to create a GS-1 Databar, but that only ones I have found so far cost $300-1000! I am looking for an open source class which creates one, or a dll which doesn't cost $ and isn't just a limited time trial, since I'm broke.
I have no idea why it's so hard to find one of these, I'll even settle for a tutorial on how to code one myself but not even that I can find.
Please help and don't flame I've tried very hard to find one myself but couldn't.
|
|
|
|
|
No idea - but perhaps this article[^], along with the GS1 spec, will enable you to code one yourself?
|
|
|
|
|
thanks but they're are completely different. I coded my own UPC generator, but it is nothing compared to databars. I'll keep on the look out for learning how to code one myself but it doesn't look promising so far
|
|
|
|
|
I want to know how to open a .sln file from a c#.net application and to use it to count the lines of codes in the given program.
input - .sln file
out put - line count of the given file
|
|
|
|
|
.sln files are text (XML) files controlling solutions, they do not contain lines of code. However they do point to project files, which, in turn, point to source files which do contain code. Use a simple text file editor to look at the content of these files in order to figure out what you need to do.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Project files are XML, Solution files are not.
|
|
|
|
|
Quite right, I should have re-checked first. However, since they are still text files it's not too difficult to write a parser for them.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
|
If you have a VS 2010 then you can generate code metrics under an "Analyse" menu.
If not, you can download a free MS cmd line tool with exact the same functionality (Visual Studio Code Metrics PowerTool 10.0[^])
Greetings - Jacek
|
|
|
|
|
I want to retrieve the name of the database from a text box (datasource = txtdatabase.text), but the connection does not work.
the connection is made with the direct assignment of name database directly
cnx = new OleDbConnection ("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D: \ \ mabase.mdb");
class Connexion
{
static public OleDbConnection cnx;
static bool ok;
static public Boolean getConnexion()
{
if (cnx == null)
{
cnx = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+datasource);
try
{
cnx.Open();
ok = true;
}
catch (OleDbException)
{
ok = false;
}
}
return ok;
}
}
|
|
|
|
|
MemberDotNetting wrote: the connection does not work.
And you know that it does not work because....?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
|
He means "How do you know it doesn't work? Do you get an exception? If so, what is the message?"
Your original question is vague, and not answerable. You need to provide better information.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
No where did you say what errors you was getting or any exceptions. "It does not work" is not at all helpful in any way in describing your problem. How do you know it doesn't work? Did you get an error? Did you get an exception? Did your harddrive melt? We can't see your database or read your mind.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
catch (OleDbException)
{
ok = false;
}
What is the point of catching an exception if you then throw it away?
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
In fact I have another idea that will start with this idea, in fact I have a WPF application, following the click on the button I want to select the name of the database via an open file dialog and display the name source in textebox, the method returns a message box to display the exception, but I used the bool type because my class is linked to a library and I can't use the message box
|
|
|
|
|
So have you heard of Debug.WriteLine() ?? Wihtout the exception messages, it's pretty much impossible to tell you what's wrong with any accuracy.
|
|
|
|
|
if you are under win7 x64 make sure target solution's plateform is x86
|
|
|
|
|
Hi! I am renewing a program I made in a university-class in Java.
The program is a library system where you can save books as objects, customer as objects and then make a loan.
In the old program we saved to disc in a binary-file.
How would you do it in C#?
I also been thinking about LINQ (which I don´t know very much about), is that and alternative?
I final question is if It is a good design or if it would have been better to man a traditional relationship database with no objects.
|
|
|
|
|
larsp777 wrote: In the old program we saved to disc in a binary-file. How would you
do it in C#?
The direct "translation" is .net serialization[^]. You don't need to use the binary formatter described, there is an XML one too (and a SOAP one, but the isn't useful in this context) or you could write your own. Note that it (the binary one) almost certainly won't deserialize the Java files properly.
Personally, I wouldn't store anything "complicted" (say with relations or mutliple rows) this way unless I had really good reasons to. You mention LINQ, "LINQ to SQL" and "Entity Framework" are good ways of persisting data and are similar to eachother. You should Google these. A third (non-Microsofty) option is NHibernate, it has similarities to the Entity Framework, but comes with the added advantage, from your point of view, that there is a Java Equivalent ("Hibernate") so by learning one, you learn the Java version (mod any documented differences).
larsp777 wrote: I final question is if It is a good design or if it would have been better to
man a traditional relationship database with no objects.
If I understand you correctly, I'd always go for proper relational design, but that doesn't mean you lose good OO at all. The Entity Framework pretty much expects proper relational design (if you design the DB first, it creates well normalised Schema from an OO model if you start with the model first). NHibernate works better under a properly normalised DB too, but is more forgiving of mismatches between the OO and the DB. That said the same things that drive good OO desgin tend to drive DB schemas: A type is pretty much a table, a property to a simple type pretty much a field and a property to a custom class a relationship to another table. Many-to-One maps to a list property at one end and a single property at the other, Many-to-many has maps to lists at both ends.
My advice is to try Entity Framework, starting with the model. Some people have reported performance problems on large data sets, but you can pre-compile LINQ queries and even go the whole hog and use Stored Procs so the perforance is comparable with a little work and you gain more than you lose IMO.
modified 22-Apr-12 6:59am.
|
|
|
|
|
Thanks!
The course we took in university was alot about OOP. So that was probably the reason we did it this way, to learn OOP.
|
|
|
|
|
larsp777 wrote: I final question is if It is a good design or if it would have been better to
man a traditional relationship database with no objects.
Depends what you really mean.
If you really want to store a binary image of a book into a database then you have two choices
1. Store it as a blob
2. Store it as a file with a link reference in the database.
However if you want to store information about a book, then you should be using a relational database.
|
|
|
|
|
Hi.
Yesterday I started a new project. It's about a bitmap checker which check if the bitmap it's modificated in photo editor or not. The funny problem is that my application doesn't recognize if a bitmap file is modificated in Paint, but it's recognize if a bitmap file is modificated in Gimp/Photoshop and other .
Is a possible way do recognize a bitmap file modificated in Paint? How I can do that? Can you give me a clue?
I want to specify that I check with the ExifInformation but it doesn't give me the information about de *.bmp files.
I tried with the length of image, but it doens't work because it have the same length with the original bitmap file.
I am sorry for my bad english.
Thank you in advance.
|
|
|
|
|
Create a hash of the contents of your original file and save this information. Then when you want to check it, hash the file again and compare the hashes.
|
|
|
|