Click here to Skip to main content
15,346,977 members

Comments by Nathan Minier (Top 200 by date)

Nathan Minier 22-Jul-21 9:13am View
According to MDN innerContent is the same thing, but doesn't go through the HTML parser so has less overhead. I've never used it before, but that doesn't mean I'm not willing to give it a shot.
Nathan Minier 21-Jul-21 14:21pm View
You're trying to apply a single object interaction to an array. No, it's not gonna work. Here's the documentation for the method you're using:

So, unless you want to use a single-element selector (such as getElementById) then you should iterate the result to apply your changes. Like so:

function chngetxt(){
var items = document.getElementsByClassName('items');
for(let i = 0; i < items.length; i++){
Nathan Minier 14-Sep-19 7:55am View
1. Make sure that address is properly bound to your NIC.
2. Make sure something else isn't using that port.
3. Your system is likely configured to require admin rights to open a port on an external facing IP.

So, an easy way to check this:
Try running this code against a port on the localhost loopback ( for testing; that generally does not require admin rights.

If that works, delegate port rights to the service account that you plan to use to run the program via netsh urlacl
Nathan Minier 9-May-19 7:24am View
It sort of depends on how you're loading the external site.
Child Window?
Nathan Minier 10-Apr-19 7:10am View
Sure man, but this was bad practice in 1995. The question isn't THAT old :)
Nathan Minier 2-Apr-19 7:40am View
So, you're sending a plain text password as a query string parameter. Even if you were sending it as a post body, your terminus address is http, not https...

Dude, this is the lowest hanging fruit for a hacker. Literally anyone on the wire at any point in the connection chain will be able to steal credentials from your users.
Nathan Minier 22-Mar-19 7:09am View
My advice? Don't ever do this.

The entire point of using a web service is to provide concise, data-only responses to an arbitrary client. Your web service shouldn't know what sort of client is consuming it, so sending formatted HTML instantly breaks this concept. Send raw data, and format it on the client side.
Nathan Minier 25-Jan-19 23:27pm View
You do realize that with this construct (incrementing your control variable within your loop), it will attempt to access up to 125 elements from the MCUData array, right? You're also not cleanly incrementing through your array, which may be fine in your use case, I guess.
Nathan Minier 17-Dec-18 8:47am View
If it's client-side, you don't. You should perform validations on SQL on the server side as a security concern.
Nathan Minier 14-Dec-18 7:35am View
There's already a technology classification called SSO (Single Sign On). Consider picking an SSO solution, like Active Directory with Kerberos, rather than trying to implement a system where user impersonation would be trivial.
Nathan Minier 12-Dec-18 9:53am View
That makes no sense whatsoever; is your WCF service running a push model rather than a pull one? Otherwise the client's shouldn't need to bind a listener to a port.
Nathan Minier 29-Oct-18 7:06am View
The place to start is to determine if you're going to support FIPS or not. If you don't, the RijndaelManaged class makes life pretty easy.

If you do, or might, need FIPS you'll need to use the AesCryptoServiceProvider class.
Nathan Minier 24-Oct-18 15:03pm View
Try just recycling the AppPool, which will re-initialize the application.

If it works after an AppPool refresh, you have a state value that is messing up your application (look for static values/classes). If not, most likely something is misconfigured in IIS.
Nathan Minier 18-Oct-18 15:03pm View
Not specific enough.

An "API gateway" is a generic management term. Generally, in a microservice infrastructure, each service is its own "gateway". In faux-microservice architectures, I suppose you might use one central application to aggregate them, but that's generally not necessary.

When you say UI are you referring to a JS-driven browser-application (SPA/PWA, etc), or are you rolling a native app with microservice access?
Nathan Minier 18-Oct-18 14:52pm View
This looks like it's meant to work with xlsx files programatically. You need to use the loader to import the data, then iterate to provide results to your view. The code you have is to configure the workbook for how Excel will render it.

It looks like it's up to you how you're going to handle values supplied by the script.

// read from a file
var workbook = new Excel.Workbook();
.then(function() {
var worksheet = workbook.getWorksheet('PLAN # 1');
worksheet.eachRow(function(row, rowNumber) {
console.log('Row ' + rowNumber + ' = ' + JSON.stringify(row.values));
Nathan Minier 20-Aug-18 8:55am View
Control focus is a strictly View function, so I would do it in the view code behind hooked to a completion event on the ViewModel.
Nathan Minier 9-Aug-18 8:53am View
You don't use a mailto: link, because that's what opens the email client, you would need to submit the form and have an active server capability on the server that would format for SMTP, or use a special javascript library on the client side, but I would not advise that approach as it would require a completely open SMTP forwarder, and those are generally untrusted downstream.
Nathan Minier 9-Aug-18 8:31am View
The only way to do this safely is if you never actually remove or re-cast columns. If you don't, you can just scope your queries to the appropriate application version.

Honestly, though, your continual release strategy sounds like something that I would actively avoid as a consumer.
Nathan Minier 9-Aug-18 8:27am View
You'll need something on the backend to accept the form data and format it for SMTP. Then you need to have a registered mail server (or have a public gateway that isn't blocked by literally everyone) to pass the message through.
Nathan Minier 8-Aug-18 15:24pm View
If I were to venture a guess I'd say that you're not doing anything to handle the serialization of the file data (which I'm guessing you have the data assigned as byte[]) and the converter just doesn't know what to do with it. You will need to find out what format the receiving end expects to see the attachments in and develop a serialization strategy based on that.
Nathan Minier 3-Aug-18 8:12am View
Two things:
Is the selected control represented by a property in the ViewModel.

Is the class representing the selected control polymorphic, or does it only vary based on specific properties?
Nathan Minier 2-Aug-18 13:50pm View
It there a reason that you need to perform a postback? Just update the contents of a div or other container, which makes the handling of data that needs to span requests simple.
Nathan Minier 1-Aug-18 7:26am View
Not nearly enough context, please refine the question.
Nathan Minier 1-Aug-18 7:19am View
You need to refine your question quite a bit. We don't know what point you're at, what platform you're working from, or where you're stuck. Without those things no one will be able to assist you.
Nathan Minier 30-Jul-18 12:51pm View
Not a good approach for a number of reasons. Is there a compelling reason that you can't do:

instance.met(() => {
Nathan Minier 27-Jul-18 11:34am View
We'll need to see the code for getusers() to really know hoe to show you the right way to do this. You also haven't said what the predicate will be applied too, which matters.
Nathan Minier 25-Jul-18 14:41pm View
I think you've got a more fundamental issue if your design is allowing your role container to provide an "Active" override to a specific actions. Properties should have meaning; it might be of benefit to re-evaluate the structure.

At any rate, the functionality you're looking for is better served by nested loops rather than by an expression tree.
Nathan Minier 24-Jul-18 7:30am View
Please use parameterized queries. You are just begging for SQL Injection, an exploit so cutting edge that people were defending against it in the 90's!
Nathan Minier 19-Jul-18 7:13am View
I try to help. Playing MVVM games almost cost me mine :)
Nathan Minier 18-Jul-18 11:51am View
Scrolling to a specific item is strictly a part of the presentation (it has no bearing whatsoever on business logic), so an event handler on the view is a perfectly legitimate approach. Ignore those weird purists that claim that the code behind must be effectively empty; the tool is there to be used, and by mixing strict presentation logic into VMs you spoil the point of the entire architecture. For your own sanity I cannot advocate that approach enough.
Nathan Minier 13-Jul-18 7:29am View
Problem one is that Socket newConnection = s.Accept(); is outside your loop, so there's no iteration there. That's why it only connects once.

There are some good C# socket examples in the .NET documentation, for example:
Nathan Minier 8-Jun-18 7:07am View
You didn't mention that it's an Access database, so it might behave differently. That string should be fine if it works like every other SQL implementation.
Nathan Minier 7-Jun-18 13:41pm View
Allright, then you need to troubleshoot your SQL and do a step-through on your code. The most likely scenario for no exception/no update is that the "WHERE" clause of the statement is not finding anything, but it you're certain that ID is being passed correctly and that ID exists in the database, I'm not sure what else it would be based on your code sample.
Nathan Minier 7-Jun-18 13:18pm View
Okay, does the account that is running the app have update rights?
Nathan Minier 7-Jun-18 12:34pm View
Make sure that the ID parameter is being passed correctly, and properly reflects the ID type in the database.
Nathan Minier 7-Jun-18 12:06pm View
Okay, are you getting an error at this juncture?
Nathan Minier 6-Jun-18 9:23am View
ASP is short for Active Server Pages, and is a generic descriptor for all things web application in .NET. If you're making native apps then you can safely ignore it.

The real confusion right now is that there is .NET Core (universal), .NET Framework (Windows only), and .NET Standard, which is a standards-based convention that is supposed to cover both (implementations will vary between Core and Framework, but the APIs should be the same thanks to Standard. Nightmarish, I know).

I've never worked with Xamarin, but a quick search turned up this:

Plus the Xamarin site has a number of different posts about implementing Xamarin projects against .NET Standard.
Nathan Minier 6-Jun-18 7:50am View
So, the .NET landscape has changed a bit. Modern iterations no longer need to lean on Mono thanks to .NET Core, which utilizes a "new" architecture known as Universal Windows Platform (UWP) in place of WPF for native apps. It still uses XAML, but is a little different and, despite the name, is not only targeted at Windows (it will run a Linux GUI).

Have a look at .NET Core C# with UWP.
Nathan Minier 4-Jun-18 14:34pm View
jQuery is a JavaScript library...ergo no translation is required. It all takes place in a JS runtime.
Nathan Minier 4-Jun-18 7:26am View
You're talking about 2 different things. Are you designing a web interface for a device or are you trying to intercept and redirect pre-existing traffic (the access point agreements that you're referencing)? Or both, such as for a network filtering appliance?
Nathan Minier 29-May-18 8:57am View
There are potentially a million separate pitfalls that could be affecting your service, many of them at the Ops/SA level.

Do you currently use PKI for authentication in your Enterprise environment? If so, is it configured to authenticate only using certs, or do you have a PW option?

Do you have a workflow at the enterprise level to generate and distribute certificate pairs? Did the cert you're trying to use come from those channels, or is it part of a test rig?
Nathan Minier 29-May-18 8:44am View
So...a standalone Angular app will rely on querying existing data sources or utilize assets available to it as part of the browser that it's executing in (it is just JavaScript). The .NET Core or ASP.NET solution will provide active server components that your app can communicate with. that's it.
Nathan Minier 10-May-18 11:41am View
That's a regex, which is great and all, but will not manage key press events on it's own. You need to supply your event handling logic before anyone will be able to assist.
Nathan Minier 10-May-18 7:25am View
It's not JSON by the time it hits your foreach loop, it's a Dictionary<string,string>. From there it's not a question of filtering JSON (which is really just a formatted string), it's a question of whether you want to filter keys or values, and establishing a mechanism to ensure uniqueness.
Nathan Minier 9-Apr-18 7:36am View
The code for CreateCustomer.customerList would be more useful for troubleshooting than this snippet.
Nathan Minier 5-Feb-18 12:46pm View
That AV might be doing that if it's not a rights problem, sure. It's not a firewall issue.
Nathan Minier 7-Dec-17 9:02am View
This is not really an appropriate usage of Entity Framework, since you can perform this comparison entirely in SQL. There are a few SQL-only solutions at:
Nathan Minier 30-Nov-17 7:29am View
Follow up to Richard's question: Is this running on a different thread?
Nathan Minier 25-Oct-17 7:20am View
I did some more reading (I should know better than to trust anything other than source docs by now) and the formulation you're using will indeed only affect maxlength, but that leaves us with the minlength problem; you don't want "" or string.Empty to be valid values.
Nathan Minier 2-Oct-17 7:30am View
Neither. It looks like the C^2 is being run through the header using some sort of custom schema.

Your best bet is to contact the API provider to validate their schema and make sure to coordinate with them to determine what they define as appropriate in terms of accessing their data. They may even have some binaries available to parse out their stuff.
Nathan Minier 29-Sep-17 7:50am View
I live in an MS world, so we just use AD and Kerberos. If you have a backend infrastructure, LDAP is a well-supported and inter-operable mechanism for managing AAA actions that supports SSO.
Nathan Minier 29-Sep-17 7:47am View
It's an SMS response message, serialized in XML, wrapped in an HTTP POST request.

What is it that you're asking, exactly? There are millions of examples on the interwebs about how to work with HTTP, and millions more about XML.
Nathan Minier 21-Sep-17 9:43am View
It's not terribly clear where your process is breaking down. Please add more context, such as what you're trying to do and why it's not working.
Nathan Minier 7-Aug-17 8:27am View
Try to break up your line so that you can evaluate it effectively.

Also, unless you're using a collection intializer (you're not) the syntax you have for { DriveService.Scope.Drive } is wrong.
Nathan Minier 4-Aug-17 7:09am View
Obviously either the framework or platform that you're leveraging is. It might be as simple as changing a configuration.

Also, pretty much anything that isn't a single-purpose function is "multi-layer", so you'll need to be more specific.
Nathan Minier 8-Mar-17 8:03am View
This looks like you're trying to do client-side validation with rules from the Model class, not server-side validation, is that right?
Nathan Minier 3-Mar-17 7:19am View
this.saveInterventionExpenseDetails = function (File) {
var formData = new FormData(); //should be available in an html5 compliant context
formData.append('file0', File,;

return serviceHandler.postService(domain + "/EnterData/SaveInterventionExpenseDetails", formData);
Nathan Minier 3-Mar-17 6:58am View
That doesn't matter. If you're not wrapping it in FormData before you post it, HttpPostedFileBase won't be available.
Nathan Minier 3-Mar-17 6:57am View
That's an object, not an array. while you can do a (key,value) enumeration on it with ng-repeat, with the format you have, you might want to try enumerating auditTemplate instead.
Nathan Minier 2-Mar-17 9:50am View
Do you have a data sample for auditTemplate.AuditTemplateQuestion at runtime?
Nathan Minier 2-Mar-17 9:42am View
Are you wrapping your files in a JavaScript FormData object before sending them?
Nathan Minier 23-Feb-17 7:19am View
You're being slammed by the page cache by mixing views with AJAX. Pick one and update appropriately after transactions.
Nathan Minier 22-Feb-17 7:08am View
You should likely look at the validation logic if it's struggling with a numeric type in JS, which is very forgiving on numeric types.

If the validation is on the server-side, cast to float or double. The key thing to remember with JS is: how it's displayed is not necessarily exactly how it's stored. Browsers tend to do a whole bunch of parsing, even in the dev tools.
Nathan Minier 21-Feb-17 7:42am View
Just to clarify, you want this to return an int if there is no decimal portion, and a float if there is?
Nathan Minier 16-Feb-17 10:28am View
Hence the word "infer", based on observation. But whatever, have fun.
Nathan Minier 16-Feb-17 9:06am View
...If I write a class that is meant to function as a singleton, I make sure the methods (and getters/setters) are thread safe so that downstream users can expect consistent operations.

If I write a static class, I don't do this.

This is a fairly common pattern among framework developers, from my experience, hence the addendum I suggested in the first place. If you don't agree, that's fine, but seriously.
Nathan Minier 16-Feb-17 8:27am View
Not construction, methods.
Nathan Minier 16-Feb-17 8:21am View
That's fair, and we can agree to disagree.

If I label anything a singleton, though, I'm going to enforce thread safety on it so downstream developers don't get a nasty surprise. A static item, though? Pure wild west.
Nathan Minier 16-Feb-17 7:38am View
It might also be worth noting that Singletons infer (though do not guarantee) a certain degree of thread safety, while static classes do not.
Nathan Minier 16-Feb-17 7:28am View
In my experience, books with "Mastering" or "Professional" tend to be on par with the books titled "Beginning". These tend to be good for foundationals, and aggregate information in such a way that you can perform your own detailed research on your own, but do not leave you either a "Professional" or "Master".

The "In Action", "Step by Step", and "Cookbook" titles generally focus more on patterns and practices, and can be very useful as long as you understand that they generally reflect ONE solution to a problem domain. They are an answer, not necessarily the right answer.

Also, books that cover both C# and VB tend to do neither terribly well.

You'd be better served looking at the offerings from publishers rather than just throwing out titles. I've used SAMS for years when it comes to language familiarization because they tend to be comprehensive, but generally shallow.

O'Reily books are great, but figuring out the right one for your skill level can be difficult.

Manning are great for boilerplate walkthroughs, and if you learn that way they can be a good tool.
Nathan Minier 7-Feb-17 8:45am View
You're not going to be able to do this with stock JS. You'll need to either build a browser extension or require Node to make this work without user interaction. Or talk to the stakeholders about changing that requirement, as non-interactive file operations from an unsecured source are a giant red flag from a security standpoint.
Nathan Minier 6-Feb-17 15:20pm View
Where are you getting hung up?

Do you have the object that you're pushing down the pipe?

Are you populating columns based on object properties?

Are you having trouble with mapping properties to columns?
Nathan Minier 2-Feb-17 10:08am View
Tell ya what, I just edited the sample to make it less sensible from a validation standpoint. Enjoy.
Nathan Minier 2-Feb-17 7:51am View
In this case I'm going with a maybe.You'll notice each parseint function is being applied to the same substring as well. There's basically nothing right.
Nathan Minier 2-Feb-17 7:43am View did notice that you're parsing the same thing (toDtae) which isn't event one of the variables that you passed to the function, and that your operator choice ignores the equals case, right?
Nathan Minier 1-Feb-17 7:47am View
That's a solid answer, the only notable addition I'd suggest is adding a link that gives some context for RBAC and post this as an answer.
Nathan Minier 1-Feb-17 7:45am View
You're not actually getting any data to populate a table. All you have here is a delete method.
Nathan Minier 30-Jan-17 12:47pm View
Your pipeline looks right. I'm afraid all I can suggest at this point is making sure that IIS Express is doing the right things. Sorry I can't be of more help to you.
Nathan Minier 30-Jan-17 9:09am View
That looks right.

You have a /Views/Status/StatusList.cshtml file in the project? Is it setup to take your Model type?
Nathan Minier 30-Jan-17 8:23am View
The routeconfig is only partially useful. What about the code for your StatusController?
Nathan Minier 24-Jan-17 8:04am View
Why would you not just do this:
<input type="file" ng-model="files" multiple />
Nathan Minier 23-Jan-17 7:40am View
Generally when you run enable-migrations, VS will create a Migrations folder with an initial migration and a Configuration.cs file. The class defined in that Configuration.cs file has an error, if you post it here we will most likely be able to assist better.
Nathan Minier 21-Jan-17 10:02am View
Obfuscating a date input validator...that somehow doesn't seem like a useful expenditure of time.

You do realize that you basically get the same benefit from running it through a minifier, right?

if (status == true) {
return true;
else {
return false;

You're using 6 lines to say:
return status;
(and not obfuscating it)
Nathan Minier 19-Jan-17 7:50am View
If you're properly replacing the innerHTML this should happen on it's own. An HTML element doesn't have a memory of previous contents, and unless you're absolutely setting your elements the flow should be re-rendered when the content is changed.
Nathan Minier 19-Jan-17 7:46am View
Erm, you send it over SSL unless you feel like you have the time and talent to rewrite the secure communications stack.
Nathan Minier 10-Jan-17 7:48am View
Not in an automagic manner, but you could enumerate through obj.GetType().GetMethods().Select(x => x.GetParameters) to map through a switch.

The problem is that it's a runtime determination, so the compiler can't do a "best-guess".
Nathan Minier 10-Jan-17 7:26am View
So you need to bind your rows to an array, not to an object.

Your helper functions also aren't helping, since they're aggregating fields without any relation to each other. Then they're getting iterated. Whey?

I think you'll have an easier time of it if you databind from your JS to your HTML, not vice-versa.
Nathan Minier 10-Jan-17 7:11am View
Okay, when you're developing a REGEX you need to determine the unique characteristics of the substring that you're trying to isolate. In this case, is it always at the end of a line? Is it always just those 3 capture patterns? Could you do a capture group and run it through a switch? These are important considerations.
Nathan Minier 6-Jan-17 13:50pm View
Just paste the HTML block with the interactive element and the backing controller, we should be able to sort it out from those.

Without code, we can't help you.
Nathan Minier 5-Jan-17 7:16am View
Have you bundled a MySQL ODBC driver into your installer?
Nathan Minier 4-Jan-17 9:27am View
This generally happens when the database connection fails.

This is more something to handle than to resolve.
Nathan Minier 9-Dec-16 10:42am View
Constructor injection would work.

public MyClassWith100Props(MyMappingClass map){ ... //assign }
Nathan Minier 9-Dec-16 10:40am View
If I even remotely understand:
Declare immutable properties and methods as private OR declare the class as sealed.
Nathan Minier 2-Dec-16 8:20am View
Have you tried sending it in batches?
Nathan Minier 2-Dec-16 8:19am View
No, this is exactly what a modern airline would do to book seats. >.>
Nathan Minier 29-Nov-16 7:21am View
Is the appended field being assigned the "Total" class?
Nathan Minier 16-Nov-16 10:42am View
It is, thanks to AntiForgery.GetHtml().

In the individual Page_Load you should just be able to
if(IsPostBack){AntiForgery.Validate();}, providing you set the token on that page.

I haven't cracked the source open, but from what I understand the token is hashed from the path, so if you have pages that don't lean on the Master page you'll need to assign it per-page.

IMO your best bet is to make a master that simply carries the anti-validation, though, and build templates out from there.

Have a look at the MSDN notes for the class:

Nathan Minier 16-Nov-16 7:57am View
Have a look at the solution presented by manu_dhobale. It looks appropriate to your situation.
Nathan Minier 16-Nov-16 7:40am View
If you're using System.Web, why aren't you using the built in AntiForgeryToken?
Nathan Minier 16-Nov-16 7:37am View
Explain your limitations (.NET 1.0 is decrepit), provide more context, what you've tried, and someone might be able to help you.

No one here is going to email you about a question, but including your email in help or forum postings is a great way for spambots to pick up your address. I would suggest removing that part.
Nathan Minier 16-Nov-16 7:34am View
You're asking two completely different things.

Are you trying to store an image in the database (i.e. as a VARBINARY) or are you trying to store a file path in the database(i.e. VARCHAR). Your example indicates the latter, but your question infers the former.
Nathan Minier 9-Nov-16 15:26pm View you have a global form1 or do you mean document.getElementById('form1') ?
Nathan Minier 26-Oct-16 7:46am View
Allright, updated. I sort of assumed you or your framework was already converting the tt variable from the datepicker. My bad.
Nathan Minier 21-Oct-16 14:13pm View
I'll go ahead and put the dunce cap on and sit in the corner.
Nathan Minier 21-Oct-16 13:51pm View
That would be because you're using FirstOrDefault. (TOP(1))

If you use SingleOrDefault (TOP(2)), the database will look for a second value, which it won't find due to the unique constraint on a PK, and will therefore search the whole table.
Nathan Minier 21-Oct-16 13:34pm View
I can accept that I was a little general with that.

In the case being discussed, though, the query will enumerate the whole table, as the target is a PK, as it would be for any unique index.
Nathan Minier 20-Oct-16 9:37am View
Really looking at it, I'm only seeing some minor syntactic issues; there are a couple of trailing commas that are throwing NULL elements into the mix. I'd get rid of the "data" parameter on the YES function. I'd declare the function as a data member, as it looks to be an object method rather than a flat function.
i.e. "deleteDrugMapping": function(supplierDrugId, SupplierId, SupplierName){

Lastly, if the $.ajax is never being entered I'd have a look and see if you have a global dialogclose event binding that may be getting into the mix.
Nathan Minier 20-Oct-16 8:37am View
Without knowing the CreateTable() function this isn't terribly meaningful, especially if there's something recursive in there.
Nathan Minier 20-Oct-16 7:57am View
So JSON has 2 types: Object and Array.

Objects contain properties (which can be Arrays).
Arrays contain Objects, but not properties.

You're trying to de-serialize an Object as if it were an Array, which it can't do.

At a guess, looking at the little code you did provide, either the property serviceAgreementAdditions or serviceOccasions has been serialized as an object. Look at the raw JSON, it should be fairly obvious.
Nathan Minier 14-Oct-16 8:06am View
Your barcode scanner driver may have a hook as an ODBC data source.

If it does, you can use that to hook pretty much any data service that you want.
Nathan Minier 22-Sep-16 7:50am View
If you're accessing those sites from .NET code, you are building and sending HTTP packets (presumably using System.Net.Http.HttpClient). That means that you can build the headers at run time.

That means that your system can assign the Session-Id for the second runtime.

Again, I don't understand the issue.
Nathan Minier 22-Sep-16 7:27am View
Sure, but you'd need a parser of some sort. You'd likely be best off rendering as PDF and sending it down the pipe that way.
Nathan Minier 21-Sep-16 7:50am View
Sooo...pass the session Id as part of the link.

What's the issue?
Nathan Minier 21-Sep-16 7:46am View
VS will actually automatically parse this into a SOAP reader class for you, as long as the service provides a wsdl.

Right-click "References" and select "Add service reference..." to get started.
Nathan Minier 19-Sep-16 8:58am View
"Instead it has customized structure and data."
Without knowing anything about your structure, it's pretty much impossible to give any advice on how to accomplish this.
Nathan Minier 19-Sep-16 8:25am View
What are you using on the backend. Is it looking for a form, or is it looking for JSON? If you can send this as JSON it would simplify the code considerably.
Also, have you inspected the traffic to make sure that the data is being passed in the POST body properly or is it JSON serialized?
Nathan Minier 15-Sep-16 7:22am View
window.resetGrid = function(objectContainingGrid){
objectContainingGrid.Rows = [];

This would work on some grid implementations, and not most. Context is king!
Nathan Minier 12-Sep-16 7:38am View
You're using the OLE Provider, it's gonna take longer since it has to go through those ADO transforms before being written to Excel format.

There are 2 ways you can speed this up: Use the DocumentFormat.OpenXML namespace or build a .csv to order. Both would be significantly different than what you have now.
Nathan Minier 9-Sep-16 12:51pm View
You might be best served by looking at the source of those who already do it best:;a=tree
Nathan Minier 2-Sep-16 9:57am View
You just need to return a meaningful response from the service endpoint that can be logged locally. There's no other sane way to do that.
Nathan Minier 31-Aug-16 8:20am View
You could add a hidden element that has the current tabid on it, add that tabid to the POST body, write that field to the post-back page in PHP, and migrate your tabbing to a function that can be called when the page loads.

Or you could use AJAX.
Nathan Minier 31-Aug-16 8:14am View
What JS framework are you using? Also, we need to see some code in order to understand what's going on, specifically the Razor and ideally whatever you're using for pagination on the client side.
Nathan Minier 30-Aug-16 7:35am View
It's actually a thing.

It's an offshoot of of behavior characteristics which are technically classified as biometrics, along with others like voice recognition and signature analysis (which tracks how you write your signature, not how it looks).
Nathan Minier 30-Aug-16 7:30am View
We won't be able to help much without knowing any details about the "Customer-auto-complete" directive.
Nathan Minier 18-Aug-16 8:17am View
I can't back VBA as an application platform. Just enabling it on a system is a huge security vulnerability, and the time spent making it robust enough to handle edge cases without falling to pieces would be better spent with another technology IMO.
Nathan Minier 15-Aug-16 11:51am View
Create 2 applications.
One for the scanners. If there's an API provided by the vendor, you might be able to skip this, but that's entirely based on the nature and character of the equipment. This application would communicate with a server-side back end which would perform CRUD operations. You can target .NET Core with either C# or C++. I would suggest C# as the learning curve will be much more gradual. Your other option, if you're settled on Android, is Java.

The server side application should provide HTTP services to accept input from the scanners and provide formatted output in the form of a web application. I wouldn't bother making a native app for desktops that calls for CRUD operations on a database, there's far too many tools available to do this as a web app. This one seems like a no-brainer as a C# application, if you're already settled on that stack.
Nathan Minier 15-Aug-16 9:05am View
1. It's not finding the database. Is your Data Source correct?
2. Your account does not have dbcreator permissions set. Use an account that does.
Nathan Minier 15-Aug-16 9:02am View
So, my appropriate "Quick Answer" is:
Hire a software developer. You're so far in the weeds right now that you will not have a viable product in your time frame without a professional.
Nathan Minier 15-Aug-16 8:37am View
Well, that all largely depends on what you're using for your map (framework or technology), if you're using a GIS server, and how everything is tracked. You haven't provided enough information to answer you in a sensible manner.
Nathan Minier 12-Aug-16 7:48am View
So....are you passing a real connection string to the constructor?

Also, please dispose of things properly!

Have a look at:
Nathan Minier 10-Aug-16 9:50am View
That's not code, that's a school assignment. I don't think you'll find anyone here willing to do it for you.

That said, if you start working on an approach and require help with specific implementation, that's the time to ask questions.
Nathan Minier 10-Aug-16 9:46am View
Without seeing the asynchronous call method, there's not much we can do to help.
Nathan Minier 3-Aug-16 7:32am View
And we're sure that the time is correct on the server?
Nathan Minier 3-Aug-16 7:30am View
Yeah, you're trying to mine DNS data out of an HTTP packet, that's not going to work.

You're going to need to make a DNS request for each packet (unless you have sessions implemented, but that would sort of defeat the purpose of WebAPI).

I guess you could add a database table that maps IPs to URLs and update it periodically. Whatever floats your boat.

Have a look at Dns.GetHostEntry():
Nathan Minier 2-Aug-16 9:10am View
If you're just starting out in C#, I can only suggest that you avoid Web Forms like the plague. They're obtuse, un-intuitive, and the framework is not made for modern web development.

There's also a lot of contention about whether they will continue to be supported in .NET moving forward; I've seen claims either way. The current MS RAD deployment tool is MVC.NET. I would heartily suggest looking more in that direction.
Nathan Minier 14-Jul-16 14:09pm View
It's worth noting that you have a typo.
<deny users"?" /> should be
<deny users="?" />
Nathan Minier 23-Jun-16 6:59am View
The solution below is about your best bet, then.
Nathan Minier 22-Jun-16 7:36am View're modifying the firmware of your router?

Or are using a system that can process C# as a router...?

Or are trying to write an application to execute on a local machine to get these details...?

Because this looks like code that will enumerate active TCP ports from a very small port range on your local computer, with an extraneous loop thrown in for flavor.
Nathan Minier 17-Jun-16 8:28am View
Are you making sure that the directory in question exists before you try copying files into it?
Nathan Minier 17-Jun-16 8:27am View
It would probably help if the array wasn't being defined as a string.

And if the CompanyID were valid data.
Nathan Minier 23-May-16 7:55am View
You could always serve the files from a controller action instead of as static files.

Alternatively you could define a viewmodel that has a "string Script" property and directly instantiate it where appropriate.

Or you could be aboring and just limit access, as Afzaal suggested. Where's the fun in that, though?
Nathan Minier 10-May-16 6:57am View
Windows authentication uses Active Directory just like native logins.
Nathan Minier 9-May-16 9:17am View
Setup a service account with specific read rights in your directory, and assign the app pool to operate under that account. Make sure that account has access to the folder where your application lives.

Right now you're just impersonating either Networkservice or your AppPoolIdentity, which will not have any domain rights. If you run under a service account context you will not need to impersonate anything.
Nathan Minier 18-Apr-16 9:24am View
If you don't want to add sheets, your only route is sending it as a zip. HTTP is not designed to push multiple files as a download.
Nathan Minier 14-Apr-16 8:57am View
I updated my answer. This should work in the context that you're using.
Nathan Minier 14-Apr-16 8:27am View
Here's an SO thread about how you can assemble a zip without writing to disk.
Nathan Minier 14-Apr-16 8:22am View
Then you'll need to zip them and add the zip to the Response, you can't just add a bunch of files to the response stream.
Nathan Minier 14-Apr-16 8:12am View
Providing that you have options in there and one has the exact text of "MCA", that's not an issue.

And I need more coffee, I have the wrong ddl Id in there.
var selectedText = $('#ddlCourse').find(":selected").text();
Nathan Minier 14-Apr-16 7:46am View
Yeah, my bad.

You're working with JavaScript, which is in a browser context (which has no inkling of what ListItems are, that's not going to be in the markup). Modify:

var selectedText = $(this).find("ListItem:selected").text();
var selectedText = $('#ddlExam').find(":selected").text();

and it should work. I generally try to avoid "this" in event handlers, since it's fairly complicated to determine what "this" is going to be as it bubbles.

I'm assuming that you have an option in the list that is just "MCA", by the way.
Nathan Minier 6-Apr-16 11:37am View
It probably doesn't help that variable ss is always being passed to your database query as a null as part of an AND conditional.

I think what you're looking for is:
public void check(string ss)

and take that object ss = null out.

Other notes:
You're not disposing (or closing) your database connection. Wrap your SQLConnection in using().
You have a connection string hard-coded into the source. Don't do that. Use a configuration.
Nathan Minier 3-Apr-16 9:40am View
Can you post the App_Code.FileIOHelper.ReadFromDefaultFile method? That's likely to be your culprit.
Nathan Minier 1-Apr-16 9:55am View
It would also help to see how you have the [tblVideo].[Data] column defined.
Nathan Minier 30-Mar-16 7:25am View
Well, if that leading period is in your actual code then yes, that's a pretty obvious problem.

Have you tried something like:
var webKitBrowser1 = new WebKit.WebKitBrowser();
Nathan Minier 25-Mar-16 7:00am View
Okay, how is it failing then?
Nathan Minier 22-Mar-16 8:33am View
JSON.Net, which I assume is being leveraged by HttpClient.PostAsJsonAsync, does not play nicely with interfaces.

I would suggest making an object with concrete properties for the data transfer and cast to it for your data transfer; like a viewmodel, but for the API.
Nathan Minier 7-Mar-16 7:14am View
Embedding HTML into JavaScript string literals makes actual upkeep very, very difficult. As a person who regularly performs maintenance on other people's code I beg you: use a separate HTML file as a template, preferably tucked into a folder named something like "Templates", and ideally with a sensible file name, like "FileManager.html".
Nathan Minier 26-Feb-16 8:09am View
You may need to kill the process in the task manager.
Nathan Minier 23-Feb-16 9:23am View
That's the point.

DWT is largely based on bit shifts, and you're working with LSB. To recover the code, you'd need to 1) Reverse the transform and 2) Use a transform that doesn't truncate the LSB
Nathan Minier 23-Feb-16 8:02am View

Google. All the kids are doing it.
Nathan Minier 22-Feb-16 9:25am View
Unfortunately, production and virtualization is often a game of "spot-the-difference", which is the only reason I mention it.

It's possible that the VDI does have issues with some .NET functionality. Most virtualization solutions have varying IO strategies (depending on CPU virtualization or available providers), which could negatively impact any stream processing that you're doing. It might be worthwhile reviewing the VDI documentation for any information on that.

Less likely is that it has an issue with threading, but it's not impossible.
Nathan Minier 22-Feb-16 9:05am View
Does the VDI image have the appropriate .NET and dependencies?
Nathan Minier 12-Feb-16 8:03am View
Where you have:
<script src="../js/jquery.dd.js" type="text/javascript"></script>
<script src="../js/jquery.dd.min.js" type="text/javascript"></script>
<script src="../js/jquery-1.6.1.min.js" type="text/javascript"></script>

Should read:
<script src="../js/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="../js/jquery.dd.js" type="text/javascript"></script>
<script src="../js/jquery.dd.min.js" type="text/javascript"></script>
Nathan Minier 12-Feb-16 7:42am View
Out of curiosity, why haven't you gone with something simpler, like:

Javascript will evaluate 0, undefined, false, or null as false, and any other value as true.
Nathan Minier 12-Feb-16 7:37am View
Your first script tag should be :
<script src="../js/jquery-1.6.1.min.js" type="text/javascript"></script>
Nathan Minier 12-Feb-16 7:35am View
Just get the wsdl.

Or to make life super easy, in Visual studio right-click on references, select "Add Service Reference", and put in the service address and you can automatically generate data access objects for that service.
Nathan Minier 11-Feb-16 10:27am View

You're not going to be able to gracefully bind to that. The people who run the server would need to do use an SSL cert that specifies the base address of the site. You can't work around that as a client.
Nathan Minier 29-Jan-16 12:00pm View
I haven't used it in a bit, but I'm pretty sure that jQuery .ajax() parses the JSON automatically when you set it as the dataType.
Nathan Minier 29-Jan-16 7:41am View
If you're going the SQL route, it genuinely shouldn't matter. Just make sure you expose the capability to change the connection string, and if you're worried about customers not having an onsite database you can include SQL Express or Compact as part of an installer.
Nathan Minier 29-Jan-16 7:11am View
Your question is too vague and makes little sense as is.

Are you using the css for a web front-end, or a native windows store app? What platform or framework are you using?

What are you trying to do with it? What have you tried? Where are you stumbling?
Nathan Minier 28-Jan-16 8:51am View
In that case, you can create a custom css class to handle the spacing div based on the col-md classes but with a different width percentage.

For instance:
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
float: left;
width: 10%; /* Tweak this as needed */

Bear in mind, your screen is just your screen, and it will look different on user computers, tablets, and phones. The entire point of the Bootstrap grid system is to lend some consistency to design and layout, regardless of screen differences. Using a custom layout class like this breaks that.
Nathan Minier 28-Jan-16 7:29am View
You could author a browser plugin that communicates to your site to do this, or a windows service that does the same. If your scanners are networked in an enterprise environment, you can query them directly using drivers on the Server, but you would need the user to identify the appropriate device. You could map it based on credentials or subnet, I suppose.

There is no way to do this just using .NET MVC, though, as F-ES explained.
Nathan Minier 14-Jan-16 7:42am View
Use the "Improve Question" link and add in the Razor which has your dropdown and the action that populates it. We can start from there.
Nathan Minier 13-Jan-16 7:05am View
Okay, you need to add a handler for when you make changes to your data, so that you can track the details. You need to inject (add something external into internalized code) a handler for those changes, either by using an event-driven approach or by literally placing it between your I/O (your http hander for web applications) and you data persistence logic (ORM, SQLConnection, file serializer, whatever). This additional object can handle the logging of the details of the transaction.

I'm sorry, I can't provide any code. I don't know your implementation strategy, your data access strategy, or a blessed thing about your application.
Nathan Minier 10-Jan-16 13:09pm View
That looks a bit malformed.

You're trying to pull from a query string, and you don't have a query string. Plus the routing switch after the .asmx is an error, unless you have a local JavaScript route handler.
Nathan Minier 8-Jan-16 7:52am View
If you're running this on a server that you have full control of, you'll most likely want to build a service that controls the state of the web server that handles, taking it offline if IIS or stopping the service if you use a service-based web server (like HTTPListener for OWIN).

If it's done via a hosting provider, and you don't have full control of the web server, you'll need to ask the IPP for specific information about how their API allows for control of domain state.
Nathan Minier 8-Jan-16 7:39am View
We need to see the update action on the controller at a minimum to help you with this issue.
Nathan Minier 7-Jan-16 7:41am View
I'm sorry, your question isn't clear. You need to clarify what you mean by "custom domain property", since I'm guessing it's a vendor specific element.
Nathan Minier 7-Jan-16 7:34am View
And what seems to be the problem?
Nathan Minier 7-Jan-16 7:34am View
It depends entirely on how your table is mapped. You can either add a child to an existing row, or add an existing row as a parent to a new one. Without knowing your mapping mechanism, there's not much that anyone will be able to tell you.
Nathan Minier 6-Jan-16 9:50am View
He's trying to send down a GridView directly as an Excel file, you can tell from the header bootstrapping. Brought a tear to my eye.
Nathan Minier 6-Jan-16 9:44am View
Most of the databases that you're looking for with this functionality built-in will be pay-to-play, enterprise solutions. SQL Server does all of that standard, and MongoDB Enterprise can be configured for it as well.

An alternative is to perform encryption in the application and only store encrypted results. This will add a little overhead and remove some functionality (LIKE or other comparators will not work on the database level, but can on the application level), but has the benefit of being usable with any database.

Implementation will be entirely contingent on the method and product that you intend to use.
Nathan Minier 6-Jan-16 7:58am View
You're talking about a full-on intercommunication application with multiple network-distributed parts.

That's a little outside the scope of a quick answer, but if you're just looking for a starting point then a fair primer can be found here at:

You'll also need to brush up on on good parallel/async methods for the server head, and probably will want to implement a data cache as well.

You will need to install a service to the clients to make sure messages are properly received.
Nathan Minier 6-Jan-16 7:52am View
By injecting a logging mechanism into the Business layer.

I like logging for SQL with JSON. You can collapse most objects with it into a string and recover them later, if needed.
Nathan Minier 6-Jan-16 7:50am View
A GridView is an html construction, not an OpenXML one. You need to parse the dataset into an OpenXML table and send the binary down.
Nathan Minier 5-Jan-16 8:40am View
Thanks Bill, I just had a feeling that there was a likely rabbit hole here and I couldn't afford to "buy" the issue today :)
Nathan Minier 5-Jan-16 8:39am View
Ah, that explains a lot. The purpose of DataBase first is really for when you have a data back-end that you can't go about changing, such as when migrating a legacy application. I wouldn't advise using it as a primary development strategy when working with EF, but that's the stance of a guy that looks at a database as an abstract where he keeps his stuff :)

I'm afraid that I won't be able to help you from the .edmx side of the house; I'm not the best equipped for that work. If you start looking at POCO I can give much better support.
Nathan Minier 5-Jan-16 8:06am View
Seems to me that your data is not being passed properly. Assuming that you're fetching it from a network resource, are you passing the data or a promise? Are you using any frameworks?
Nathan Minier 5-Jan-16 8:01am View
This isn't necessarily pertinent, but I'd advise trying OpenXML instead, since the Interop library requires an Office installation on the executing computer while OpenXML just needs .NET.

There's a tutorial at:
Nathan Minier 5-Jan-16 7:57am View
Check the event viewer and give an indication of the error.

I'd suggest using Fody.Costura to embed your DLLs directly into your executables.
Nathan Minier 5-Jan-16 7:53am View
Have a look at:

The different inheritance approaches are well-described in this blog series.

Now what you're doing with the UserType field is problematic, as EF will automatically try to do some relational mapping for derived types. I'm not sure why it would conflict with the mechanism that you've tried to put in place, but then we haven't seen that code.

The best route that I've found is to use the TPT model (fluent map a derived class ToTable() or attribute [Table()]) and let EF handle the wiring of the relationship under the hood.
Nathan Minier 4-Jan-16 7:33am View
I think that:
protected override void Seed(ServerContext context)

Should be:
protected override void Seed(DbContext context)
Nathan Minier 31-Dec-15 8:11am View
Have you tried setting up the DbSet of interest as an ObjectDataSource?
Nathan Minier 31-Dec-15 7:51am View
Also, does this happen in all browsers, or just IE?
Nathan Minier 29-Dec-15 9:52am View
Sure, but it'll kick the previous application off of that port.
Nathan Minier 29-Dec-15 7:51am View
Without any context (such as the work you've already done) there's not terribly much anyone can do to help.

I can only suggest that you look at using OpenXML to parse it, and insert the parsed data as appropriate.
Nathan Minier 29-Dec-15 7:40am View
If your web forms are appropriately disassociated from the business logic, you _could_ wrap your code-behind in controllers and aggregate your data-sources into a ViewModel to send down to a Razor view. I think it's a terrible idea, and will be very hard to maintain, but it could be done.

You would be much better served by using the baked in entity Framework to handle your DAL, the BOs can be migrated to leverage it with relative ease, and push your BLL functionality into controllers and ViewModels. It will honestly be much easier in the long run.
Nathan Minier 29-Dec-15 7:26am View
Smells like homework.

Please have a look at the handy foreach() flow construct and recursive function concepts.
Nathan Minier 29-Dec-15 7:18am View
Ah. You need an iframe then, and the viewing browser needs to have some sort of xls/xlsx plugin installed and running.

PDF plugins are way more common, if you don't have any operational control over the user environment then there's no way to consistently do this with xls. You could add a link to a plugin with the suggestion I suppose.

I'd still stick with PDF for a generated report.
Nathan Minier 28-Dec-15 9:48am View
Is the File() ActionResult not working?
Nathan Minier 28-Dec-15 9:41am View
This article targets an older VS version, but appears to address the issue that you're having: