Click here to Skip to main content
14,928,526 members

Comments by A_Griffin (Top 100 by date)

A_Griffin 5-Apr-18 14:07pm View
   
Deleted
No doubt, but still you can't assign strFirstName to the InnerText of an object that Is Nothing.
A_Griffin 31-Mar-18 3:44am View
   
Greif - 3 times you've posted this!!
A_Griffin 31-Mar-18 3:43am View
   
You already asked this question in the Database forum - double-posting is frowned upon here...
A_Griffin 25-Mar-18 4:11am View
   
What happens when you get to ABC/AGR/999 ?
A_Griffin 24-Mar-18 3:20am View
   
Cookies may not be optimal for storing large amounts of data, as they are passed back and forth between the browser and server. Better to store the data in a local database and only an identifier token in the cookie which can then be used to retrieve the data.
A_Griffin 22-Mar-18 4:18am View
   
btw, I updated the Do...Loop to check for the bytesRead = 0 condition before writing - it does actually work the other way (having it in the Until ...) but still ...
A_Griffin 16-Mar-18 13:48pm View
   
What's the difference between "alternate rows with separate color" and having even numbered rows with one color and odd numbered rows with another?
A_Griffin 7-Mar-18 11:17am View
   
You haven't posted enough information for anyone to help, or even asked a question. But, you have 4 (that I can see) elements on your page all with the same ID, so that won't help...
A_Griffin 7-Mar-18 7:26am View
   
Remember that labels don't receive focus. When you set the focus to a label it either passes to an associated control (webforms) or the next control in the TabIndex order (winforms).
A_Griffin 6-Mar-18 9:22am View
   
Well... full marks for perseverance, I guess! There are a number of basic HTML errors in your code (two body ... /body blocks, which isn't allowed) and the last form in each tab begins in one table cell and ends in another - enclose the whole table in it.

That aside... I'm not clear what you're trying to do? Should the Total Amount in each Tab be the cumulative total of all those in the tabs that come before it?
A_Griffin 5-Mar-18 3:52am View
   
Why are you putting a JS function inside a repeater item? It will get repeated in each row, and you'll end up with the same function defined multiple times on your page.... place your function outside of the repeater and pass the CientIDs to it
A_Griffin 2-Mar-18 3:40am View
   
Why not just a flag (Boolean or tiny integer) field to each record, True or 1 = confirmed, False or 0 = not confirmed. New records are False (0) by default, and then you simply switch the field to True (1) when admin approves them. And you can filter your searches on this field to display either only approved records, or not approved records, or both, as you like.
A_Griffin 28-Feb-18 12:42pm View
   
Really I think you should re-think your database design. It's not very good as is, and you will have difficulty making sensible queries on it.
A_Griffin 25-Feb-18 16:02pm View
   
I'm not normally a fan of "black box" solutions, but dates are a pain in the derriere in JS, so I'd recommend using moment.js: https://momentjs.com/
A_Griffin 24-Feb-18 9:24am View
   
At what point do you want to pass these values to your JS function? Forget ScriptManager - I've never found a use for it yet. If you want it when btnOK is clicked, simply add
btnOK.Attributes.Add("onclick", "return myFunction()");
in page_load in your code behind, and make your function return true or false according to whether or not you want to button for post back or not. (You should not nee the OnClick="btnOK_Click" in your markup.)
A_Griffin 21-Feb-18 18:55pm View
   
What are you expecting your code to do? All I can see is a variable (timer) that, in the blink of an eye, will "count" from -50 to +50 and back again, then the code ends.
A_Griffin 21-Feb-18 6:53am View
   
Replace("<Section Name=""Description < &"">", "<Section Name=""Description [whatever you want]"">")
A_Griffin 21-Feb-18 6:22am View
   
? It's right above, in the first thing I posted.
A_Griffin 21-Feb-18 5:43am View
   
Or do you have any options to change the JSON at source? It's a rather silly value for an attribute in a JSON node.
A_Griffin 21-Feb-18 5:40am View
   
Yes, I know... so replace it as I suggested.
A_Griffin 21-Feb-18 5:14am View
   
What's wrong with
Replace("<Section Name=""Description < &"">", "<Section Name=""Description [whatever you want]"">")
A_Griffin 18-Feb-18 3:46am View
   
Well it's not hard to replace the button the an image - but what can I say? It works for me in the manner you want, in IE, Firefox and Chrome: it only shows on each row as that row is hovered over.
A_Griffin 13-Feb-18 4:20am View
   
Your question is too vague, especially for QA. No one is gong to provide you with code - only help with specific points you get stuck on, when you should show the code you've tried.
A_Griffin 12-Feb-18 6:39am View
   
?? well, just add the customer name t the replacement string. Why are you leaving it out?
A_Griffin 4-Feb-18 6:22am View
   
Hey - I figured that (hyphen thing) - I'm a genius!!!! :)
A_Griffin 4-Feb-18 6:21am View
   
Thanks! Well, I knew it was easy .... I just have a mental block against regex.... cannot get my head around it.

Of course.... what I actually need is to exclude hyphens form the second one...
A_Griffin 27-Jan-18 9:25am View
   
Well done!
A_Griffin 27-Jan-18 4:23am View
   
Why are you trying to update an autoincrement field?
A_Griffin 27-Jan-18 3:21am View
   
Try to isolate the line where the problem is. And why does your having to do a delete operation mean you can't convert the date to a string (or even retrieve it as one form the database to begin with, using MySQL's date_format function)?
A_Griffin 25-Jan-18 13:52pm View
   
