Click here to Skip to main content
14,923,376 members

Comments by DerekT-P (Top 99 by date)

DerekT-P 27-May-21 15:36pm View
   
I think the OP means that he has the keys in text file format; not the encrypted message.

But if you have the other party's public key, you need THEIR private key to decrypt it. Which, by definition, you don't have - it's private (to them). If they are sending you an encrypted message, they have encrypted it using YOUR public key (which, being public, you can share with them in advance). Then you use your private key to decrypt it. Sounds like you have THEIR public key and YOUR private key - so you don't have both parts of any public/private key combo, so can't decrypt.
DerekT-P 15-May-21 17:00pm View
   
I think your question is how to structure the SQL given that your inserted values are primarily coming from another table..? When you use the "INSERT INTO [table] ([targetcolumns]) SELECT [sourcecolumns] FROM TABLE ..." form, there is a one-to-one mapping between the columns you're inserting, and the results of the SELECT statement. You're inserting 5 columns, so you need your SELECT to return 5 columns. You correctly have the first 3 of these from the source table, and you can then add your values as the next two columns. So the SELECT becomes something like SELECT Book_ID, Book_Name, Quantity, '" + loginscreen.username + "', GETDATE() Obviously do NOT concatentate your SQL like this, use a stored procedure with parameters. Here I'm using the Sql server current date/time via GETDATE but of course if you have a separate app server you can use the date/time from that by passing it in as a parameter, just like the username. Hope this helps. :-)
DerekT-P 7-May-21 4:15am View
   
Doesn't really explain why it has to be an ASP control... but hey ho, if that's the way you feel you need to go...
You say you don't know how to work with asp:repeater - then it may be worth you looking at the documentation for that and at some examples.
DerekT-P 4-May-21 12:36pm View
   
I get that, but why does it have to be an ASP control? Why not just generate the html tag?
DerekT-P 3-May-21 15:29pm View
   
If all you're generating is a link, why do you need to use an ASP control? Just generate the tag in your code and write it out (either by populating the ASP:Literal text content) or just use the <%= ... %> shorthand tag.
DerekT-P 3-May-21 14:28pm View
   
Notwithstanding the strong advice "don't do it", the above is absolutely the wrong way to do it - it becomes a maintenance nightmare, with functionality and layout duplicated just for the sake of one page. When I need specific functionality (or not) on a page, I give the tag a unique ID and check that ID in the Javascript. One line of code but I'll let you work it if you really insist on doing it. (If there's the possibility that this functionality might ever apply to more than one page, give it a classname instead!)
DerekT-P 2-Jan-21 6:36am View
   
You say it's a remote server - but your connection string is explicitly stating the d/b is on the local machine (127.0.0.1). If you're using the MySql .Net connector, your connstring syntax is also incorrect - it should be something like connectionString="Server=remoteserveraddress;Database=sensordb;Port=3306;UID=root;PWD=123" (I suggest you setup a non-root user on the server, and use that for this application too). But as a first step, use a d/b tool like HeidiSQL or MySqlWorkbench to check you can connect successfully to your server. It's much easier that way and confirms any error is not in your code. Once you've confirmed that you've got the connection details right, you'll be able to move forward more confidently.
DerekT-P 11-Dec-20 4:32am View
   
"where am I supposed to write the code"? Well, it's entirely up to you and your design. Unless you're really going to give us the entire source for your project (which we wouldn't read anyway), why not ask us the *technical* issue you are struggling with. We don't know if you're stuck with your design, or if you don't know how to disable a button, or you don't understand the event model... hell, we don't even know if you're talking about Winforms, or ASP.Net Webforms, or ASP.Net MVC, or 1001 other things. Would you walk into your (free) doctor's consulting room and say "there's something wrong with me?" because that's about all we've got to go on here...
DerekT-P 27-Nov-20 7:43am View
   
You need to speak with your tutor, as you've illustrated no understanding of pseudocode, nor of the problem at hand. We are not here to do your assignments, and if we did, it would not help you since at your level of understanding you'd gain nothing from it. Go back and read your programming books from the very start, and seek help from your tutor. Sorry, but there wasn't really a "nice" way to say this!
DerekT-P 13-Nov-20 7:52am View
   
I use Pechkin, which is reliable and accurate (takes HTML and creates PDF) but the downside is it's a 32-bit DLL.
DerekT-P 9-Nov-20 12:56pm View
   
So what is this code doing that you don't want it to, or not doing that you do? (BTW, use guess.isNaN rather than guess == NaN ).
Hint - one problem you will face is that the browser may not repaint the "message" element because redrawing only occurs once script execution completes, and in your code it doesn't complete (exit the while loop) until the user enters the correct guess. (Waiting at the prompt for user input doesn't count as exiting script execution). Research how to resolve that problem, or restructure your code so that it's not all within a single while loop.
DerekT-P 22-Oct-20 6:12am View
   
You say "we don't use COM interop" - but that's what you need to do this simply. If for some reason you are *unable* to use COM interop, then take a look at https://www.codeproject.com/articles/15216/office-2007-bin-file-format which describes the file formats within an Office document. You should be able to access the macros that way.
DerekT-P 26-Aug-20 17:20pm View
   
