Click here to Skip to main content
12,828,476 members (46,307 online)

Comments by Dave Kreskowiak (Top 200 by date)

SSMS is not a database engine so you're not making any sense. The engines are LocalDB, SQLExpress and SQL Server Data Engine. SSMS is SQL Server Management Studio, not a database engine.

Your "Data Source" should be the DNS name or IP address of the SQL Server. So what is this "AA5570LT" you put in there?

I'm also going to question your use of Integrated Security but I'm ignoring it for now.
Congratulations. You resurrected a THREE YEAR OLD question to post a "solution" to it that isn't.
Asked and answered FIVE YEARS AGO.
Get rid of the "USERS ID=admin" part. It's spelled wrong for one and you don't need it at all for another.

Do you have Office 2010 or above installed or have you installed the appropriate Access Runtime, like 2013?
Which has absolutely nothing to do with the question I asked.
You don't. To your external site, they both look like the same machine coming from the same IP address.

You could throw a cookie on the client when they first visit the site it they don't have one. Put a unique identifier in the cookie and then you can ID the machine. Unless, of course, the browser doesn't allow cookies or the client clears them out.
If you're asking about an article here on CP, go to the forum at the bottom of the article and ask your question there. Articles are supported by the people who wrote them.
You know this was asked and answered FIVE YEAR AGO?

Seriously, I would NEVER use Access for a database that big.
Dave Kreskowiak 2 days ago View
You don't. Why would you want to?
Dave Kreskowiak 2 days ago View
Is the account you're trying to as a member of the Exchange server? If not, you Exchange will not allow you to impersonate that account.
Dave Kreskowiak 2 days ago View
Compilers don't do anything with .TXT files, so your question doesn't make any sense at all.

You are probably confusing the compiler with your own application. If that's the case, we can't tell you anything useful to diagnose the problem because we can't see your code and you haven't told us anything at all about it.
Dave Kreskowiak 2 days ago View
It's been a LONG time since I've done random in C/C++. Things have changed a bit...

Rand() returns an integer from 0 to 32767, not from 0 to 1. Multiply 32767 by 999999 and you get a number that overflows an int, thus giving the strange results.

The new code has a couple of methods of returning a range of integers, one biased and one not:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <random>

// Define two methods of generating random numbers;
int GetRandomModulo(int min, int max);
int GetRandomModern(int min, int max);

int main()
int i = 0;
int num = 0;

for (i = 0; i < 88; i++)
// use

num = GetRandomModulo(1, 9999999);

// or

num = GetRandomModern(1, 9999999);

printf("%d\r\n", num);

return 0;

int GetRandomModulo(int min, int max)
int range = max - min + 1;
int num = rand() % range + min;

return num;

int GetRandomModern(int min, int max)
// This code is should really be wrapped in its own class to
// prevent constantly reseeding the RNG engine every time it's
// called.

// Seed a Mersenne Twister RNG engine
static std::random_device seed;
static std::mt19937 engine(seed());
static std::uniform_int_distribution<int> ditribution(min, max);

return ditribution(engine);
Dave Kreskowiak 2 days ago View
Easy. Create the database in Access, save it, then include the ACCDB file with your project. When you want to create a new instance of the database, copy the ACCDB file. Really just a couple of lines of code. Done.

Now, doing it like "Create database", "Create table", "Create another table", ..., "Create column", "Create another column", ..., "Create realtionship", "Create another relationship", ..., ... Results in a LOT more code.
Dave Kreskowiak 2 days ago View
OK, I'll bite. WHY are you trying to use ADOX?

Nevermind, I reread the question.
Dave Kreskowiak 3 days ago View
How the f*** should I know?!?! It's YOUR application. I have no idea what you want/need to do with that value!
Dave Kreskowiak 3 days ago View
This was asked and answered FIVE YEARS AGO.
Dave Kreskowiak 3 days ago View
You do realize this question was asked AND ANSWERED OVER SEVEN YEARS AGO!?
Dave Kreskowiak 3 days ago View
So what's the question?
Dave Kreskowiak 3 days ago View
It sounds like multilevel marketing to me.

Dave Kreskowiak 4 days ago View
Then you've got an older VS that doesn't support the $.

You have to do what you did in the reply below or better yet:
    string uri2 = string.Format("http://localhost:1891/api/test/combofill/{0}", id);
Dave Kreskowiak 4 days ago View
You never replace the {id} in the URI string with an actual value so, no. Just putting "{id}" into a string does NOT automatically replace it with the variable content. That is, unless you start the string with $"...".

You REALLY need to learn how strings work and you REALLY need to learn to use the debugger.

You should have
    string id = Combo.SelectedText;
string URI2 = $"http://localhost:1891/api/test/combofill/{id}";
Dave Kreskowiak 4 days ago View
This problem really has nothing to do with the API. You're missing the concept of simple string manipulation. You just need to change one URL for another. If they both go to the same host all you need to do is create a new string starting with the "http://localhost:1891/api/" then you can append the method you're calling to it.
Dave Kreskowiak 4 days ago View
The client code has to post every request with it's token or some ID for it in the database. I would have thought that would be obvious.

There is no built-in method to do this.
Dave Kreskowiak 5 days ago View
So you can't renew the contract?
Dave Kreskowiak 5 days ago View
OK, then it's entirely up to you how you handle it. You could just put a LogOut method in your API to handle removing the token from your database or just let the token expire and remove it if the current date/time is greater than the expiration date/time. How you do this is entirely up to you.
Dave Kreskowiak 5 days ago View
You do realize that this question was asked THREE AND HALF YEARS ago? I doubt the OP is still looking for an answer.
Dave Kreskowiak 5 days ago View
...and none of this made any sense at all.
Dave Kreskowiak 5 days ago View
<sarcasm>Yeah, that's not dangerous at all.

There's a reason why I said setup a user account that has the permissions to do it. Giving the default ASP.NET account admin permissions to the box is about as dangerous as giving the nuclear button to a band of chimpanzee's.

You give a web server account only the permissions it needs to do it's job. Anything more than that and you allow hostile code full admin permissions to your entire machine.
Dave Kreskowiak 23-Mar-17 11:09am View
You probably made his head explode too. :)
Dave Kreskowiak 23-Mar-17 11:07am View
Are you asking how to find out which version of MSBuild was used to build an executable using nothing but the information/data in the executable?
Dave Kreskowiak 23-Mar-17 11:05am View
There's nothing to translate. You're supposed to be writing code that meets all of these specifications.

No, you're not going to get a massive explanation of how to write software in a couple of forum posts.
Dave Kreskowiak 23-Mar-17 10:50am View
That's a sh*t-ton of code to make a label blink. :)
Dave Kreskowiak 23-Mar-17 9:12am View
Actually, the code will have permissions to kill explorer. Explorer runs as the user logged in, not the system.

On a system where multiple users are logged in, he can only kill his copy of Explorer. He won't be able to kill anyone elses.
Dave Kreskowiak 23-Mar-17 9:00am View
How do you stop an "Async Await"? You don't. You're not understanding the concepts of async and await.

You should be using a Timer, not a Task, for this.
Dave Kreskowiak 23-Mar-17 8:55am View
What "debug log"??

A "log" will contain whatever you want to write to it. You're already doing it though all you're writing is a date/time value.
Dave Kreskowiak 23-Mar-17 8:50am View
Holy sh*t.... "T&C" is "Terms and Conditions". Contact your ISP to see if you are allowed to run a server on your home machine. Then ask them for a static IP address. You usually have to pay extra for this. You're going to need it to put the address into the domain records in the global DNS system.
Dave Kreskowiak 23-Mar-17 8:47am View
Your "Internet Service Provider" may have policies that prevent you from running a server. You may have no choice but to put the site on some other host.
Dave Kreskowiak 23-Mar-17 8:39am View
You're not going to get replies to this. Noone is going to do your homework for you.
Dave Kreskowiak 23-Mar-17 8:39am View
Uhhh, no. That's your homework, not anyone elses.
Dave Kreskowiak 23-Mar-17 8:38am View
And that means absolutely nothing. The problem is on the server side, not the client. The code on the server crashed and you haven't told us anything at all about that code.
Dave Kreskowiak 22-Mar-17 19:01pm View
Yeah, you're going back to the documentation on the scanner and getting the SDK for it. Barcode scanners don't normally send back an image but what they interpreted in that "image".
Dave Kreskowiak 22-Mar-17 15:09pm View
FFS, this question was asked and answered FIVE YEARS AGO!
Dave Kreskowiak 22-Mar-17 15:04pm View
"but I don't know exactly what she tried."

And neither do we so that makes it just about impossible to help. We can't see the code and we have no idea what the scanner is sending sooooo...
Dave Kreskowiak 22-Mar-17 10:30am View
What on earth are you talking about?? You've provided no context information what-so-ever. What kind of application is this? What are you expecting to write code to do? Details are important!
Dave Kreskowiak 21-Mar-17 12:57pm View
That's not a question. That's what you're being told to do. What part of this are you having a problem with?

And no, we're not going to be doing your homework for you.
Dave Kreskowiak 21-Mar-17 12:53pm View
You child form should not know anything at all about the parent form and its progress bar. Your child for code should be raising an event that the parent form subscribes to to get notifications to update its ProgressBar and with what value.
Dave Kreskowiak 21-Mar-17 10:59am View
Your question points out the glaring fact that you have no idea what a port scanner does or how it does it. If you can't answer both of these questions accurately and in great detail you have no hope of completing this project. If you can't explain it to us how are you going to explain it to a computer that's going to be a lot more picky out it?
Dave Kreskowiak 21-Mar-17 10:54am View
You posted a garbage answer to a question that was asked and answered SEVEN YEARS ago. Don't do that again.
Dave Kreskowiak 20-Mar-17 18:51pm View
So where are you getting the data from? You have to store the visitor data somewhere (hint: database) and then get that data to display in your grid.
Dave Kreskowiak 20-Mar-17 16:33pm View
I didn't write the site so I can't comment on how it should work.

Look at the dates on the posts. What did you add to the discussion over an above what was already said? Nothing.
Dave Kreskowiak 20-Mar-17 8:58am View
You would already have this value. You keep a variable with which LEDs are turned on using a bit of bitwise math.
Dave Kreskowiak 20-Mar-17 0:27am View
You know this was answered FIVE YEARS ago, right?
Dave Kreskowiak 20-Mar-17 0:24am View
This was answered over 4 years ago.
Dave Kreskowiak 19-Mar-17 18:35pm View
Get rid of the last line, TextBox3.Text = TextBox7.Text.

Your code appends the data received from the SerialPort to TextBox3 and then immediately replaces the contents of TextBox3 with whatever is in TextBox7.

Your controls should REALLY be renamed to something more useful than the default names. TextBox3 and TextBox7 don't describe what these controls are supposed to be fore.

Also, there isn't a single reference in this code to a RichTextBox anywhere.

Your questions don't make any sense in the context of the code you just posted.
Dave Kreskowiak 19-Mar-17 11:12am View
You want to do it without threads? Good luck with that. A single thread can only handle on request at a time. The more clients you have, the more the requests are going to queue up until your code gets around to each of them. You'll be able to get an increase in clients on a single thread, but there's going to be a limit on what you're going to find is acceptable performance.
Dave Kreskowiak 18-Mar-17 21:52pm View
WHY on earth are you using VB6?? It was outdated 17 years ago and is no longer supported.

Visual Studio Community edition is FREE!
Dave Kreskowiak 18-Mar-17 21:50pm View
So? Convert the code from C# to VB.NET. For the most part you just remove the semicolons.

There are also code conversion utilities on the web. Just Google for "Convert C# to VB.NET".
Dave Kreskowiak 18-Mar-17 21:34pm View
Or, you might want to Google for "ASP.NET Single Page Application".
Dave Kreskowiak 18-Mar-17 11:05am View
I only have the vaguest idea of what you're talking about. I've seen a project that will lock the machine if a Bluetooth item gets out of range but that's about it.

Are you saying you want the machine to lock if you take a USB device out?
Dave Kreskowiak 18-Mar-17 10:24am View
OK, there's something you're not telling us. Without seeing the code and what the variables are defined as it's impossible to tell you what you're doing wrong.
Dave Kreskowiak 17-Mar-17 14:24pm View
If LowerBound and UpperBound are actual columns names in the same table the query will use the values in the same row as the value being evaluated.
Dave Kreskowiak 17-Mar-17 14:11pm View
Originally, so did I, but then this started reeking of "noob". I started thinking this is a copy'n'paste job of some example somewhere.
Dave Kreskowiak 17-Mar-17 14:05pm View
This may seem stupid but did you replace "LowerBound" and "UpperBound" with ACTUAL VALUES or did you leave that text in that query with nothing to define what "LowerBound" and "UpperBound" represent?
Dave Kreskowiak 16-Mar-17 20:14pm View
So what? We're not going to help you crack a damn thing. It's protected or encrypted content for a reason and that's to prevent you from doing what you're attempting.
Dave Kreskowiak 16-Mar-17 20:12pm View
No, there is no solution. That code is usually in other script files or encrypted content or Flash content and you're not going to be able to get at it. Also, unless you're using a web browser control, you're not even going to get the javascript or other scripting language.

Dave Kreskowiak 16-Mar-17 18:55pm View
You're not going to be able to do it for every site. There are a variety of methods used to upload files, some simple, like your link, to form posts, and others impossible to get a link for because the file is uploaded by Javascript code. Links are becoming more and more rare, probably because of bots like yours.
Dave Kreskowiak 16-Mar-17 16:04pm View
Was there an error message to go along with that "project unloaded" message?
Dave Kreskowiak 16-Mar-17 12:45pm View
OK, so what O/S is this "embedded" computer running? Is it also running the web server?
Dave Kreskowiak 16-Mar-17 12:44pm View
ASP.NET app? Nothing like making it harder for yourself.

So, on which machine are you doing this configuration change? On your web server? On some other machine? Are they in a domain environment?
Dave Kreskowiak 16-Mar-17 12:41pm View
Really? This was answered TWO YEARS ago and all you did was add boilerplate code to the "discussion".
Dave Kreskowiak 15-Mar-17 19:27pm View
You can't pick between 32 and 64-bit versions to install.

Without the error messages it's impossible to tell you anything useful.
Dave Kreskowiak 15-Mar-17 18:57pm View
...and...??? YOu forgot to ask a question.

No, we're not going to do your homework for you.
Dave Kreskowiak 14-Mar-17 22:50pm View
Yes, even if they are "deleted".
Dave Kreskowiak 14-Mar-17 21:29pm View
You're really not going to find examples of each of these specific things. You have to learn the more general and simpler examples and then you develop things like this yourself.
Dave Kreskowiak 14-Mar-17 21:12pm View
Yeah, well a "web portal" is a generic term that can cover a wide range of functionality. Nobody is going to just hand over their code for their own portal. You're also going to have to get with the customer and spec out exactly what they mean by "web portal" and exactly what functionality they want.

You can study the .NET Framework all you want. You're not going to get any closer to writing an ASP.NET app. The .NET Framework does not cover any of the conventions ASP.NET uses and there's a lot of them. You need to study ASP.NET itself. Actually, I'd add MVC to that as well. You might find things a bit easier that way.
Dave Kreskowiak 14-Mar-17 20:29pm View
You know this is a year and half old questions was already answered. You really haven't added anything at all to the discussion.
Dave Kreskowiak 14-Mar-17 20:26pm View
You're question isn't and isn't answerable either.

We have no idea what this "some winform" application is. What does it do? Did you write it? What are you doing exactly when you "debug it"? Did you set breakpoints and the code stopped at one of them? The app will not respond or repaint itself at all if the debugger has stopped the code from executing.

Without proper details, it's impossible to tell you anything useful.
Dave Kreskowiak 9-Mar-17 8:55am View
Good luck!
Dave Kreskowiak 9-Mar-17 8:11am View
Think about that for a second.

If you're trying to reset the users password because they can't login how in the hell are you going to get the users context?
Dave Kreskowiak 9-Mar-17 7:42am View
You're not going to launch a web browser while running as Local System. I know IE didn't work the last I tried it as an experiment. Also, the security implications of doing so are frightening.
Dave Kreskowiak 9-Mar-17 7:40am View
No alternate solution here.
I was thinking year-end procedures myself.
Dave Kreskowiak 8-Mar-17 14:33pm View
Have any idea how many times I've seen people screw that up or not use a transaction at all? Makes for fun times fixing the f-up in the code and the data once its in production. Experience shows that it's way too easy to screw it up.
Dave Kreskowiak 8-Mar-17 14:17pm View
If more than one machine runs the code to get the current invoice number, those machines will all use the same invoice number for different invoices.
Dave Kreskowiak 8-Mar-17 13:55pm View
Just a thought, but wouldn't it be easier to RESEED the autonumber field to something like 201700000001?
Dave Kreskowiak 8-Mar-17 13:46pm View
WRONG WRONG WRONG. This does not work in a multi-user environment. You NEVER do something like this. You always let the database assign the numbers.
Dave Kreskowiak 8-Mar-17 13:30pm View
I'm sure that makes a ton of sense to you but since we can't see your screen, access your hard drive, or read your mind, we have no idea what eff you're talking about. What kind of application is this and what do you mean by "template" and "tile".
Dave Kreskowiak 8-Mar-17 13:28pm View
It's not a matter of posting questions correctly. It's a matter of asking them! Talk to humans much? You start with describing the context in which you're then going to detail and ask a question. For example, start by describing the purpose of that code dump and where you got it from. Next, detail an interrogative pertaining to this context and wait for a reply.
Dave Kreskowiak 8-Mar-17 8:43am View
What do you mean by "how to data get mapped to the real database"? That makes no sense at all.

If that's what you were Googling for I'm not surprised you didn't find anything.
Dave Kreskowiak 8-Mar-17 8:34am View
Still not enough information. I have no idea what process is requesting that login.
Dave Kreskowiak 7-Mar-17 23:23pm View
Don't hijack someones thread for your own use. Start your own question.

You resurrected a FIVE YEAR OLD question for some question that made no sense at all and has nothing to do with the original question.
Dave Kreskowiak 7-Mar-17 23:20pm View
You can't use Jet for this. It has no idea what an XLSX file is. You have to use the ACE engine. Look at your connection string.

But, keep in mind that a DGV is NOT Excel. The best you're going to be able to do is show values. Cells with formulas will not work at all.
Dave Kreskowiak 7-Mar-17 23:03pm View
Not enough information to tell. I have no idea where this "Guest" login is coming from.
Dave Kreskowiak 7-Mar-17 17:24pm View
After FIVE YEARS, I seriously doubt it. Why would anyone just hand over their hard work to you?

On top of that, you might want to remove your email address from your post. It does nothing but attract spammers.
Dave Kreskowiak 7-Mar-17 14:25pm View
Because you haven't setup SQL Server Express properly to allow it to work, as I've already told you.
Dave Kreskowiak 7-Mar-17 12:43pm View
The next problem is you can't really use a trusted connection. Create an SQL login for your database and use that account in your connection string.
Dave Kreskowiak 7-Mar-17 12:38pm View
First, if you're going to talk about SQL Server, you MUST sya you're using the Express edition. Things are setup quite a bit differently under Express than they are under the full Server versions.

Next, Express doesn't allow remote connections by default and, since that is a named instance ("SQLEXPRESS"), it doesn't listen on port 1433.

If you've got the SQL Server Management Tools installed with your Express installation, setting this up is easy. Just follow this guide[^].
Dave Kreskowiak 7-Mar-17 10:00am View
Show us the connection string you're using. Chances are really good your PC's are NOT in an Active Directory and you're using a Trusted Connection, which won't work in your situation.
Dave Kreskowiak 7-Mar-17 9:45am View
And you wonder why you've been getting down-voted everywhere...
Dave Kreskowiak 6-Mar-17 20:46pm View
Contact Amazon AWS Support?
Dave Kreskowiak 6-Mar-17 10:35am View
That made no sense at all. Are you saying you're writing an application on the server-side that accepts connections from clients and the server. This application isn't any specific well-known server like, like a web server, FTP, .... It's entirely custom.

This is going to require you to write another "server" application for the client-side in javascript. This is going to be considerably more work.

You'd be MUCH better off using something like SignalR to handle the communication for you.
Dave Kreskowiak 6-Mar-17 8:28am View
Nobody is going to do your work for you.

Post your own question. Don't hijack a THREE YEAR OLD post for your own purposes.
Dave Kreskowiak 6-Mar-17 8:18am View
Whoops! My bad. I misread the question.
Dave Kreskowiak 5-Mar-17 18:17pm View
You posted this as an answer to your own question.
Dave Kreskowiak 5-Mar-17 18:13pm View
Not enough information. What kind of server on the server-side? ASP.NET? Other web server? Some custom TCP/IP server you've written? What does it do? What transport protocol does it expect? What ports?

There's a ton of websocket libraries for javascript, not just the one you used.
Dave Kreskowiak 5-Mar-17 11:49am View
Dave Kreskowiak 5-Mar-17 11:40am View
You really need to start looking at the dates of what you're replying to.
Dave Kreskowiak 4-Mar-17 22:12pm View
Nope. Go back and reread what I said.
Dave Kreskowiak 4-Mar-17 20:30pm View
You're not doing what I said.
Dave Kreskowiak 4-Mar-17 20:04pm View
You can't do that. You're giving the controller name but no method name. It has no idea you want to call the GetBook method unless you specify it. To remove that is just stupid because you would then only get to put a single method in the controller.
Dave Kreskowiak 4-Mar-17 19:07pm View
Use [RoutePrefix("/api/controllerName")] on the controller class instead.

Then you can use [Route("{isbn}")] on the GetBook method.

You shoud then be able to use http://localhost/api/ServiceAController/GetBook/1234 to get the content.
Dave Kreskowiak 3-Mar-17 17:25pm View
This made no sense at all. I have no idea what you're talking about.
Dave Kreskowiak 3-Mar-17 17:24pm View
You apparently are not checking the result of the query in your code. That's what the debugger is for.

You checked an arbitrary query in the database tool, not your code. As you've no doubt found out already, they are NOT the same.
Dave Kreskowiak 3-Mar-17 8:48am View
Looking at your code the problem isn't with the grid but with your database query. The grid is displaying everything your query is returning. Your first step is to figure out if the query works as expected and very it's returning everything you're expecting.
Dave Kreskowiak 3-Mar-17 0:28am View
Were you expecting someone to write it for you?
Dave Kreskowiak 2-Mar-17 12:57pm View
The debugger isn't there to find bugs in your code automatically. It's there to find bugs in YOU. It's there to help you understand your code and how it works.
Dave Kreskowiak 2-Mar-17 8:17am View
Sooo... who's code did you copy? You obvious didn't write it because you're asking a bunch of questions that would be easily answered yourself if you did.
Dave Kreskowiak 28-Feb-17 19:08pm View
You had to resurrect a FIVE YEAR OLD question to post yet another answer to a question that was answered 5 times already?
Dave Kreskowiak 27-Feb-17 0:03am View
And that doesn't change my answer at all.

In the end you are not guaranteed any order at all unless you put an ORDER BY clause in the query.
Dave Kreskowiak 26-Feb-17 16:51pm View
First, your answer is wrong.

Second, you have to resurrect a FIVE YEAR OLD question to post an "I don't know" answer? Don't do that again.
Dave Kreskowiak 26-Feb-17 12:48pm View
On top of that you resurrected a question that's SIX YEARS OLD for this nonsense.
Dave Kreskowiak 25-Feb-17 20:50pm View
That's a REALLY BAD answer to this problem that leads to ID collisions in multiuser enivronments.
Dave Kreskowiak 23-Feb-17 15:38pm View
And just like yesterday, we're still not doing your homework for you.
Dave Kreskowiak 23-Feb-17 10:11am View
Ummmm you're question isn't answerable because you forgot to show what code is generating this statement, what the statement looks like and what it's supposed to look like.
Dave Kreskowiak 22-Feb-17 22:19pm View
Gotta check the dates on posts. This one is 4 years old.
Dave Kreskowiak 22-Feb-17 19:43pm View
What kind of app? If this is a web app you might be getting bit by a page cache.

Normally you save changes with yourDbContext.SaveChanges(), not just a transactionContext.Commit().

Without seeing the relevant code, it's pretty much impossible to tell you what's going on without a ton of guessing.
Dave Kreskowiak 22-Feb-17 9:11am View
This sniffs of homework.
Dave Kreskowiak 22-Feb-17 9:03am View
I have no idea how to do it. Client-side script is not my strong suit.
Dave Kreskowiak 21-Feb-17 18:58pm View
I'm not entirely sure what you're having a problem with, but as you're coming from a C/C++ background, you may be overthinking this a bit.

Google for "C# binary serialization". See what that does for you.
Dave Kreskowiak 21-Feb-17 18:27pm View
ALL of which are nothing but text files.
Dave Kreskowiak 21-Feb-17 18:25pm View
You haven't been keeping track of what this guy is doing. He's not really putting in the effort to learn anything. He's a help vampire.
Dave Kreskowiak 21-Feb-17 17:13pm View
Probably because you repeated an answer(s) that already covered what you said.
Dave Kreskowiak 21-Feb-17 9:42am View
Come on, this was asked over FOUR YEARS AGO! You're just now adding an irrelevant answer to something that has already been answered? Sorry, no rep points for you. Not that they're worth anything anyway...
Dave Kreskowiak 21-Feb-17 8:35am View
Ummm...what? You call it just like any other method, passing in the appropriate parameters:
    var result = GetLevelInfoData(gameId, levelNo);
Dave Kreskowiak 20-Feb-17 15:57pm View
Why MDI?? It's been dead for a long time now.

The MDI mode in Windows Forms was for multiple document editor windows. For example, a Notepad that can open and edit multiple files at the same time. If something like this is not what you're doing, MDI is a bad choice.

If you're using it because you have the same code in multiple child forms then the solution is to have a form that contains this common code and subclass your specific child forms from it, not move the code to your Main form.
Dave Kreskowiak 20-Feb-17 8:10am View
You do know that ActiveX controls are no longer supported in browsers, right?
Dave Kreskowiak 19-Feb-17 23:46pm View
You can't pass a "control". Because it doesn't really exist. The "controls" you're looking at in ASP.NET are just objects that only exist server side that render HTML strings the browser can render. If you want to return a "control" to add to the page (a silly thing to do IMHO), return the HTML for the "control" and the javascript would have to inject that HTML into the DOM wherever appropriate.
Dave Kreskowiak 19-Feb-17 9:52am View
You have to look for the "Qualifiers" line just above the description for the property.
Dave Kreskowiak 18-Feb-17 15:00pm View
A quick way to see the objects is to open PowerShell and type:
Get-WmiObject Win32_Volume
Scroll back through the output and you can see everything in every Win32_Volume object, including the content of the DriveLetter property in each instance.
Dave Kreskowiak 18-Feb-17 14:56pm View
Like I said, there's nothing that says those instances have to be completely filled in. If the DriveLetter isn't filled in by the system there's nothing you can do about it.

The format on mine is "D:", no slashes, uppercase. If DriveLetter isn't filled your query will return null and that's why you're code fails. It's assuming that it will always return a good object. Calling ToString on null is a bad thing.

Dave Kreskowiak 18-Feb-17 12:09pm View
OK, whatever. I've never used Agents so you're not getting any help from me.
Dave Kreskowiak 18-Feb-17 12:02pm View
His point was that Agents was discontinued 7 years ago. It's no longer supported and Windows 8 and above doesn't support it. Also, the ActiveX portions don't work in any browsers other than Internet Explorer and older versions of Firefox.

Basically, you're using technology that was abandoned a long time ago. It's very unlikely you're going to get much help with it.
Dave Kreskowiak 17-Feb-17 18:33pm View
This question is three years old. I doubt the OP is still looking for an answer and your answer doesn't really add much to the conversation. The OP should have talked to the people who wrote the library in question.
Dave Kreskowiak 17-Feb-17 15:15pm View
Uhhh... no it's not. Not even close. It's the slowest submission so far.

The conversion to string and the split are killing your performance. Just because it's five lines of code in no way means that it runs fast.
Dave Kreskowiak 17-Feb-17 13:26pm View
An important part of the challenge is reading and understanding ALL of the requirements.
Dave Kreskowiak 17-Feb-17 10:10am View
Keep in mind that there is no such thing as something happening "automatically" for you. YOU Have to write the code to make these things happen.
Dave Kreskowiak 16-Feb-17 19:18pm View
What the %*$& are you talking about??
Dave Kreskowiak 15-Feb-17 23:33pm View
Dave Kreskowiak 15-Feb-17 19:25pm View
The better way to do this is to create a class that hold the information required and pass that class instance (object) around as required.

Assuming that the exception you got was a NullReferenceException, you created a List<datakolores>. The gives you a List<t> that can CONTAIN a bunch of datakolores objects. It did NOT create those objects. So, you have to create an instance of datakolores and add it to the list for each instance you're tracking.

You're going to have to redesign your code to get something that is more appropriate. The List<t> doesn't have a clue how many elements it should have in it and you don't have any code to specify that:

public static List<datacolores> TabColores = new List<datacolores>();

for (int c = 0; c < someMax; c++)
datacolores newItem = new datacolores();
newItem.kimporte = 0; // or init to an appropriate value;

Dave Kreskowiak 15-Feb-17 16:01pm View
Global variables are a bad idea all around. You're basically giving every part of your code complete access to the variables instead of allowing them to be changed in only controlled circumstances. You're also making your debugging effort considerably harder by using them.

The class where it is used should maintain complete control of the values it contains and only expose certain methods to be able to modify those values.

What's the exact error message? It's not "this is not a variable". Could it be a NullReferenceException or "An object reference is not set to an instance of an object"?
Dave Kreskowiak 15-Feb-17 14:52pm View
This code fragment is incomplete and, frankly, doesn't make as sense at all. What is "G"? Why are you using static variables in what looks like it should be instance? Near the end, you have ... += dblImporte; several times but this variable isn't defined anywhere and the value isn't set anywhere.

Basically, I have no idea what this code is supposed to be doing but I can tell you it's overly complicated for what it appears to be doing.

Also, the formatting of the code is all over the place, making it harder to read, understand, and debug.

If you're using "global" variables, you're making a big mistake.
Dave Kreskowiak 15-Feb-17 12:15pm View
You also didn't Dispose your Graphics object after you're done with them. Your code is leaking resources and will eventually crash your application and Windows.
Dave Kreskowiak 15-Feb-17 11:15am View
You resurrected a four year old question to post something that had absoutely nothing to do with the orignal question. Don't do that again.
Dave Kreskowiak 15-Feb-17 0:19am View
That all depends on what you mean by "know other system task operation is running or not". From the looks of that batch file, you just have to supply the correct filename for whatever process that is.
Dave Kreskowiak 14-Feb-17 19:58pm View
You cannot use "infinity" as a requirement. Infinit ID's require infinite storage, which no machine on earth has.

This is a business rule you're talking about. So what does the business expect to happen when the ID numbers "rollover"? That's where your answer lies.
Dave Kreskowiak 14-Feb-17 12:42pm View
What do you mean by "fix"?? Are you trying to prevent the form from being resized or is the size of the form not correct in some way?
Dave Kreskowiak 13-Feb-17 15:36pm View
Don't dig up years old questions just to add nothing to a discussion that already happened.
Dave Kreskowiak 13-Feb-17 8:15am View
You didn't listen to a single word I said. Those two lines of code have absolutely no meaning what-so-ever. It's IMPOSSIBLE to convert them to C/C++.

ECX is a CPU register, the two labels BYTE_BCAD72 and SUB_4ABCGA are not defined in your code to there is no value to move into ECX and no way to call a sub that you don't have defined.
Dave Kreskowiak 13-Feb-17 8:12am View
Really? Did you even TRY to Google "svg to xaml conversion tool"?
Dave Kreskowiak 12-Feb-17 11:38am View
You never described what the problem is.

You can learn a lot about your own code if you learn to use the debugger.
Dave Kreskowiak 11-Feb-17 18:20pm View
I already told you. You're treating the query as an IEnumerable instead of an IQueryable. The Where clause returns an IQueryable. But your code narrows that down to an IEnumerable instead because IQueryable inherits from IEnumerable. Your way of writing it uses a little quirk of an IQueryable called "deferred execution". The query isn't executed until you get to _cat.FirstOrDefault(). Well, you already converted the IQueryable to an IEnumerable at this point. The value of _cat is now null and you can't call FirstOrDefault on a null object.
Dave Kreskowiak 9-Feb-17 7:59am View
"Unused indexes"? What does that mean? If you're talking about primary key values then you just ignore "unused" ones. Finding and filling in the holes in the contiguous range of used key values does not scale. Performance will go down as the number of rows in the table increases.
Dave Kreskowiak 9-Feb-17 7:54am View
What? Create the .ZIP file on the FTP server from files you upload to it? You can't. You're not going to get a process to run on the FTP server to create the .ZIP file.

Dave Kreskowiak 6-Feb-17 20:16pm View
Again, there is no license, nor royalty.
Dave Kreskowiak 6-Feb-17 0:26am View
Without knowing what the error message says you, and us, are just guessing at what the problem is.
Dave Kreskowiak 4-Feb-17 9:56am View
The web is already full of examples. All you have to do is Google for " ajax call", or if you're using MVC, "mvc ajax call".
Dave Kreskowiak 2-Feb-17 12:49pm View
A quick solution would be to get the date string, check it's length, then switch to an appropriate parse string, one for one digit months and one for two digit months.

Really, your data is what's the problem. In a normalized format, you would have a consistent number of digits for all month , day, and year numbers. This means leading zeros on values to fill the required number of digits to maintain consistency in the data.
Dave Kreskowiak 2-Feb-17 12:09pm View
That's a ton of code that has absolutely nothing to do with the problem. Where's the code that check the credentials against the database? Where's the code that logs the login details to the database. You know, the very thing you're complaining about...
Dave Kreskowiak 1-Feb-17 19:22pm View
Don't add an answer to a FIVE YEAR OLD question that was already answered.

On top of that, you're answer isn't an answer at all. You NEVER EVER IN YOUR LIFE use the SA account for anything other than installing the SQL server. After that, it's not to be used for anything at all, well, unless you want to risk destroying the server with it.
Dave Kreskowiak 1-Feb-17 19:14pm View
Indexers treat the array as an array and are limited to the bounds of the array in every dimension.

ForEach uses an Enumerator which it gets from the Array.GetEnumerator method on the array. It doesn't see it as an array. To the enumerator the array is just a collection, no dimensions.
Dave Kreskowiak 1-Feb-17 17:18pm View
Filtering? There is no filtering at all.

GetUpperBound only returns a number, the largest index for a dimension of the array. That's it, nothing else.
Dave Kreskowiak 1-Feb-17 16:37pm View
Considering UDP does NOT guarantee the delivery of packets, not even the order in which they arrive!, I find the concept of encrypted data over an unreliable socket a rather ridiculous idea.

If you have a block of data that spans multiple packets and a problem occurs with one or more of the packets, you're not going to be able to decrypt the data at all.

Oh! And RC4 is considered broken because of multiple vulnerabilities in it.
Dave Kreskowiak 1-Feb-17 14:47pm View
No. The Force can be used for good and misused for bad. I'd rather not say for fear of the technique being used in an inappropriate manner. and then get blamed for it.
Dave Kreskowiak 1-Feb-17 12:45pm View
I'm not saying. The real "I gotta have" people will Google for it.
Just a warning, it ain't pretty.
Dave Kreskowiak 1-Feb-17 12:44pm View
In the context of your original post, your comment made absolutely no sense at all.
Dave Kreskowiak 1-Feb-17 8:49am View
Yeah, because the Razor engine doesn't use JSON. It uses an actual object.

Seriously, pickup a book on MVC and work through it. This is a very basic MVC concept.
Dave Kreskowiak 31-Jan-17 8:43am View
Your question doesn't make much sense. Is this C# code being written in an SQL Server user defined function or stored procedure or trigger or is it only in the application code?

Typically, you use a dedicated user account to access a database, not the user account running the application on the workstation. In this case, to SQL Server, every database access is from the exact same "person".
Dave Kreskowiak 30-Jan-17 14:12pm View
Really? a FOUR YEAR OLD question and now you jump in? I don't think the OP is still looking for an answer.
Dave Kreskowiak 30-Jan-17 10:46am View
I have to ask my you're using MPIEXEC and sleeping the machine? MPIEXEC is for launching certain types of processes in a High Performance Computing cluster, where machines are usually not allowed to go to sleep anyway.
Dave Kreskowiak 29-Jan-17 20:49pm View
For what? You don't need Windows XP for anything specific. Testing anything on it now-a-days is completely useless as XP hasn't been supported for quite some time.
Dave Kreskowiak 25-Jan-17 17:13pm View

You dug up a five year old post for this?
Dave Kreskowiak 25-Jan-17 10:09am View
4 years is "a little late"?
Dave Kreskowiak 25-Jan-17 8:41am View
This question is FOUR YEARS OLD and your code is more complicated than it needs to be for the task at hand. You haven't added anything to the discussion at all.
Dave Kreskowiak 25-Jan-17 8:39am View
This "question" is over THREE YEARS OLD. I don't think the OP is still looking for an answer and your "answer" isn't. The OP never mentioned why kind of app they were working with and your "answer" makes broad assumptions about the type of app and what the OP meant by "animation".
Dave Kreskowiak 24-Jan-17 20:37pm View
You do know this thread is over FIVE YEARS OLD, right? I think the conversation is pretty much dead.
Dave Kreskowiak 24-Jan-17 8:40am View
That comment was not directed at you.
Dave Kreskowiak 24-Jan-17 8:19am View
Thee one thing your question depends on you didn't mention anything at all. HOW ARE YOU "SAVING" AN HTML TABLE AS EXCEL?
Dave Kreskowiak 23-Jan-17 22:10pm View
You do realize that the Program Files folder (and everything under it) is ReadOnly for normal users, correct? Normal users will not be able to run this code and expect it to work because you're trying to create and write to a file in a location that is ReadOnly for those users.
Dave Kreskowiak 23-Jan-17 0:07am View
This question is over 5 years old and your "answer" doesn't add anything at all to the discussion that happened back then.
Dave Kreskowiak 22-Jan-17 20:07pm View
It's physically impossible to show 500,000 records on any monitor smaller than a football pitch.

You MUST do paging, even with scrolling. There is no other way to do this without lag.
Dave Kreskowiak 22-Jan-17 18:18pm View
The one thing you MUST figure out before you even think of putting a ton of work into this is does the touch layer on the display even support multi-touch and, if so, how many simultaneous touch points.

If the display only supports a signal touch, there's really no point in doing this, now is there...
Dave Kreskowiak 22-Jan-17 10:50am View
So, basically, you haven't done much of anything. We're you looking for someone to walk you through the entire software engineering process?
Dave Kreskowiak 22-Jan-17 9:46am View
Fine, then wrap the installers for MySQL and your app under a Setup.exe that launches them.

As for LocalDB, you can't use it. It doesn't work with remote connections from other machines. It has the same limitations that you've got with Sqlite.
Dave Kreskowiak 21-Jan-17 21:13pm View
What the "elephant" did I just tell you?!?! You install the MySQL server ONCE on the admin machine or on a dedicated server.

Then you have to run a SQL script on the MySql server to create the database and populate any initial data.
Dave Kreskowiak 21-Jan-17 15:22pm View
Probably not, but you need to check with the manufacturer of the printer to find out.
Dave Kreskowiak 21-Jan-17 14:26pm View
Finally! An explanation that's usable! :)

You cannot use Sqlite for this. Well, more specifically, it's a bigger pain in the ass to do it.

You can use MySQL. It just needs to be installed on the Admin workstation or on a dedicated server. BOTH of your applications need to be converted to use MySQL instead of Sqlite. The MySQL server has to be setup to accept TCP/IP connections. You then have to change the connection strings to work with MySQL. You can get the connection string format from[^]
Dave Kreskowiak 21-Jan-17 11:06am View
Considering we know NOTHING AT ALL about your application and what it does and what you mean by "has times hard coded" and what you mean by "copy that app change the times and add it back", it's impossible for anyone to help you.

You basically just jumped into a room where nobody has ever heard of you before and spouted this post without providing any context information at all. Now everyone in the room is staring at you wondering what the "elephant" you're ranting about.
Dave Kreskowiak 21-Jan-17 10:53am View
The problem here is that you have no idea what you're doing with a database and you don't understand what I'm telling you.

Now, what are your applications requirements? Do you have to install the database on the same machine as the application or not? Or are you trying to have multiple instances of your application all work with the exact same copy of the database?
Dave Kreskowiak 21-Jan-17 10:32am View
First, don't hijack a thread that's a year old. Start you're own thread by posting your own question. Go to the "quick answers" menu and click on "Ask a Question".

Second, if you think using separate models is bad, then go ahead and struggle with your problem yourself. The requirements for models in a create and an edit operation CAN be different, very different. So, yes, using separate models for those two operations is quite reasonable.

Lastly, you're going to have to describe what you mean by "Remote validation". "Remote" is a relative term with respect to a viewpoint, which you never described.
Dave Kreskowiak 21-Jan-17 10:26am View
OK, in that case, you have to ask the user for the login credentials for the account you need to use and then pass those credentials in the ProcessStartInfo instance you created, the UserName and Password properties. You don't need the Verb "runas" line at all.
Dave Kreskowiak 21-Jan-17 10:12am View
OK. SQLite is a desktop database, just like Access. It's not really made for multiuser environments.

In order to get this to work, you MUST understand Windows networking and sharing. Without that, you're going to find this take impossible.

Now, if you really want a bunch of users to use the same database, you have to move to a database engine that supports such, like MySQL or SQL Server. You don't have to understand file shares but you do have to understand TCP/IP networking.

In order to use one of those engines, you must install it on a server that all of your users machines can get to on the network.

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