MySQL doesn't use the TOP function - remove that and just use the LIMIT 1 instead. However, from the error message I suspect that your connection string is invalid.
A_Griffin 25-Jan-18 4:54am View
   
Have you checked that all the email addresses in the database are valid? Your error message would suggest that maybe some are not (or maybe are just empty strings).
Also, if/when you do get this working, bear in mind that many if not most ISP's provide strict limits on how many emails you can send within certain time periods. You may need to use an email relay service if sending to lots of addresses.
A_Griffin 18-Jan-18 13:38pm View
   
On the face of it, there is nothing in that script to cause the page to jump back to the top (or re-load) so I suspect there is something else in your page causing your problem. (I've seen that script before - from W3Schools, am I right?)
A_Griffin 17-Jan-18 14:57pm View
   
System.Data.SqlClient is the provider for SQLServer. Try using System.Data.Odbc or MySql.Data.MySqlClient with the MySQL .NET Connector
A_Griffin 13-Jan-18 5:02am View
   
The error message is telling what is wrong: your db connection login: "Access denied for user 'root1'@'localhost'". First off, you shouldn't really be using the root user anyway - create a new user and give it only the privileges your application needs. Second, make sure you use the correct credentials in the db connection string.
A_Griffin 5-Jan-18 7:10am View
   
You do realise framesets are no longer supported in html5 ? You really should not be using them. Use the iframes instead.
A_Griffin 4-Jan-18 14:53pm View
   
Well, presumably you're posting back somehow - via a button or something - that's what submitting the form is... IDK, but the code you posted is fine. I can post (as a "solution") a complete simple page using it to prove it, if you want...
A_Griffin 4-Jan-18 13:45pm View
   
WHat about in your page_load event? Are you re-setting its value there, not taking account of the PostBack?
A_Griffin 4-Jan-18 13:12pm View
   
? he's used a parameterized query ...?
A_Griffin 4-Jan-18 12:28pm View
   
Well I don't know but the code you have will post back the selected value. Unless you maybe have EnableViewState = False in your page, maybe?
A_Griffin 4-Jan-18 11:48am View
   
On the face of it there's nothing wrong with that. YOu must be doing something else somewhere else that's causing your issue.
A_Griffin 3-Jan-18 8:42am View
   
Just change the value of the Tasmania button from "4" to "Tasmania - correct!" then your function can be:
function vals()
{
var radios = document.getElementsByName("rbnNumber");
for (var i = 0; i < radios.length; i++) {
var r = radios[i];
if (r.checked) {
document.write("You selected " + r.value)
}
}
}
A_Griffin 30-Dec-17 12:42pm View
   
Why do your Cells(X) in your code range from 0 to 4 when you only have 3 columns - so should be just from 0 to 2?
A_Griffin 28-Dec-17 5:31am View
   
IF you're having to ask all this, then the answer to "Can I make this website in 10 days" is "No."
A_Griffin 22-Dec-17 8:49am View
   
Just wondering how you got on with this? I agree that the online help/documentation for dealing with complex JSON structures is lousy to non-existent - which is odd really, as there must be quite a demand for it. I finally figured this out, if you still need a hand...
A_Griffin 20-Dec-17 7:28am View
   
Use the FileSystemWatcher class to look for new files, and then read (only) those as they are created.
A_Griffin 12-Dec-17 8:46am View
   
cheap-flights/lagos, huh? DO you need help moving $4m out the country as well?
A_Griffin 11-Dec-17 13:00pm View
   
Yes, sorry - my bad!
A_Griffin 11-Dec-17 7:41am View
   
you could simply use Replace(vbCrLf, "") when sending it as the email body (and wrap the whole thing in p tags.)

- edit - there was a linebreak "br" tag in the second Replace parameter there, but CP removed it...)
A_Griffin 1-Dec-17 8:53am View
   
You can't have multiple elements all with the same ID. Google how to use radio buttons.
A_Griffin 30-Nov-17 4:06am View
   
There have been articles here on CP related to this which may help - try doing an article search for "jquery postback updatepanel". May help.
A_Griffin 26-Nov-17 18:45pm View
   
Thank you so much!
A_Griffin 24-Nov-17 7:27am View
   
There are multiple Q&A's on stackoverflow about this, with many suggestions. Try googling for "mysql multiple join execution time"
A_Griffin 21-Nov-17 7:00am View
   
From your code, I assume the image is stored in the database? Have you tried Googling this? Try this for starters:
https://stackoverflow.com/questions/6350516/how-to-add-image-from-database-to-picturebox
A_Griffin 19-Nov-17 7:55am View
   
I would also add - a) don't try to run before you can walk, and b) a stitch in time saves nine.. If you are that out of touch with modern web development, you would do well to spend a (good) while learning before attempting a project on such a scale.
A_Griffin 16-Nov-17 19:01pm View
   
Use the standard timer control
A_Griffin 16-Nov-17 13:43pm View
   
Well then definitely a timer control over any kind of loop - it's the sort of thing they were designed for. You could have your box update every second if you want without eating computer resources.
A_Griffin 16-Nov-17 13:20pm View
   