So what LogoutAction are you specifying? You say "All it is doing is closing down" so that implies you are doing something additional, rather than just clearing the authentication ticket. (What authentication method are you using?)
DerekT-P 26-Aug-20 15:22pm View
   
As it only happens when logging off, it might be helpful if you included any code involved in the logoff process!
DerekT-P 25-Aug-20 13:49pm View
   
Then step through the Javascript to find out why not. You've not told us what #fire is, what the form is that you're trying to submit, or described what should actually happen. You'll need to do that - and more - or resolve it yourself.
DerekT-P 21-Aug-20 2:52am View
   
How do you know it is "not saving"? What exception is raised? Maybe it's in a transaction that's not committed? Maybe you're looking in the wrong place for it? What is "cb" and where's the "SaveChanges" code? (As judging by its name, that's probably the bit we need to see).
I suspect if you think a bit about these questions you'll be able to debug it yourself. BTW in "what I have tried" we really expect to see the steps YOU have already taken to resolve the problem...)
DerekT-P 14-Aug-20 5:11am View
   
Try controlling page breaks in CSS:
@page {
size: A4;
margin: 0;
}
@media print {
html, body {
width: 210mm;
height: 297mm;
}
tbody::after {
content: ' ';
display: block;
page-break-after: always;
page-break-inside: avoid;
page-break-before: avoid;
}
}
DerekT-P 13-Aug-20 4:59am View
   
my personal experience - though possibly not with the latest versions - is that I couldn't get iTextSharp to render non-trivial HTML correctly, especially when using stylesheets (as opposed to inline styles). I switched to using Pechkin, which relies on webkit DLLs to render the HTML, and apart from some complications with background images found it renders PDFs very well. The only downside is it's 32-bit (maybe there is a 64-bit version, but I've yet to find it!). Pechkin is free, too.
DerekT-P 12-Aug-20 7:50am View
   
Not sure, but when you find the answer, please post complete code here - I could do with another browser. BTW, posting "I tried something like this..." then posting wildly invalid syntax really doesn't give us confidence that even if we give you an answer, you'd be able to implement it in your code. This comes to mind: https://lh3.googleusercontent.com/proxy/PXKblVBFAqe-GgRJW9SHlcOo9Us7u90Fklrc1F1B1uzMbqmuTSOXW6u4PALWOVNpXCe7TtF_BjNq30XwIEaDKLRwww (safe for work)
DerekT-P 12-Aug-20 7:41am View
   
So when you say "it's not working", what do you mean? e.g. Is the form getting submitted? (if not, then look on the client, not the server!) Is the Page_Load event code being executed? Is the btnsignup_Click event code being executed? (Run the application in debug mode and put a breakpoint on the first line in each method). Debug from there once you know what's happening.
DerekT-P 4-Aug-20 9:54am View
   
so it's got nothing to do with the select statement then; you just want a column that says "yes"... ? So after the "column" for..next, xlWorkSheet.Cells[i + 2, dtable.Columns.Count] = "Yes"; (assuming the yes/no column is immediately to the right of the data column). BTW, you're saving the entire workbook after updating each cell; fine if there's a handful of rows being returned, but probably not so great if there's a few tens of thousands...! We may have misunderstood you, but you've not explained what you're trying to do all that clearly.
DerekT-P 25-Jul-20 15:30pm View
   
You say "on any drive" but you're using Server.MapPath to get a path relative to your web application. If you want the folder in a specific, absolute place - then put it there. (E.g. Foldername = "d:\mytopfolder\mysubfolder";Directory.CreateDirectory(Foldername); )
DerekT-P 16-Jul-20 7:55am View
   
Well, depending on the complexity of the HTML in your label etc (formatting? Wrapping? Alignment? Opacity? etc.. etc..) you'll need to use some sort of HTML renderer. There are some designed specifically for this job, others more targeted at generating PDFs etc. It's not C#'s job to render HTML. If you have very simple requirements (you know the font, colour, no issues with wrapping etc) then you can do it directly in C#. However - this whole operation seems to be the sum total of your application, it feels like you're being a bit cheeky and asking us to write your app for you. If you had shown us your "best effort" and given us a specific problem you were encountering, I'm sure many would be happy to help. Ultimately, you're saying "this is a simple ... application" but then admitting it's so hard you've spent a week on it and not come close... Rather than copy/paste from the internet, have you thought of understanding what you're trying to achieve, then writing it from scratch?
DerekT-P 12-Jul-20 5:29am View
   
Also, I still think you don't fully understand Webforms; it doesn't matter adding "runat=server" to a p or label tag; these are NOT form fields so the browser will NOT send them back to the server!!
DerekT-P 12-Jul-20 5:27am View
   
Without seeing your full code, no. There are any number of issues that could cause problems (though personally I've never encountered a form field being empty server-side when it shouldn't be). Things you think are irrelevant and therefore you've not shown us may be the cause. I take it you've used your browser's network inspection tool to verify the data is actually being sent back in the form data??
DerekT-P 9-Jul-20 5:04am View
   
You're best asking a new question in, um, a new question; especially as this one is already flagged as solved. (For one thing, other people will then be able to search and find a solution if they have a similar problem)
DerekT-P 8-Jul-20 6:00am View
   
So what, exactly, is "always null"? FileUpload1? "bytes"? Your original question says "upload the file in sql server but it always shows fileupload is null" but you've still shown us no reference to Sql Server, or how you're expecting the file contents to get there. In your question, what do you mean by "it"? The column in a d/b table somewhere??
DerekT-P 6-Jul-20 15:24pm View
   
You don't give us all the relevant code. But in the first snippet, you're iterating over items within something call "Model". In your second snippet you're referring to a class in "Model𝘀". My guess is that you've populated a collection called "Models" by creating separate instances of Produto called "Model" and adding them to the collection. Fix the typo to iterate over the "Model𝘀" collection instead of the single instance "Model" and you should be OK.
DerekT-P 6-Jul-20 6:23am View
   
I think you need to simplify your query so we can see what you're trying to do. The question title refers to "one DB to another using variable" but your SQL join only involves a single database: MIS.dbo - where's the other database?
I *think* your issue is that you need to join two tables (or even access just one of them) but the table name you need to query is date-dependent and therefore you need to parameterise the table name - is that correct? Please confirm and, if that's the case, someone here will be able to help you.
DerekT-P 6-Jul-20 6:18am View
   
What do you want to do that isn't working?? Your code is just plain HTML and Javascript - why have you tagged it with C# and referred to aspx.cs and aspx code?
DerekT-P 6-Jul-20 5:43am View
   
Your statements are mutually exclusive: "data inserted" and "not showing in database". Those can't both be true. So examine each one in turn: was the insert really successful? How do you know? Then: Why do I think the data isn't in the d/b now?

Is the insert part of a transaction? One cause of the behaviour you describe is that the insert is "successful" but the transaction is then rolled back, so the new data isn't in the d/b. Depending on your settings you may have transactions turned on by default and if you don't commit, your insert gets un-inserted when the transaction times out. Try hard-coding the insert statement and running again to check whether it's that, or some data-related or other issue. Are you certain you're looking at the right database? (If you have multiple databases it's easy enough to get connection strings muddled up so you're inserting into one database then checking another!). Is your query of the database correct for checking the insertion? Are you selecting all data, or just using a d/b tool to view the data; these often limit results to the first 200 or 500 rows, so maybe your data is there but not returned in the default "data table" view. Is there an auto-increment field defined on the table; if so, are there gaps in the numbering? (This may also point to a transaction having been rolled back). Finally, you're doing the INSERT all wrong - this is wide open to SQL Injection attacks. Never just "inline" data to be inserted or updated, especially if that data has come in via a web request. Your code above will break if the data ever contains a single quote. (Break, if you're lucky - or allow someone to gain full access to all your data, if not!)
DerekT-P 11-Jun-20 5:57am View
   
What is your d/b structure? Your SQL statement is
Select CourseOutcomes from CLO,subjects where subjectname = @SubjectName

So you're querying two separate tables, but not defining the relationship between them. Run that query in ManagementStudio or whatever tool you use, and you'll see the results that your code are getting. And, as Richard M says above, using the debugger to step through the code and examine what's actually happening is usually the best way to understand what you're asking your code to do!
DerekT-P 29-May-20 12:41pm View
   
Oh, and further to my suggested solution; telling us "it fails" is generally not very useful! That might indicate a syntax error, or a failure of the event to fire, or unexpected results, or... anything, really. Tell us what DOES happen and why this is not what you were expecting or hoping for. Your "What I have done" doesn't indicate that you've attempted to debug the issue, either. Use the browser's script debugger to set breakpoints and step through your code. Good luck!
DerekT-P 24-May-20 7:14am View
   
What question do you have for us?
DerekT-P 15-May-20 5:54am View
   
Since this is answered comprehensively on your StackOverflow post, please mark this question as answered to avoid wasting people's time. Cheers.
DerekT-P 15-May-20 5:40am View
   
As chill60 said, you haven't told us what you tried. My first thought was URL rewriting, and that DOES work, unless you get it wrong - which presumably you have.
There are plenty of other solutions too, but I can't suggest any since I don't know WHY you want to "fake" the URL and WHAT you want to achieve by that. I could spend time giving you a detailed solution but chances are you'd turn around and say "but it doesn't do what I want it to". We're not going to second-guess what you're trying to achieve.
DerekT-P 7-May-20 17:39pm View
   
George, thanks for being honest about what you're looking for! Some of your "what you've done" code is missing, and even so there's a lot of it - more than people here are likely to be willing to wade through. So yes, you need to research and experiment with how the various repeater controls work; they're not that intuitive! There is a lot of documentation out there, but for my money, the best tutorials are often from 4guysfromrolla.com Their articles walk you through from complete novice level, adding degrees of complexity and functionality one small step at a time. Go there and search for "repeater control", ignore the adverts at the top, and find some articles that best fit what you want to do and your level of understanding. CodeProject is a marvellous resource and has some great articles, but tends to be aimed at those with a firm grounding in their subject who want to drill down to very specific scenarios. The 4Guys site is probably better suited to your needs for now. Hopefully at some point you'll be back here as a professional and contributing yourself. Good luck! [Update - reading your objective again, I'm not convinced that repeaters come into it at all - you'd use a repeater if you need to edit the contents of MULTIPLE ID cards, but if you're editing just one at a time (and you're selecting a single row based on ID from the d/b table in your bind method), then you don't want repeaters - just a simple form will do. I suspect you might have googled "template" and "asp.net" and got misdirected by the results. ]
DerekT-P 7-May-20 8:48am View
   
You put "ASP.Net" in the keywords, but there's no indication here you're using ASP.Net. You've posted some static HTML and some (non-web-related) C# code. I guess you've cut/pasted the mail code (SMTP etc) from somewhere else?
You need to take a (large) step back and learn ASP.Net. It's not appropriate for us to teach you the whole ASP.Net paradigm in the answer to a question. What is "mobile" and what's in it? Why are you opening that page in WebClient? Why are you reading the response and discarding it? What's Message and what does .Show do?? These are all the hints to me that you need to go back to basics and start by learning what ASP.Net is and how it works. I do wish you well, we've all started somewhere!
DerekT-P 7-May-20 5:43am View
   
"web site showing some issue" ... so WHAT is the error message?? Have you tried reading the error message and acting on its suggestion if there is one? Have you googled the error message to see the most common causes?
DerekT-P 5-May-20 7:57am View
   
No. XML is not an image format. You seem to be using MS Access as your database. I would recommend you use a database with a proper database management system if you're interacting with the database from a website. There are plenty of free options. It's also a bit hard to tell what you're really trying to do since we can't see your HTML. Paste it in and select HTML/XML/ASP as the code language.
DerekT-P 5-May-20 7:51am View
   
If someone's going to try this, they probably have the skill and motivation to do it just by crafting a POST request using a proxy anyway, so as per the suggested solution, you MUST check permissions server side. However, by sending a disabled button, you are (a) giving people ideas and (b) telling them the name of the button. With or without "enabling" the button, I can create a POST using that button name and you've no idea if it was enabled or not. However without the button name, I can only guess at what it might be. If it's sensitive and if verifying permissions on the server is "expensive" then just don't send the (disabled) button at all, to remove temptation; and name it something obscure (or even give it a dynamic, random name) then any hacker won't know what to press. BUT you still need to verify permissions at server side!! :-)
DerekT-P 27-Apr-20 12:12pm View
   
If they're different domains, the short answer is that you can't - by design. I think you've "lost" some of the html in the posting of the question...
DerekT-P 17-Apr-20 9:30am View
   
I'd suspect that you may not have "write" permissions to the folder; by default on a hosted server you won't. Suggest you post your code here, but first do something even simpler than writing a log entry: in your application_start event do Application["debug"]="yep, this fires fine"; and then in any other page, display the value of Application["debug"]. That should satisfy you that events are firing OK. If you still have problems, then by all means come back here with your code, what you expect to happen, and what is actually happening.
DerekT-P 17-Apr-20 4:24am View
   
You need to show us your HTML as well as the server-side code. The problem is, I'm not sure you comprehend the radical difference between webforms and winforms. What are all the Thread.Sleep calls supposed to do?? Indeed, why on earth are you creating a separate thread? If I were writing this game for the web, it would be written in Javascript served via a static HTML page; why do you need any server-side code at all...
DerekT-P 17-Apr-20 4:18am View
   
Are apps A and B on the same server? Do they share the same database / datastore? What authentication method are you using? trying "Session" doesn't really do anything other than cause a compilation error, as it's not a method name. You need to provide more information about context and, in "what I have tried", we need to see your code, not just a single word.
DerekT-P 17-Apr-20 4:15am View
   
er.. how on earth do you do a message display in asynchronous, headless code (i.e. global.asax)?? How do you know the application_error event is not firing? (Maybe whatever you're trying to do to "display" a message is causing an error that is causing global.asax to not function at all...). In these situations I tend to write a log message to d/b or a flatfile (after making sure the IIS user has write permissions on the appropriate directory) and debug that way.
DerekT-P 8-Apr-20 8:35am View
   
"reload" it into what??
DerekT-P 3-Apr-20 5:06am View
   
Do you not have a user-acceptance test environment? If not, create one!
DerekT-P 3-Apr-20 5:01am View
   
Without seeing ANY of your code, I don't think it will be easy/possible for anyone to advise you.
DerekT-P 29-Mar-20 14:02pm View
   
"What I have tried" seems to be just CSS - but no HTML. Why are you trying to build a calendar, when there are hundreds of customisable plug-ins out there? Try https://jqueryui.com/datepicker/ for starters.
DerekT-P 25-Mar-20 14:37pm View
   
Your code relates more to uploading a file than to the insert, but the HTML you show makes no reference to a file upload. We don't know what's in global.php (we don't need usernames and passwords in connection strings though) but as you're only showing us part of the code, and presumably the wrong code at that, it's hard to tell. We also don't know the definition of the table, so don't know if what you're trying to insert is appropriate.
In the meantime, suggest you try single-stepping through the code in your debugger to see what's happening. If for some reason you can't do that, then set your php config to display error messages, put echo statements in your code to show where execution is flowing, etc.. etc; all the usual debugging steps basically.
DerekT-P 11-Mar-20 16:44pm View
   
hex code is 2A.
DerekT-P 11-Mar-20 8:50am View
   
Well thank you for the good wishes! If the code on the database is mixed, but has only <% %> tags, then simply remove them before evaluating (e.g. eval(replace(replace(var1,"<%=",""),"%>","")). If there's other HTML in there between the tags, it's a bit more complex and you'd need to use something like RegEx to split out the ASP code from HTML and then loop through the parts, either emitting them unchanged (the HTML bits) or emitting the EVALuated bits of code. A bit trickier but do-able.
DerekT-P 8-Mar-20 15:40pm View
   
So what is your question? You've told us what you want to do, you've told us what you've tried, but what is not working?
DerekT-P 8-Mar-20 15:36pm View
   
haha... the editor has lost the [br /] code in those last few lines; so it should be
Response.Write rs("today") & "[br /]"
Response.Write rs("tomorrow") & "[br /]"
Response.Write rs("yesterday") & "[br /]"
... but of course change those square brackets for angle brackets. Sorry if that's confused things!
DerekT-P 8-Mar-20 15:33pm View
   
So you need to be evaluating CODE, not text. If the text contains things like <% then that's not VBScript code so can't be evaluated in any way other than text. <% is just a context switch between HTML and VBScript. Also in your Eval statement you've enclosed the variable name in quotes, so evaluating a text string will just return text.
Change the text in the database:
Response.Write rs("today")
Response.Write rs("tomorrow")
Response.Write rs("yesterday")

Then you can do something like
<%
var1=rs("KioskHtml")
Response.Write Eval(var1)
%>
Now, because you're evaluating VBScript, if you need to emit HTML you can't just embed it, or context switch from VBScript to HTML; you need to write VBScript that will emit it. So for instance if you want those three values on separate lines, change the database value to (for example):
Response.Write rs("today") & ""
Response.Write rs("tomorrow") & ""
Response.Write rs("yesterday") & ""
If you're not entirely comfortable with the concept, just knock up a simple test page and experiment until you've really grasped what you're doing.
DerekT-P 3-Feb-20 3:31am View
   
No problem - we've all been there! Am adding this as a solution so would you mind marking it accepted? Then the Question is flagged solved and disappears off the unanswered questions... cheers!
DerekT-P 31-Jan-20 3:42am View
   
Not sure what you mean by "with the left movement is tuned off" and putting your code into JSFiddle I can't get the pointer off the ball once dragging... Anyway your only mouseup event is on the ball itself, so if the mouse isn't on the ball, the mouseup won't get called. You need a mouseup event on the window, which will stop dragging the ball. (In fact in that mouseup you don't care where the mouse is, whatever happens, stop dragging the ball. so just changing ball.mouseup=function... to window.mouseup=function... should do the job. And what is OnTheMove for? If there's code elsewhere that tests if the ball is being dragged, you'll need to set this back to false in your mouseup function too. I suspect there's more code / html elements than you're letting on! ;-)
DerekT-P 30-Jan-20 17:47pm View
   
How does the ball move if the mouse pointer is NOT over it?? The code just drags the ball, if the pointer isn't over the ball on mouse down, the ball doesn't move. If it is, the ball moves with the mouse so the pointer is always over the ball.
DerekT-P 30-Jan-20 17:01pm View
   
"it fails" is not a lot of information for us to advise you as to why it fails and how to stop it failing.
DerekT-P 2-Jan-20 4:50am View
   
SanketLodha - this isn't valid code. As per earlier comment, we need to see your CODE - not what you THINK you've written. All the code relating to the input box, the dropdown.. ALL the related javascript and HTML.
I use exactly similar logic in several of my sites - a datepicker whose range is determined by the selection from a dropdown box - so it most certainly can be done but we can't find the problem in your code if we can't see your code! :-)
DerekT-P 28-Dec-19 11:47am View
   
Can you include more of your code, please. We need to see the context of what you've done, your if..else etc.
DerekT-P 19-Dec-19 7:43am View
   
What server are you using? Have a look in the server logs to check the request for the JS file has been received, and if it has been completed by the server. If so, check your browser - could any extensions be blocking the load? (e.g. some adblockers will prevent files with "ad" in the name from loading, leaving them in pending status). Is there a cacheing issue? Maybe you already have an older version of the file downloaded from the site, that doesn't have the necessary function defined. Try flushing your browser cache, or add a querystring to the script filename (e.g. dummy.js?version=0.0.1)
DerekT-P 2-Dec-19 13:50pm View
   
Depends on the number of options and the size of the related data. If it's fairly small, send all the data in the original page and use client-side Javascript to pull the appropriate data. (Obviously this may not work if the related data is highly dynamic). If there's a lot of data, or you need to get the current value of rapidly-changing data, you'll either need to postback the entire form and do everything client-side, or use Ajax techniques to make a separate "hidden" request to a server page that returns just the data you need.
As F-ES Sitecore says, I'd question why you're using classic ASP for this, especially since it's not a skill you already have. Is this an enhancement to an existing classic ASP site?
DerekT-P 2-Dec-19 13:44pm View
   
There may be nothing wrong with the html. However we've no idea where you're sending the file to; including what web server, nor how that server is configured. (Also bear in mind that some servers (e.g. IIS) have a default file upload size that would preclude uploading .BAK files for all but trivial test databases; you'd need to configure the max upload size appropriately.)
DerekT-P 30-Nov-19 8:32am View
   
You'd need to tell us a great deal more before anyone can really help you.
What is at each end of the API (e.g. browser, desktop client, server) and how are they communicating?
What has the database got to do with anything?
What action are you wanting to invoke through the API?
What does the response look like?

As a final comment, just copy/pasting your question into the "What I have tried" box is adding zero information. Without any context at all there's precious little anyone could usefully say to solve whatever your problem is.
DerekT-P 30-Nov-19 8:26am View
   
I'm assuming this is a desktop app rather than browser-based. It would be helpful if you would confirm that. From your question, it sounds like there's one table whose contents are displayed to multiple users simultaneously, and some/all of those users can add / delete / update rows in that table. How are you dealing with cases where a row in the process of being modified by one user is deleted by another? What if two users concurrently make changes to the same row, but different columns? I suspect you may have much bigger problems than how to refresh the screen automatically unless you've addressed these issues. To update the screen(s) on any data update, there are essentially two options: (1) Polling - each client periodically re-checks some d/b indicator to see if anything's been updated, and if it has, refresh the screen; or (2) Push notifications - the process of updating a row pushes out notifications to each client to tell them something has changed. Your choice will depend on various things - just how "immediate" do changes need to be reflected; how often are changes made; is your app the only way that data can be changed; how many clients are there; are all clients on the same network; and probably many other considerations too.
You say you've tried re-fetching the dataset on every change, but your comment suggests you think that refreshing one user's screen will somehow refresh all the others? Regardless, I still suspect you will run into problems if you are just continuously showing a static dataset to all users while allowing any user to update the data at any time.
Go back and think about your users' requirements and how your overall design could fulfil those.
DerekT-P 25-Nov-19 5:21am View
   
I suspect you're missing Autopostback="true" for the controls you want to postback. With that set on the relevant controls, you won't need your OnClick="[whatever]"
With autopostback, you're no longer explicitly stating what server-side method you want to invoke, so you need to declare that some other way. The simplest is to include AutoEventWireup=true in your page declaration (in the .aspx file). Then ASP.Net will associate methods with the default names ([control]_[event]) to your controls' postbacks. Alternatively, you can add the mapping explicitly server-side by adding "handles [control].[event]" to your method definitions; e.g.

Sub mypanel_hasbeenclicked(sender as Object, e as EventArgs) handles Panel1.Click

Just make sure you don't use both methods at once, or you may end up calling your methods twice (if they have the default names)
I'd also suggest that you investigate what's actually happening when you click a button; in Chrome, use Developer tools' "Network" panel to monitor the requests to the server - this will show you the actual data being sent to the server. In your C# code, set breakpoints in your page_load and other event handlers, so you get to understand the sequence of events at the server.
DerekT-P 19-Nov-19 7:46am View
   
Why are you referencing JSHome.js twice? And what does it do? We can't know what's in there and it may be the reason for the different behaviour. Is javascript throwing an error? Have you tried debugging it in (e.g.) Chrome's developer tools? When you say it won't work "in VSCode"... VSCode is a development environment / editor - what browser are you actually running the code in?
DerekT-P 19-Nov-19 7:29am View
   
In Chrome, right-click the rendered element and choose "Inspect". You'll then see what the element ID actually is. ASP.Net may prefix the rendered ID with parent controls; this can happen if the grid is in a custom control, or in any other server container control, a master page, a repeater etc.. etc..
DerekT-P 18-Nov-19 6:22am View
   
1. Brace yourself for a steep learning curve
2. Learn about HTML, particularly HTML forms
3. Once you've got some very basic understanding of C#, use it to build some native HTML forms stuff. Input boxes, dropdowns, and dynamically try and create a results grid using tables.
4. Then start learning ASP.Net webforms; you'll re-learn everything you learnt in (3), but you'll understand - and appreciate - what ASP.Net is doing for you

Whatever you do, don't start by clicking "New project" in VisualStudio. It will overload you with tons of irrelevant crap that you won't understand and will just put you off. Create an empty folder, then open it as a "website" in visual studio and create a new HTML file. Get to grips with HTML and forms processing. Then create a new "webform" and see what ASP.Net can do for you.

In the longer term, you'll probably need to decide between webforms and MVC; but get to grips with the web, VisualStudio, and C# first otherwise you'll flounder.

Good luck and take lots of small steps!
DerekT-P 1-Nov-19 18:23pm View
   
Thanks Dar. Yes, I'd understood the single-threading but taken an inappropriate shortcut on the setTimeout! i.e. setTimeout(alert('message'),100) rather than enclosing the alert within a function. Doh.
It resolves the issue but still feels like an ugly kludge, and one that isn't necessary for Edge, IE or Firefox. Oh well.
Thanks again for taking the time to reply and provide a working example!
DerekT-P 1-Nov-19 18:16pm View
   
Thanks MadMyche and F-ES Sitecore for your suggestions. In this instance the message is only shown if the user tries to submit the form without first at least having tabbed through the form fields. If a field is invalid on "Blur" then it's flagged as an error immediately, so the need for an explicit pop-up message is just as a "back-stop" and should be rarely encountered. There's a (low) fixed budget and even swapping a simple "alert" statement for a modal popup takes development and testing time for a feature which will only be very rarely used. In other situations I do use modal messages and/or messages under/next to error fields. A problem with the latter is that they can make the form layout "jump around" (or at least the window to scroll) which can be irritating. On the desktop I prefer to use mouseover pop-ups (non-modal) to give additional feedback, but they're not so great on mobile devices.
DerekT-P 31-Oct-19 17:13pm View
   
The file is in use as it's the data source for the grid. So before deleting it, change the data source to somewhere else (an empty, dummy file perhaps?); delete and recreate your text file, then reset the grid's data source back. No idea what language / platform this relates to, but the above should be generic enough for you to figure out.
DerekT-P 28-Sep-19 16:15pm View
   
what is the value of sup.PRODUCTLIST[0] before you do the above assignment? Because that's all you're doing - assigning a new value to the first element in the sup.PRODUCTLIST array. Have you declared the size of that array? Or did you mean this to be a list? In which case you'll need to ADD it to the (defined) list... The "not set to an instance of an object" is referring the left-hand side, not the right!
DerekT-P 30-Jul-19 5:19am View
   
By definition, you can't access "localhost" over the internet - it means exactly what the name says, the HOST on the LOCAL machine. If you have a webserver on your local machine, you need to know its external (public) IP address. In most cases you will need mapping in your router to route the public IP address to the IP address of your machine on the local network. You'll need to open firewalls etc to allow http traffic in (on whatever port you want to use). But as it stands your question doesn't really mean anything - sorry!
DerekT-P 12-Jun-19 14:53pm View
   
You don't seem to be passing the transaction you created in the Delete into the Insert methods... and even if you were, you're either always setting the transaction to null, or starting a fresh transaction (depending on useCommetTrans - we don't really know what that's meant to indicate). For us to assist you better, suggest you simplify both methods so you just leave the code that would be executed if you want to carry across the transaction from the delete to the insert, together with the calling code as well.
Also, be aware that if using Truncate, this command is not un-doable, i.e. does not participate in a transaction anyway; DDL (which isn't supported across all DBMS implementations) is a DDL command, not DML and shouldn't really be considered as an "alternative" to using Delete.
DerekT-P 11-Jun-19 11:00am View
   
You'll need to tell us what DBMS you're using, and give us table definitions (e.g. we need to know if there is an auto-number / auto-increment column defined). Better still, read a primer on SQL and you'll figure it out yourself, probably sooner than you'll get an answer here.
DerekT-P 6-Jun-19 5:15am View
   
Further to above reply, you need to check that you are connecting from a static IP address. Otherwise you might have temporarily been able to access the d/b using other tools but if your IP address has changed, php won't now connect. Use whatismyipaddress.com to verify your actual public IP address that GoDaddy will see.
DerekT-P 6-Jun-19 5:13am View
   
I assume you've followed the steps at https://uk.godaddy.com/help/connect-to-databases-remotely-in-cpanel-hosting-16103 (to explicitly allow access from your remote IP address) since you say you can connect to it via MySql Workbench... what happens if you run a php page on the GoDaddy webserver - can that connect?
DerekT-P 5-Jun-19 16:11pm View
   
can you post the php code where you're trying to do the connect?
DerekT-P 5-Jun-19 11:14am View
   
You say you can connect with .Net apps; are they running on the server (and therefore "local") or remote? When connecting, are you explicitly using username "mystrainfamily@184.168.27.82" or just "mystrainfamily"...? Check that user mystrainfamily has rights to connect from any server, not just from 184.168.27.82. Finally MySql has a couple of different password security protocols (sorry, can't remember the terminology right now); make sure your password is using the correct encryption for your connector. I know that's a bit vague but easy enough to google for.
DerekT-P 5-Jun-19 4:49am View
   
Well hopefully your problem is resolved anyway - please mark it as such if the endless loop is resolved. Yes I'd read what you put about Eval but there are more ways than one to achieve anything. Eval can be useful but you've yet to convince us it's the best option in this particular case!
DerekT-P 2-Jun-19 16:58pm View
   
part 1: Just use URL rewriting? (assuming that abc.com is your domain... but we're guessing here!)
part 2: what is "it"? (It should auto...) do you want to do this client-side? Or in the d/b? or in C# code? Are the links dynamically generated from the d/b somewhere, or are they in the aspx page content, or... what? You've really given us no information on what you're trying to do.
DerekT-P 20-May-19 9:33am View
   
You've explicitly specified you want to export the whole document. The MS documentation doesn't explicitly state it, but since To:= and From:= are only relevant when wdExportRange is used, any other time they must be ignored. For clarity if nothing else, I'd remove the to/from parameters. And you're not "converting" the document; you're exporting a copy in a different format (or logically "printing" the document). But anyway see Rick's solution below... was assuming you had this installed since you're referencing the wdExport.... constants, but maybe you'd just defined them yourself?
DerekT-P 18-May-19 15:19pm View
   
You've got JSON data; why use Regex to parse this rather than just parsing the JSON (google JSON.Net) ... ?
DerekT-P 18-May-19 13:39pm View
   
You're specifying both range and from / to parameters; but from / to are only relevant if the selected range is wdExportRange. At the end of the routine you're calling PrintOut with a filename parameter. You're not using a named parameter and, if you were, the parameter is named OutputFileName not FileName. The filename is only of any relevance if you set "PrintToFile" true, which you're not; so the final step just prints the document to the default printer. Now, if you have setup the default printer as PrintToPdf then that may be all you need to do, i.e. no need to attempt the previous export.
objDoc.PrintOut OutputFileName:="C:\myReport.pdf",PrintToFile:=True
DerekT-P 18-May-19 13:01pm View
   
"So it's strangely like the text is white against white." ... and is that the case? Select the text - does it become visible? Use the Inspect Element tool to see what's contained and where the formatting is coming from. Remember if your edit control is taking its formatting from CSS, and the CSS selector references a control ID, that putting your repeater inside a master control *may* (depending on the options in your web.config) modify the control IDs so that CSS is not selected as you expect. Don't think there's much more we can do until you give us some more info and show us the code + css that you're using.
DerekT-P 18-May-19 8:11am View
   
I assume you've stepped through the code to verify the .Sorting method is actually being called? Have you defined any custom comparison method? Have you tried explicitly calling the .Sort() method after setting the sort sequence to force a re-sort? And have you verified that the form isn't reloading the data each time the combo box selection is changed?
(BTW, why use a separate thread with cmd.exe just to search some directories for matching filenames??)
DerekT-P 17-May-19 11:56am View
   
It would help if you can give the spec for what you're trying to achieve. It looks like the event group is NULL for alternating groups, but that may not be the case; we can't make that assumption. There's presumably something unique about Ultrasound but as your code doesn't do what it's meant to do, we can't reverse-engineer it to work out what. It's fairly clear that sequence is important, but Sql tables have no implicit "sequence" defined, the physical sequence of records returned is undefined. So you also need to clarify (although we can guess, we may be wrong) about the required sequence too.

Finally, but vitally: you say you'd like "output as follow" (which implies you're selecting some data) but your attempt involves updating the data... But again, you have no ORDER BY on the select that you're using for grouping the data, so your query is not reliably re-runnable and may not give the results you're expecting, based on an assumption of implicit ordering. Does the query need to be re-runnable, or is this meant to be a one-off??
DerekT-P 17-May-19 11:41am View
   
Please clarify what you're trying to achieve. I'm guessing that you have a fixed-width DIV containing a text box; what you want is that when you type into the textbox, the font-size is adjusted so that the text fully fills the width of the div? (so the more characters you type, the smaller the text gets; and a single "W" is in a much smaller font than a single "l" for instance...

If so, google "dynamic adjust font size css to fit" and you'll quickly find a number of solutions...
DerekT-P 17-May-19 11:34am View
   
Can you provide your markup and server-side code, please; we'll need to understand when/how you're populating the listview etc.
DerekT-P 17-May-19 6:34am View
   
But your code is NOT uploading a file at all. By "uploading" we mean moving a file from the client to the server machine and saving it there. What you are doing is opening a file "in place".

We can't advise you on whether you actually need to upload the file or not - but for now, suggest you remove the term "upload" as it's wholly inappropriate, based on your shared code.

There are a number of issues here...
Firstly, you're dependent on the new server having the appropriate Microsoft.ACE.OLEDB assemblies installed. You've given us no clue as to what you're seeing when you run this code, so it may be that this is the main issue, but you can check that very easily by looking at the exception that gets thrown.
Next, you've not really explained fully your new scenario - are you actually running this on the new server, or are you connecting from a remote machine (e.g. using a network mapped drive). If the latter, remember that if you reference a file such as "c:\mydata\myfile.xlsx" that that filename is pointing to a file on YOUR computer; but the software, if running on a remote machine, just gets the filename so will look on it's own C: drive and of course not find it.
DerekT-P 16-May-19 6:33am View
   
The original query returns a single row of 2 columns; your reworked version returns 2 rows of 1 column each. Which do you actually require?
DerekT-P 16-May-19 6:30am View
   
Typically, unless your contract or T+Cs say otherwise, if you're writing code "for hire" then the code you write belongs to the client - i.e. it's his IP (Intellectual Property). It's therefore his to do with as he likes - sell a million copies at $10 a go and owe you nothing, post the source publicly, or give you $1000 as goodwill. So unless your T+Cs or contract stated that you retained IP, it's his and there's no further fees payable.
As to what you should have charged for it, that depends on what it is and what the market is. If it will land a spaceship on Mars and runs to a million lines of code, quite a lot. If it will display a different joke a day then $10 is probably generous.
DerekT-P 16-May-19 6:22am View
   
"I tried @iarna/rtf-to-html,@iarna/rtf-parser but can't" ... can't what? Show us what you tried and someone may be able to assist.
DerekT-P 15-Apr-19 15:35pm View
   
Hard-coding the values for __EVENTVALIDATION (and probably __VIEWSTATE too) will likely never work; the value will be hashed with the machine key which may change periodically. You will need to first do a GET on the page, and make sure you send the received values for __EVENTVALIDATION and __VIEWSTATE (and all other fields, possibly) together with your new values for the login fields. You may also need to retrieve and return any cookies received with the GET response, too.
DerekT-P 14-Feb-11 7:53am View
   
Deleted
Reason for my vote of 1
Does not do what it says on the tin... includes unexecuted code; includes illogical code; includes duplicated code...
DerekT-P 14-Feb-11 7:52am View
   
Deleted
So, you've a function "CheckBrowser" which, if "clicked" is false does nothing, else sets "clicked" to false....?? Fortunately whatever nonsense this is supposed to achieve is irrelevant as you don't ever reference the function. And how, exactly, does this code differentiate between the user navigating to a page on a different site and staying on the site???

Derek TP