Click here to Skip to main content
12,999,744 members (42,096 online)

Comments by OriginalGriff (Top 200 by date)

OriginalGriff 10hrs 20mins ago View
   
Oh come on!
A path is just a string, you know that. So just replace "myString" with the path to your file...
OriginalGriff 10hrs 20mins ago View
   
So that it can't even be seen by the outside world, much less used or derived from.
OriginalGriff 11hrs ago View
   
But the way I would do it is to store the path to the file in the config file, rather than the file content.
OriginalGriff 11hrs ago View
   
myString = '8000 chars here
Properties.Settings.Default.MyStringSetting = myString
Properties.Settings.Default.Save()
OriginalGriff 12hrs ago View
   
That's because the code is trivial:
Dim myString as String = Properties.Settings.Default.MyStringSetting
...
Properties.Settings.Default.MyStringSetting = myNewStringValue
Properties.Settings.Default.Save()

The data is stored in an XML file so it's simple to edit outside the app if you need to.
OriginalGriff 13hrs ago View
   
Yes - the link does say that.
OriginalGriff yesterday View
   
No - I don't have Dev++.
Ignore YouTube videos - they are mostly made by idiots who have no idea what they are talking about.
The basics are covered in the first Google text hit:

http://eilat.sci.brooklyn.cuny.edu/cis1_5/HowToDebug.htm

Which should tell you want to do.
If that doesn't help, you need to tell us what "system code" is, and how it "doesn't work" - we can't see your screen!
OriginalGriff yesterday View
   
Yes - google for "Dev C++ debugger" and you will get loads of useful info.

You're welcome!
OriginalGriff yesterday View
   
What error? Any message?
OriginalGriff 2 days ago View
   
You're welcome!
OriginalGriff 2 days ago View
   
So show us what you tried, and what it generated.
Explain where it's wrong!
OriginalGriff 2 days ago View
   
"What have you tried" means just that: what have you done so far to implement this, not "what I want" - you explained that in the main question.

So what have you tried?
Where are you stuck?
What help do you need?
OriginalGriff 2 days ago View
   
Yes. You can pass anything to anywhere by passing it as a parameter.
OriginalGriff 3 days ago View
   
You're welcome!
OriginalGriff 3 days ago View
   
Sorry, but it isn't a solution for you - it was an answer to a lazy person several years ago who couldn't be bothered to use Google to start with. Unfortunately for you, his description triggered a lot of matches with your search!

Google has a lot of info on this, as do the articles on this site: it's all been done millions of times already!
OriginalGriff 4 days ago View
   
You're welcome!
OriginalGriff 18-Jun-17 17:40pm View
   
You're welcome!
OriginalGriff 18-Jun-17 14:35pm View
   
You know how to create a class, and how to create Properties, don't you?
And you almost certainly have used this before:

https://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx

So put the three things together...
OriginalGriff 18-Jun-17 9:55am View
   
You're welcome!
(Welcome to the site, BTW - have fun!)
OriginalGriff 18-Jun-17 2:30am View
   
OK: you've suffered enough! :laugh:

Dim files As String() = Directory.GetFiles("D:\Test Data", "*.ttf")
For Each file As String In files
Dim fontCol As New PrivateFontCollection()
fontCol.AddFontFile(file)
Dim ff As FontFamily = fontCol.Families(0)
Console.WriteLine(ff.Name)
Next
OriginalGriff 17-Jun-17 10:05am View
   
That's the plan! :thumbsup:
OriginalGriff 17-Jun-17 9:49am View
   
Oh yes!
And when you spot it, it's a :doh: moment...
OriginalGriff 17-Jun-17 8:22am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind. So your code - stored procedures and all - are and remain hidden from us, so we can;t even begin to comment on what the problem(s) might be.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 17-Jun-17 8:10am View
   
So you know what all the files are called, and you know how to get the font information of a file.
And you know what a For Each loop looks like ...
*hint* *hint* So putting the two together gives you what? :laugh:
OriginalGriff 17-Jun-17 7:25am View
   
So, when you say "works great" you mean "doesn't work at all"? :laugh:
Start by finding the files: You know how to use Directory.GetFiles?
OriginalGriff 17-Jun-17 2:15am View
   
You're welcome!
(I've done the same thing soooo many times myself!)
OriginalGriff 17-Jun-17 2:08am View
   
Because you do say:
"I have created a list box on a form that shows font files that are stored on a network drive. Works great"
So it's difficult to see what help you need! :laugh:
OriginalGriff 17-Jun-17 2:07am View
   
What part of it do you know how to do? Which bit is giving you problems?
OriginalGriff 17-Jun-17 1:58am View
   
Then don't ask questions that you know the answer to, or should be able to work out very easily by reading the links you are given.
If it hadn't been trivial code that was covered in the examples, I wouldn't have responded in such a way. Think about it: I'm not here to do everything for you, you are expected to be able to think (or you wouldn't be in this game) - so wasting our time with things you should know how to do (or at least should if you apply yourself a tiny bit) is a lot ruder than I was to you...
OriginalGriff 16-Jun-17 14:40pm View
   
You are kidding, right?
You can't work this out on your own:

string valueIreadFromTheFile = "True";
or
string valueIreadFromTheFile = "False";
then
bool value = bool.Parse(valueIreadFromTheFile);
OriginalGriff 16-Jun-17 9:35am View
   
It's a bool value: so the string will be either "True" or "False" - and bool has both a Parse and a TryParse method:
https://msdn.microsoft.com/en-us/library/system.boolean.parse(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.boolean.tryparse(v=vs.110).aspx
OriginalGriff 16-Jun-17 7:34am View
   
Now many different websites are hosted on the same computer?
Each website has a separate "files area" where all it's file data is held, HTML, ASPX, C# binaries, user data, the lot. Most systems organise this into a hierarchical structure so you have the website root folder (with the default.aspx file and suchlike) and all the other info is in folders which hang off that. That website root folder is called "~" and is used with Server.MapPath to convert a relative address (i.e. relative to the website root) into a physical address such as "C:\IIS\Websites\YourDomainName\Users\DownLoads\JoeSmith117" from "~\Users\DownLoads\JoeSmith117"
You don't access the harddrive directly except by using Server.MapPath because you have no idea where your site is hosted, or when it might be moved.
OriginalGriff 16-Jun-17 7:16am View
   
And where is the downloads folder in your website in production?
OriginalGriff 16-Jun-17 6:51am View
   
:sigh:

Server.MapPath ... To quote myself again:

'The folder you need will be a part of your website structure, almost certainly, and that means you probably need something like Server.MapPath(@"~\Downloads\TheFileIWantToAccess");'
OriginalGriff 16-Jun-17 6:22am View
   
The user profile is useless in a web site, which user do you think you are? IIS does not use a user id that is of any use to you, and does not have a "regular" folder under "Users".

The folder you need will be a part of your website structure, almost certainly, and that means you probably need something like Server.MapPath(@"~\Downloads\TheFileIWantToAccess");
OriginalGriff 16-Jun-17 5:50am View
   
Have you ever considered reading example code with the view that the author can't see exactly what you need to type and might have to use placeholders.
You know, such as 'path' where you need to put the actual path to the file you need to access for example? And "MyFile" where he doesn't know the name of the file you want to save it as? :sigh:
OriginalGriff 16-Jun-17 5:38am View
   
To quote myself: "you cannot control what happens to it once the download has started as that is totally up to the user and his browser settings"
You cannot control the folder it ends up in, or even that it ends up being saved at all.
OriginalGriff 16-Jun-17 3:57am View
   
Um. You do realize that you show no connection between "Roy" and your Guid value? And without some idea of how they are connected - and particularly how they are permanently stored - we can have no idea how to retrieve them later?
Why not store the name in your cookie as well? Or access your DB using the Guid?
OriginalGriff 16-Jun-17 3:34am View
   
Don't try to type as little as possible: we only get exactly what you type to work with, we can't see your screen, access your HDD, or read your mind!

On it's own, than sentence makes no sense: if the session variable has been created - and it doesn't matter where it was created from - then two things apply.
1) It's in the Session collection, to C# code can access it directly.
2) It's created by Server code, even if that code is executed on Page Load as part of the HTML generation process as in the alert message in the example I gave.
OriginalGriff 16-Jun-17 1:33am View
   
What's the problem? What have you tried to do to save the state?
Can you not use
WriteString(myCheckBox.Checked.ToString());
OriginalGriff 16-Jun-17 1:10am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind. So you need to look at exactly how you are accessing SQL; how you are connecting; when you open, close, and dispose connections; what environment you are working with; and what errors (including any inner errors) you get when the problem happens.

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 15-Jun-17 12:13pm View
   
And that error is saying "I am not an Express edition of SQL, and you can't attach a database to non-express editions".

Which is what I told you to start with!
OriginalGriff 15-Jun-17 10:15am View
   
Do you mean you want

Joe Smith yes $100.40 null
Mike Jones no null $323.89

If so, what is the difficulty?
OriginalGriff 15-Jun-17 9:02am View
   
Repost: deleted.
OriginalGriff 15-Jun-17 8:45am View
   
So use a loop ...
OriginalGriff 15-Jun-17 2:37am View
   
Read what I said:
"The trouble is that you have created two separate instances here: p is one instance, and it's a Person, e is a second separate instance, and its' an Employee. The two instances are not "joined" in any way, so what happens to p does not happen to e."
Employee is an extension to Person, but that doesn't mean that every e shares the same p, any more than every car shares the same glovebox, all connected via a wormhole in space!
My Mercedes is a Car - your Ford is also a Car. You do not have to buy anything extra when you buy a Ford to get a Car as well!

When you create an Employee instance, you are creating a Person instance at the same time, and with the same name - because the Employee *is* a Person!

In your example, you get null because your Employee doesn't "fill in" the Person details when you create it.
OriginalGriff 14-Jun-17 6:24am View
   
Show us samples of exactly what you are looking at: the code that includes the "+a+" and half a dozen lines above and below if possible - we have no context to work from without that, and it could be anything at this point!

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 14-Jun-17 3:31am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 13-Jun-17 15:06pm View
   
The Employee class *extends* the Person class, in the same way that Mercedes extends Car - it's a "superset" which includes everything the base class does, plus added properties, functions and such like.
Because a Car has a glovebox, so does a Mercedes, and a Ford, and a Bugatti, without them specifically having to mention it. Just try it: use the Name property and see what happens.
e.Name = "Member 13257407";
OriginalGriff 13-Jun-17 12:04pm View
   
No, it doesn't propagate beyond the router, and even if you could, it would match millions of others: mine is currently 192.168.0.5 (but it may not be tomorrow) and yours is probably very, very similar!
OriginalGriff 13-Jun-17 7:46am View
   
What does the debugger say is happening when you step through the code?
OriginalGriff 13-Jun-17 7:36am View
   
What are we doing that is different?
OriginalGriff 13-Jun-17 7:18am View
   
I don't. But it's a starting point for him to understand that it does work somewhere... :laugh:

My personal guess is that he has an array of strings, which won't work as a data source (since they only have a Length property) - I could be wrong though.
OriginalGriff 13-Jun-17 6:55am View
   
Trouble is that that is a specific example - they all are. Learning Regex means you know this stuff and it can make your whole life a lot easier as a result because you know what can and can't be done, and how best to do it instead of going with the little you know and trying to force it to work!
OriginalGriff 13-Jun-17 6:26am View
   
All the more reason to read up on them and learn what you are doing!
Just trying to understand specific examples doesn't teach you much at all, if anything.
OriginalGriff 13-Jun-17 4:56am View
   
And what does the debugger show?
Have you put a breakpoint at the top of the method and stepped through to find out exactly what is happening, or are you assuming "There are no errors" in compilation means the debugger will not show anything?
OriginalGriff 13-Jun-17 4:20am View
   
That's probably because you aren't calling the method! What does the debugger show?
OriginalGriff 13-Jun-17 4:06am View
   
A quick test with "x hello" and it matches fine.
I'd change the regex to make it more readable:

\b(hello|there)\b

but either will produce the same results.
What happens when you debug the code? What does it show is happening?
OriginalGriff 13-Jun-17 3:43am View
   
Answer updated.
OriginalGriff 13-Jun-17 1:40am View
   
Without seeing the code, we cant help - struct s are value types, and do not have a null value (that is for reference types only) so what you are describing is not what is happening, unless you have declared it as a nullable type.
Post the relevant code fragments, and show us where the error occurs.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 12-Jun-17 17:42pm View
   
You're welcome!
OriginalGriff 12-Jun-17 6:39am View
   
You're welcome!
OriginalGriff 12-Jun-17 6:17am View
   
Another bruise added...

You told me that already, a couple of messages ago...
OriginalGriff 12-Jun-17 6:08am View
   
I'm getting bruises on my forehead as well! :laugh:
What say we go back to the beginning, and you explain in English what you are doing, without any classes, types, or instances getting involved? An overview as if you were explaining to your mother over the phone?
OriginalGriff 12-Jun-17 6:01am View
   
Answer updated
OriginalGriff 12-Jun-17 5:28am View
   
woah, woah - if CodeElement has gone out of scope then the variable is no longer available - and you can't access the instance it contained unless you have saved it somewhere else.