Use a timer control (I'm assuming this is a desktop application?)
A_Griffin 16-Nov-17 8:40am View
   
use moment.js - https://momentjs.com/
A_Griffin 15-Nov-17 13:19pm View
   
Also, you can't say
If intersection.Count() = 1 Or 2 Then
I think you mean
If intersection.Count() = 1 Or intersection.Count() = 2 Then
A_Griffin 14-Nov-17 11:54am View
   
Unless you're really looking to do this for your own education, why reinvent the wheel? There are countless examples on the web about multi level menus, some using jQuery some vanilla JavaScript and some pure CSS. You could use them to teach yourself, if that's what you want, or on your website. There are paid ones you can use out the box, or code samples you can use to build your own.
A_Griffin 12-Nov-17 14:46pm View
   
Well, I've told you how to capture it - now you can pass it to a generic handler (an .ashx page) using AJAX. jQuery can help you with the latter.
A_Griffin 12-Nov-17 14:18pm View
   
No, I can't. Partly because I don't know enough about your project and partly because that's not how things work here. No-one is going to write "complete code" for you, most especially here in the "Quick answers" section. This is for specific answers to specific questions. You must do some research and try, then ask if you have a question on one point.
A_Griffin 12-Nov-17 13:34pm View
   
But you already have working code to capture the seat number - why change it? Simply add
var seatNumber = this.innerHTML
after the line: this.style.backgroundColor = 'red'
What you then do with it is up to you. Pass it to a generic handler via AJAX, or redirect the user to another page....
A_Griffin 12-Nov-17 13:14pm View
   
I am not an expert in SQLServer, but I thought your AND condition should be part of the WHERE conduition and come after the JOINs. eg SELECT ... FROM ... JOIN [JOIN...} WHERE ... AND ... ORDER BY
Also, can I suggest using the AS keyword to create simplified monikers for your tables - it makes the SQL more compact and, IMO, easier to read.
SELECT * FROM tbDESCRIPT AS D
LEFT OUTER JOIN tbSECTIONS AS S ON D.SECT_ID = S.ID ... ect
A_Griffin 12-Nov-17 12:52pm View
   
OK, well put the seat numbers in - they're not in your code. How you do that is up to you. But then you can capture when people click on a cell, just as you have done, and at the same time as turning it red you can use something like var seatNo = this.innerHTML which will then = whatever number is in that cell. You can then use that in whatever way you want.
A_Griffin 12-Nov-17 12:11pm View
   
I don't know why you would want to do that. It won't help you capture anything in real time. But it's not really clear what you're trying to do, I'm afraid.
A_Griffin 12-Nov-17 9:00am View
   
But the divs don't have any values in them? But a simple this.innerHTML in the same (or different) listener will yield any value you put in them, and you can send that to a generic handler (.ashx) via an AJAX call for processing.
A_Griffin 9-Nov-17 2:50am View
   
Wouldn't you be better off asking on the appropriate Infragistsics forum?
https://www.infragistics.com/community/forums/
A_Griffin 8-Nov-17 18:52pm View
   
A couple of possibilities here:
https://stackoverflow.com/questions/10366/style-display-not-working-in-firefox-opera-safari-ie7-ok

1. This worked for me with a similar problem, where Safari didn't set the display to block: My fix was to do
document.getElementById('editRow').style.display = ''; followed by
document.getElementById('editRow').style.display = 'block'; - tested on IE11, Chrome, Safari

2. won't displa properly here, but read the stackoverflow page - ans about replacing the page declarations
A_Griffin 5-Nov-17 7:22am View
   
The Jspdf project seems to be still very much a "work in progress". Personally, I wouldn't use it yet, but it looks interesting - I'll check back in 6 months and see how it's going.
A_Griffin 3-Nov-17 16:20pm View
   
Just change the one line to:
var ret = (keyCode == 13) || (((keyCode > 31 && keyCode < 127) && keyCode != 38 && keyCode != 60 && keyCode != 62));
A_Griffin 3-Nov-17 15:13pm View
   
what do you expect to happen when you press enter? IT's a single line text box...
A_Griffin 31-Oct-17 13:16pm View
   
well you need to debug and find out why, or where, at least.
A_Griffin 31-Oct-17 11:09am View
   
Well you'll need to filter the columns you search on then to only include those with string values
For c = 0 To userdatagrid.Columns.Count - 1
Select Case c
Case 2,4,7 ' whatever - the column indexes of those with string values
If userdatagrid.Rows(r).Cells(c).Value Like "*" & searcgcon.Text & "*" Then
bViz = True
Exit For
End If
Case Else
' ignore these columns
Next
A_Griffin 29-Oct-17 6:35am View
   
There are many API's you can use to do this - Google Map's GeoCoding API is one, or do a search for ZipTastic API. I believe the US Postal Service also offers an API for this.
A_Griffin 29-Oct-17 6:07am View
   
WHat's the problem? Only add a second attachment if it exists.
BTW, instead of Chr(10) & Chr(10) you could use vbCrLf
Even better, use a StringBuilder with .AppendLine
A_Griffin 29-Oct-17 4:31am View
   
I know this is a very old post, but just stumbled across it, and wanted to point out an easier way - just set this instead before setting the visibility:
MyGrid.CurrentCell = Nothing
A_Griffin 28-Oct-17 18:37pm View
   
If your program is crashing you need to either step through it line by line in debug mode, or at least wrap your code in Try-Catch blocks, to find out where the error is.
A_Griffin 28-Oct-17 14:33pm View
   
That won't help with your problem, though it could make your code more efficient. Make your DataTable globally available, then in the searcgcon.TextChanged event you can, instead of calling the database again, you could bind to a filtered DataView of the original DataSet. However, rebinding the gridview would still clear the checkboxes. You need to somehow save their state before re-binding to your filtered search results.

Or.... rather than search the database again, loop through each cell in the datagridview and check its contents against the search criteria - and set the rows visibility = whether or not a match is found. But this could be somewhat time consuming on a large dataset and not work well on every keystroke. If you take that approach you'd be better to have a separate search button they must click rather than do it on every TextChanged event.
A_Griffin 28-Oct-17 10:41am View
   
Not sure why you feel the need for the If condition in the searcgcon.TextChanged event code, but anyway... when you filter, the datagrid is repopulated after a new search, so of course any checkboxes will return to their default state, unless you somehow save it first. You could, if this is a single user application, add a column in your database table corresponding to the checked state of each row and save it there. Or have an accessible array or list where you can save the ID values of checked rows, then compare against that when re-binding (DataRowBound event)
A_Griffin 27-Oct-17 8:31am View
   
Yes, sorry - I misread the question
A_Griffin 22-Oct-17 10:45am View
   
Your question is far too broad. Load the items into a gridview or datagrid, where you can add/edit/delete them before saving.
A_Griffin 19-Oct-17 4:33am View
   
As Richard says above - no record is found. Also, if all you want is the StudentID then, if this is an Integer, it is somewhat wasteful to read it into a DataTable - a simple ExecuteScalar will read it into an Integer (or Double) variable, though again you should check for Nothing being returned.
A_Griffin 17-Oct-17 14:11pm View
   
The error is pretty clear. You are trying to insert a record with primary key value that already exists in the database.
A_Griffin 15-Oct-17 14:55pm View
   
I imagine it's a memory issue. But seriously... you need to re-think your code design. Whatever you're trying to do here, there is a better way, I promise you.
A_Griffin 15-Oct-17 11:44am View
   
This belongs in "Coding horrors".... not just passing any old data either, but an admin token!
A_Griffin 15-Oct-17 11:44am View
   
Deleted
This belongs in "Coding horrors".... not just passing any old data either, but an admin token!
A_Griffin 15-Oct-17 8:19am View
   
There are dozens of code examples on the Internet showing how to do this. Just Google "vb.net list files folders recursive" or similar
A_Griffin 3-Oct-17 11:33am View
   
DO you have the same version(s) of the .NET framework installed on each machine? IS the app targeting a framework that is installed on the W10 and Server machines? You can check (and set) what version to target when building it (via the project properties pages.)
A_Griffin 3-Oct-17 10:38am View
   
SELECT COUNT will always return an integer, unless there is an error. Check your SQL and database connection.
Also, it is BAD idea to build your SQL from string concatenation like that - ou leave yourself open to attack and input errors. You should use a paramatized query.
A_Griffin 1-Oct-17 14:46pm View
   
btw, just fixed a typo at the line
sOut += sIn.charAt(i);
It had an extra ) in before.
A_Griffin 1-Oct-17 14:40pm View
   