I think you are missing a lot out here, and that doesn't help us help you any faster.
If CodeElement is a type, then you don't need GetType but you can't use the instance methods of the class (or it's base class) because you don't have an instance for them to work on. You can call it's static classes with no problems, since they don't require an instance.
But to get an instance into "x", you need to either find an existing instance, or create one - you can't do anything particularly useful with just the Type info that GetType returns.

What are you actually trying to achieve? Ignore your specific types when you reply and use English, or all I'll get is another context free code fragment which doesn't help anybody!
OriginalGriff 12-Jun-17 4:39am View
   
This question is five years old! The chances are that the author doesn't need a solution any more.
Please be careful what you answer: posting answers to very old questions can make people assume you are a "rep point farmer" and we count that as abuse - and abusive members get banned. I don't think you intended that with this, so I'll not report you, but there are a lot more trigger happy members here, and if you make a habit of posting solutions to ancient questions, you will get caught, and you will get banned.

So try to stick to recent questions if you can! :laugh:
OriginalGriff 12-Jun-17 3:30am View
   
That should do it!
OriginalGriff 12-Jun-17 2:01am View
   
Sorry?
That doesn't make any sense.
GetType returns a value of type Type - and you already have MyCodeElement before you call it...

I'm not trying to be annoying here, but we only get exactly what you type to work from, we get no other context, and we can't see your screen, access your HDD, or read your mind. So providing one line code fragments with no other context doesn't really help us to help you!
OriginalGriff 10-Jun-17 12:18pm View
   
You're welcome!
OriginalGriff 9-Jun-17 17:35pm View
   
And?
Where are you stuck?
What help do you need?
OriginalGriff 9-Jun-17 10:10am View
   
Then you pick up the relevant instance from the event handler sender parameter and fetch the data from that.
And you either don't need the class level QuestionForm variable, or you make it a collection to which you Add and Remove instances if you need to access them without the event for another reason.
OriginalGriff 8-Jun-17 11:32am View
   
The debugger isn't complicated - or at least not at this level it isn't - all you need to do is use it to step through your code line by line to find out what is happening, looking at the variables and data as you do. This is normally very easy to do - I can't tell you what to do exactly as I have no idea what development system you are using, but if you google the name of your dev system and "debugger" you should get a lot of info: for example "Visual Studio debugger" gives you half a million hits, and the top three will tell you more than you want to know!
Give it a try: it's worth developing this skill on small programs like this instead of trying to start with a 100,000 line behemoth.
OriginalGriff 8-Jun-17 6:04am View
   
You're welcome!
OriginalGriff 7-Jun-17 14:27pm View
   
You're welcome!
OriginalGriff 7-Jun-17 9:54am View
   
Any time you get strings passed in, it has to be assumed to be vulnerable - because if it isn't now, it will be next week! :laugh:
OriginalGriff 7-Jun-17 1:43am View
   
Without seeing the relevant code fragments, we can't even begin to guess how to improve your execution speed or time - that like you trying to improve the flavour of my Rogan Josh over the internet when I can't describe the current taste to you!
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 6-Jun-17 8:50am View
   
You're welcome!
OriginalGriff 6-Jun-17 3:31am View
   
You're welcome!
OriginalGriff 5-Jun-17 16:41pm View
   
Microsoft don't like fixing bugs! No profit in it for them ... :sigh:
OriginalGriff 5-Jun-17 15:40pm View
   
Ah! It's a bug in 2017:
https://developercommunity.visualstudio.com/content/problem/48556/vs-2017-vb-the-intellisense-for-the-datagridview-c.html
Not a lot you can do, except wait for MS to fix it.
But I've been waiting for a bug fix since VS2005, so don't hold your breath...
OriginalGriff 5-Jun-17 14:55pm View
   
Answer updated.
OriginalGriff 5-Jun-17 6:54am View
   
For starters, don't post subjects like "Please help please please please :(" - it tells us nothing about your problem and give us no idea if we know anything about the subject. "ASP.NET" is a very broad subject, and no one person knows all about everything.
In this case I'd use "Crystal reports" tags, and a much more descriptive subject.

But I can't suggest what, because the rest of your question makes no sense in isolation. Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with, we get no other context whatsoever.
And the best I can work out from that is you have installed Crystal Reports (which some will say was your first big mistake) and that something is giving you errors of some form. But I don't know what errors, I don't know when you get them, I don't know what you have in terms of code that generates the errors.

So I can't help you, even if I knew about Crystal Reports - and I doubt if any one else can either.

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 5-Jun-17 5:35am View
   
No, because I can't run it in isolation and under the same circumstances you do!
Start by looking at the PayBillsBrowser variable and breakpoint each and every use. Then run your code and see exactly what is happening to it.
OriginalGriff 5-Jun-17 5:24am View
   
No it isn't!
Go back to the shirt analogy: you have identified that it is the shirt.pocket that contains null when it should contain an instance of the Pen class.

But in isolation that tells you nothing about *why* the Pen is missing. Has it been stolen? Did it ever exist? Is it on your desk? Is it in yesterdays shirt.pocket?

We can't tell, because we don't have access to your code at all - let alone when it's running, which is what's needed here - to look at all the other places you "use your shirt" to find out when it became null, or when it should have been filled with a Pen instance but didn't.
The error isn't necessarily in the line that shows the exception - it's potentially in a different method, class, file, or even assembly!
OriginalGriff 5-Jun-17 5:12am View
   
How can I usefully reply when you haven't done anything to find out why?
You've found out what is null - but I still can't access your code to find out what it is or where it gets used other than in the one line of code you show me!

So start looking at the rest of the code and find out what you are doing with it - I can't do that for you!
OriginalGriff 4-Jun-17 9:57am View
   
"What I have tried:

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"
Well, that's helpful...

I'm just guessing that "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww" caused a compilation error, and you want help top fix it: Simple, remove all the 'w's...

If that isn't your problem then explain what you have tried - because just saying "i can't do it" and dumping a pile of student homework grade code on us doesn't help you at all.
Tell us what you tried, tell us what happened when you did. Tell us where you are stuck, what help you need. We can't help you without that!

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 4-Jun-17 6:16am View
   
Nah - it's site driving spam.
OriginalGriff 4-Jun-17 4:26am View
   
That turns out not to be the case: it's perfectly valid C++.
cin returns true if the input matched the specification (i.e. in this case the user entered an integer) and false if it didn't.
Since the spec for a for loop just says it's a condition, it's fine and valid.
It even works, if you tried it - the code the OP submitted runs and functions without error, as Richard says.
OriginalGriff 3-Jun-17 10:29am View
   
Not so: there is no "one standard size" for cheques, much less for the position of fields within them. Each bank issues their own cheques, and they (generally) collaborate to produce similar cheques within a country - but there is no requirement in law to do so, and even in the UK, consumer cheques are a different size to government issued cheques (and even different departments in the same government use different sizes and field locations as convenient for their systems).
OriginalGriff 3-Jun-17 10:24am View
   
None - My cup was empty. :laugh:
OriginalGriff 3-Jun-17 8:28am View
   
It's a Saturday, and I have my MySql brain on... :O
OriginalGriff 3-Jun-17 8:11am View
   
That's not the fault of that code then- it's something else in your system. Bytes are bytes regardless of the system size, they are fixed a eight bits. Most likely it's a 32 bit DLL you are accessing: you can't "switch" sizes in midd app, that doesn't work.

What error do you get?
OriginalGriff 3-Jun-17 7:29am View
   
You're welcome!
OriginalGriff 3-Jun-17 2:15am View
   
You're welcome!
OriginalGriff 2-Jun-17 10:07am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with, we get no other context.
And I can't make any sense of that at all! What does 'i want to put variable value which is string value between " the value of the variable "' mean? Are you trying to pass values to a function and need help with that? Or what?
Perhaps an example of what you are trying to do would help?

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 2-Jun-17 3:44am View
   
I can't do that for you - I don't have any access to your cheques!
Get out a ruler, start measuring, and create the appropriate Rectangle objects.
OriginalGriff 2-Jun-17 3:20am View
   
You're welcome!
OriginalGriff 2-Jun-17 1:54am View
   
And?
What is it doing that you didn't expect, or not doing that you did?
What help do you need?

This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 1-Jun-17 4:57am View
   
Well, if nothing else, it'll compile! :laugh:
OriginalGriff 31-May-17 14:39pm View
   
Then six years ago, I was still right! :laugh:
OriginalGriff 31-May-17 5:41am View
   
You're welcome!
OriginalGriff 31-May-17 2:23am View
   
No, because it won't help you.
You don't know enough to do the job, and no amount of answers to the basic bits you can parrot back will fix that: you need to study, learn, and above all else practice so that you understand the material. Just solving these doesn't help you pass the next interview because these questions won't come up - totally different questions on the basics will and those will trip you up as well.
Learning from "Interview question" sheets is a waste of your time: they don't - and can't - prepare you for the follow up questions that inevitably follow and that will reveal you to not understand anything about the subject.
Interviewers aren't stupid, and they don't want to employ people who can't do the job: it's an expensive process recruiting someone, and it's not something you want to repeat soon. Learn the subject properly, and you will walk the interview! Keep trying for the "quick cheat route" and you will fail every single one.
OriginalGriff 30-May-17 13:55pm View
   
Via the ID and foreign key values: look at the JOIN and see what it does.
OriginalGriff 30-May-17 9:49am View
   
That doesn't make a lot of sense - perhaps if you add sample input and outputs so we can see what you get, and what you expect it might be clearer?

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 30-May-17 7:32am View
   
And another possibility is to use a second hash as well: XOR is not positional, but is value conscious. If both hashes match that should reduce the number you have to sort.
OriginalGriff 30-May-17 7:29am View
   
So start timing it and finding out where the time is being taken.
OriginalGriff 30-May-17 7:13am View
   
No, that's not going to happen: we aren't here to do your work for you, even if it is your homework - especially if it's your homework.
What part of it doesn't make sense? You have groups of words with the same hash value. You need to check which words in that group are anagrams, but there may be two or more different word sets in there. So you sort them, so the letters in each word are all in the same order, and compare. This tells you how large the biggest sub group is.
OriginalGriff 30-May-17 5:54am View
   
What have you tried?
Where are you stuck?
What help do you need?
OriginalGriff 30-May-17 4:31am View
   
And?
What does it do that you didn't expect, or not do that you did?
What have you tried to find out why?
Where are you stuck?
What help do you need?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 30-May-17 3:30am View
   
So you are cheating a friend, who's trying to cheat a test and get a job he can't do?

Have you thought about how that sounds?
OriginalGriff 30-May-17 3:28am View
   
You're welcome!
OriginalGriff 29-May-17 10:02am View
   
And what - exactly - is in "thumb"?
Let me give you a clue as to where you should start thinking:

Image thisIsTheThumbNailImageYouJustCreatedPrehapsUsingItMightBeAGoodIdea = bmpImage.GetThumbnailImage(80, 80, () => false, IntPtr.Zero);
OriginalGriff 29-May-17 8:25am View
   
Don't "think" what it might be: use the debugger and find out!
OriginalGriff 29-May-17 8:24am View
   
:sigh:
OK - you aren't going to look at your code, or the documents or anything, so I'll spell it out.
GetThumbnailImage takes an image and some size information and *returns a new image* containing the thumbnail. It doesn't change the original image, or any buffers you created from it, it *returns a new image*

Which you ignore completely and it gets discarded...make sense now?
OriginalGriff 29-May-17 8:02am View
   
Activation codes don't "live" independent of the application they activate - you purchase the software (or at least a licence to use an application) and the activation code is sent with it, or in a covering email. One activation code will not cover multiple applications - and very few use a six digit code: Corel activation codes are 32 characters long, and I've seen some using 1024 character codes!
OriginalGriff 29-May-17 7:18am View
   
But your code doesn't.
It doesn't even use it ... or store it ... or save it ... or reference it ...
OriginalGriff 29-May-17 7:10am View
   
You are joking, right?
DirectoryInfo dirInfo = new DirectoryInfo(folder);
OriginalGriff 29-May-17 5:57am View
   
"would" is a "future tense" word here - not what you have done with it so far...
OriginalGriff 29-May-17 5:49am View
   
You're welcome!
OriginalGriff 29-May-17 5:43am View
   
You're welcome!
OriginalGriff 29-May-17 4:49am View
   
Yes, but *which* PC is that?
With a website, you have two: the Server where the code behind runs, and the Client where the browser runs. For development they may be the same PC, but in production they aren't, and can be thousands of miles apart!
Server code is written in C#, VB, PHP etc., Client code is written in Javascript.

Server code can access serial devices connected to the server machine, Client code can't access any serial devices at all regardless of where they are connected.
Server code cannot access client devices!
OriginalGriff 29-May-17 4:13am View
   
I told you how to do that: "just add 26 buttons, ... "
WHich part is difficult for you? I'll try to explain in more detail.
OriginalGriff 29-May-17 3:51am View
   
Um ... yes you do: "it have a textbox but i want to use buttons ..."
Please, try to explain in fuller terms exactly what you want to do - using shorthand doesn't help because I get no context other than exactly what you type!
OriginalGriff 28-May-17 11:51am View
   
YOU'RE WELCOME!
OriginalGriff 28-May-17 11:26am View
   
Repost: deleted.
OriginalGriff 28-May-17 11:25am View
   
Repost: deleted.
OriginalGriff 28-May-17 7:18am View
   
In what way? Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with...
OriginalGriff 28-May-17 2:21am View
   
There are far too many specialist terms to rmember 'em all! :laugh:
OriginalGriff 28-May-17 1:54am View
   
"there is a problem" is not a good description of what it happening - it tells us nothing about what kind of problem you are having.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work from. And we have no idea what that is supposed to do, much less what it does that it shouldn't! We can't even run it to find out as we have no idea how it's supposed to be accessed.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 27-May-17 7:13am View
   
It will permit them, nested commits are ignored but nested rollbacks aren't.
So if you do this:

Start trans 1
... Add A
Start trans 2
... Add B
Rollback 2 - rolls back B
... Add C
Commit 1

Then A & C are committed to the DB.
It makes a lot of sense when you think about it:


Start trans 1
... Add A
Start trans 2
... Add B
Commit 2
... Add C
Rollback 1

If it didn't ignore nested commits, A & C would be rolled back, leaving B as potentially inconsistent data.
OriginalGriff 27-May-17 6:37am View
   
Answer updated
OriginalGriff 27-May-17 6:04am View
   
You're welcome!
OriginalGriff 27-May-17 4:19am View
   
"whingbis": a word generated by the stupid Win10 soft keyboard when you meant to type "which is". Often seen when using a Win10 tablet with fat fingers and no tactile feedback... :O
OriginalGriff 27-May-17 0:45am View
   
Website name removed: with it you look like a spammer, and since there is no site behind it yet it is completely irrelevant.
OriginalGriff 26-May-17 15:13pm View
   
No, you don't - that's the whole point!

Look at the code.
You call GetThumbnailImage. What do you do with the Image that it returns?
OriginalGriff 26-May-17 13:57pm View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get to work with exactly what you type. And we gave no idea what environment you are working in, what kind of file it is, where you want to save it, or indeed anything other than you are using C# and want to save something.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 26-May-17 11:39am View
   
Yes, because you used the same data buffer for both instead of accessing the thumbnail data after you created it.
Look at your code: what do you do with the thumbnail image when you call GetThumbnailImage? Where do you store the thumbnail image itself?
OriginalGriff 26-May-17 10:51am View
   
You wrote the code to get the image data from the image, yes? So you need to do something similar to get the thumbnail data.
OriginalGriff 26-May-17 8:21am View
   
You're welcome!
OriginalGriff 25-May-17 15:34pm View
   
You're welcome!
OriginalGriff 25-May-17 14:51pm View
   
Read my code carefully: I changed the "=" to "==" *and* the 'O' to "O"
OriginalGriff 25-May-17 14:51pm View
   
Sorry - that wasn't meant for you - it was intended for the OP... :blush:
OriginalGriff 25-May-17 14:50pm View
   
Read my code carefully: I changed the "=" to "==" *and* the 'O' to "O"
OriginalGriff 25-May-17 7:26am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work from.
So what are the "tally marks", where do they come from, and what do you want to do with the information once it's stored?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 25-May-17 6:18am View
   
Instead of just guessing and hoping for the best, why not just copy the code from the example, and give that a try first?
When you have that working, then start to replace the stuff it prints with what you actually want...
OriginalGriff 25-May-17 4:19am View
   
I don't know any way to get that - it may be possible, but you will have to ask a separate question and see if anyone else can help you.
OriginalGriff 25-May-17 3:40am View
   
Try Environment.GetFolderPath(Environment.SpecialFolder.StartMenu)
OriginalGriff 25-May-17 3:38am View
   
Why on earth are you playing with strings?
When you do string comparisons, it compares them character by character - and the first different character determines the comparison for the whole string.
So depending on what the locale and default Long and Short date formats for the specific PC you are using (and what format the POC that inserted the date string into the DB is set to) the comparison could return any "greater than" and "less than" results.
Use the DateTime values directly, and make sure that your DB DateTime values are also DateTime, not string.
OriginalGriff 25-May-17 3:09am View
   
Follow the link I gave you, and read it. Your code doesn't even try to display an image ... or show any database manipulation ...
OriginalGriff 25-May-17 3:07am View
   
Follow the link, read the text.
Then look at the example code ...
OriginalGriff 25-May-17 2:13am View
   
Repost: deleted.
OriginalGriff 24-May-17 14:36pm View
   
Let me guess ... the error is a "Parameter is not valid" exception?

What that means is that your code is very likely wide open to SQL Injection which will let any user damage or destroy your database when he feels like it. Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.

Now, to fix the problem, see here:

https://www.codeproject.com/Tips/465950/Why-do-I-get-a-Parameter-is-not-valid-exception-wh

And read it all, not just skim the highlights and copy the code...
OriginalGriff 24-May-17 14:04pm View
   
Of course you can't! The second form shouldn't even know the first form exists, much less that it's hidden.
That's why the code I showed you uses Show from the FormClosed event handler: when the second form closes, the main form shows itself...
OriginalGriff 24-May-17 9:22am View
   
AND?
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously.

What's the problem?
What have you tried?
Where are you stuck?
What help do you need? Apart from a VOLUME CONTROL of course...

Use the "Improve question" widget to edit your question and provide better information - and to GET RID OF THE SHOUTING.
OriginalGriff 24-May-17 3:17am View
   
And what did you find out when you tried it?
What happened?
Which loop? What were the values? What did you expect them to be? How did they get to be different? The debugger will have shown you all of these things ... and they are essential to find the problem.
OriginalGriff 24-May-17 2:59am View
   
So you think it's a good idea to say "I can't be bothered to help you - go look at my code on a competitor site" to volunteers you want help from?
And to not even try to explain where you are stuck, what help you need?
Not a good start, really is it?

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 23-May-17 12:05pm View
   
And?
What does it do that you didn't expect, or not do that you did?
What help do you need?

Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 23-May-17 9:39am View
   
That's going to depend on you and what you want to call the file you are about to replace!

Me? I'd probably tag them with the date and time: a prefix such as "20170503143718." means that the "backups" remain in chronological order - but you may have a scheme in mind. We don't know what you want!
OriginalGriff 23-May-17 4:44am View
   
You're welcome!
OriginalGriff 23-May-17 3:44am View
   
Please do not repost if your submission is not immediately visible: you were sent to moderation where a human has to decide if it is suitable for publication.
I have deleted the two spare answers.
OriginalGriff 22-May-17 16:08pm View
   
Copy it into Espresso, and see what it says!
OriginalGriff 21-May-17 17:21pm View
   
You're welcome!
OriginalGriff 21-May-17 7:16am View
   
Oh, and BTW: pick a bracketing style and STICK TO IT.
Changing from K&R to "hide the brackets and don't indent the code" doesn't make even trivial code samples like that easy to read.
OriginalGriff 21-May-17 7:14am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work from. And without your input file we can't have any idea what you are getting as output! So edit your question, show us a few lines of sample input data, and add sample output - explaining exactly what you didn't expect to get!
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 20-May-17 9:41am View
   
My comment was in regard to your "bumping" the question: editing it without any changes in order to move it back to the top of the unanswered list. The system maintains change logs and tells us what changes were made - or in your case not made.
OriginalGriff 20-May-17 8:05am View
   
Stop trying to find a solution ready made, and look at your code to see where your problem is: the debugger is there to help you and it will be a lot quicker than trying to persuade people to do your work for you!
You have already spent over seven hours trying this route - and if you wrote the code you should be able to fix in in half that at worst!
OriginalGriff 20-May-17 7:49am View
   
Reason for my vote of one: When you post a solution, it should work. It should at least compile.
ExecuteScalar does not return a string, it returns an object - so your code will fail compilation with "Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)"
Assuming that was fixed, Execute scalar returns a null if no items are found, so your if test will fail at run time with a null reference exception when you try to use the Length property of a null value.
Assuming that was fixed, you can't cast a string to an int even if it contains an integer value as a string - you have to either use Convert.ToInt32 (bad idea) or Parse / TryParse (good idea).

"Better" ideas are ones that work, not ones that don't even compile or run. Please, test your code before you post it as a solution in future.
OriginalGriff 20-May-17 6:48am View
   
You wrote the code; you know what it is supposed to do.
You tested the code; you know what the bugs are.

Stop wasting the short time you have left, and start using the debugger to fix your work! It is going to take you longer to find someone to do your work for you than you have before you are due to submit it as your own work...
OriginalGriff 20-May-17 6:04am View
   
Yes, I guessed it was.
The key word here is "your". "Your" final year project. "Your" submission.
And the idea is that it's "your" work, not mine.
You have two days before you have to submit it, and if this is your final year you should be pretty competent by now: so get busy with the debugger and start working out what is going wrong - two days is plenty of time for a trivial project like this - and then start working out how to fix it.
Or are you saying that I should fix it for you for a percentage of all your future earnings, given that I was at least in part responsible for your grade?
OriginalGriff 20-May-17 4:15am View
   
Don't "bump" your question: it's rude, arrogant, unnecessary, and doesn't help you get a faster answer. By all means add info, but just editing it to get it back to the top of the "unanswered" list is just saying "I'm more important than anyone else, so deal with *MY* question and ignore the rest".
And so is everybody else, and everybody else's questions. If everyone was this thoughtless and rude, you'd never get an answer to anything, because all we'd be able to see would be 100 pages of idiots bumping all the real questions to page 100+
All you do is annoy people, and get them to deliberately not even look at your question, much less answer it.
OriginalGriff 20-May-17 1:49am View
   
There are ways to automatically convert some languages - C# and VB are pretty interchangeable, and there are several converters available - but that is mostly when they share a working environment and framework.
Javascript and C# do not share either!
OriginalGriff 19-May-17 14:00pm View
   
+5 - if I could. :thumbsup: will have to do, I'm afraid.
OriginalGriff 19-May-17 13:59pm View
   
As NotPoliticallyCorrect says, learning to debug your code is not optional: any more than not learning to put fuel in your car is optional if you want to drive any real distance.
Get rid of the string concatenation and use a parameterised query, and use the debugger to find out exactly what is happening when your code runs.
Learning how to find the faults in your code is a major part of learning to code - it's a skill that transfers into the real world, and will help you all your life. But like all skills, you only improve it by using it - and it's a lot easier to learn on a trivial code fragment like that than it is on a 2,000,000 line behemoth...
OriginalGriff 19-May-17 6:39am View
   
And?
What is the problem?
Where are you stuck?
What help do you need?
Have you looked at the official documentation, and if so, why didn't that help you?
OriginalGriff 19-May-17 5:01am View
   
Repost: deleted.
OriginalGriff 18-May-17 17:11pm View
   
You're welcome!
OriginalGriff 18-May-17 14:00pm View
   
You're welcome!
OriginalGriff 17-May-17 15:06pm View
   
So follow the link, and see what it says...
OriginalGriff 17-May-17 2:52am View
   
You're welcome!
OriginalGriff 17-May-17 2:15am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind. Perhaps if you add the code fragment you tried, and explain exactly what you expected to happen it might help?
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 16-May-17 5:27am View
   
Repost: deleted.
OriginalGriff 16-May-17 5:14am View
   
Create a loop which checks the "banned extensions" array against the values returned by the GetExtension method.
OriginalGriff 16-May-17 5:13am View
   
Answer updated.
OriginalGriff 15-May-17 14:12pm View
   
No, show me what you tried!
OriginalGriff 15-May-17 14:01pm View
   
What error? Remember, we can't see your screen...
OriginalGriff 15-May-17 8:28am View
   
And do you know what that time value is?
Is it seconds since a particular time? If not, what?
Unless you know what it represents, and how it represents it, how do you propose to convert a user input to a valid DB value?

Stop guessing: Change your DB to use DATETIME or DATE values, and do it properly!
OriginalGriff 15-May-17 8:00am View
   
:sigh:
The database doesn't have a password, but SQL Server does ... it either operates in Integrated Security (normally only for dev, and when the instance is on your local development PC) or it will require a username and password combination in order to use the instance (normal for production, often used in dev as well to limit what damage you can do by restricting the user access permissions).
OriginalGriff 15-May-17 4:46am View
   
I have given you the solution!
We can't tell you what connection string to use, we have no access to your network to identify SQL instances, much less know what user ID and passwords you are expected to use...
OriginalGriff 15-May-17 4:30am View
   
A) I'm not wading through your whole project trying to work out what you are supposed to be doing: that is your job, not mine.
B) The database is irrelevant: it's the SQL Server instance that that can;t be found to use the DB.
OriginalGriff 14-May-17 8:19am View
   