Then you're doing something else wrong - because HTMLAnchorElement.onclick (VM87 zadat.html:46) is not part of my code, is it?
A_Griffin 1-Oct-17 14:40pm View
   
Deleted
Then you're doing something else wrong - because HTMLAnchorElement.onclick (VM87 zadat.html:46) is not part of my code, is it?
A_Griffin 1-Oct-17 14:18pm View
   
.. and this DOES work! (As does the original...)
A_Griffin 1-Oct-17 14:07pm View
   
Well you haven't copy/pasted right then - because you can see for yourself that solveMe is defined. Try copy/pasting the entirety f my code and saving it as is as an HTML file and running it. Then worry about porting it into your code.
A_Griffin 1-Oct-17 13:55pm View
   
Well it's copy/pasted exactly from a page that worked for me. What's wrong when you try it?
A_Griffin 1-Oct-17 11:43am View
   
PS - NB I have refrained from even asking WHY you would ever want to do such a thing......
A_Griffin 1-Oct-17 9:24am View
   
Deleted
Where are you actually finding the values entered by the user? All I can see are a load of FindControl(objectName) which just finds the control as an object....
A_Griffin 17-Sep-17 10:33am View
   
I am not 100% clear:
You have 100 machines, which run at different speeds according to different sizes (of something) – is that right?
First off: are you sure you even need to store these in a table? IS there not a formula that can give you the results you want?
But, assuming you do, I think you have little choice – though I’d have thought the number of records should be the number of machines times the number of sizes which = 5000, which isn’t so bad.
A_Griffin 14-Sep-17 15:15pm View
   
Why are you checking for chkAllRadioButton.Checked as a condition when it is that which you are wanting to set?
chkAllRadioButton.Checked = [CBool](Details.chkAllRadioButton.ToString() = "true")