Answer updated - this isn't a solution, don;t post it as such.
(Normally, comments are displayed, but the DB appears to have a problem, so they aren't at the moment.)
I'll delete it for you so you don't get nasty messages...
OriginalGriff 14-May-17 2:10am View
   
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
OriginalGriff 13-May-17 11:30am View
   
Then you have made a massive design mistake, which you need to rectify as quickly as possible. Change that SQL column from NVARCHAR to DateTime (The simplest way is to add a new column that is DATETIME and NULLABLE, and write C# software to read the existing column, parse it to a DateTime value using TryParseExact and write the value to the new column. You can then delete the old column, and change all the software that refers to it.

Always store data in appropriate columns types - storing things as string is both wasteful and dangerous because the values you show are far too easy for SQL to misinterpret when they get converted. It doesn't know that they are dd/MM/yyyy and will probably default to MM/dd/yyyy as SQL server is american. Thus, it will throw exceptions or give you wrong values when you convert them.

The sort order for strings is character based, don't forget. Which means that as far as ordering two string based dates goes, the order is:
21/01/2147
21/12/1946
30/01/2017
31/01/2016
Which is completely useless!
OriginalGriff 13-May-17 9:55am View
   
You're welcome!
(You don't need to use "Mr" in front of "OriginalGriff" - it's not a "real" name, it's just a username - and you don;t need an atsign in front of the username to send a message. The system does that automatically for you.
OriginalGriff 13-May-17 5:12am View
   
And there is your answer: it's not an image, it's a set of vector coordinates you will need to process and draw onto an image, not image data in itself.
OriginalGriff 13-May-17 1:49am View
   
This is an English language site, and all questions and answers must be in that language.
Please either use Google translate, or find a site in your native language.
OriginalGriff 12-May-17 11:35am View
   
Repost: deleted.
OriginalGriff 12-May-17 1:57am View
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind. And without access to your SP, your data - or even any idea of the amount of data involved, or the code you are using to load the GridView there is nothing we can do to help.
Use the "Improve question" widget to edit your question and provide better information.
OriginalGriff 11-May-17 13:58pm View
   
Pretty much, yes - but store the oldValue in the NumericUpDown.Tag property, so it's "part of" the control.
OriginalGriff 11-May-17 6:26am View
   
Then you'd need to nest that query in a second which returned RowNumber based on the Model from the query I gave you.

Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid