Click here to Skip to main content
14,578,180 members

Comments by Wombaticus (Top 193 by date)

Wombaticus 10-May-16 9:36am View
Well, try debugging your code to find out where it's failing,. and why. AT the very least, wrapping it in a try-catch block should tell you something...
Wombaticus 10-May-16 7:28am View
Why does having multiple dynamic controls on the page prevent you from using a hidden field?
Wombaticus 9-May-16 10:56am View
Your SQL makes little sense - it effectively says:
update table set password = X where password = X
why is the password column in your where clause? And if you really mean it to be there, unless its indexed, no wonder your query takes a long time
Wombaticus 5-May-16 6:32am View
Don't know about web.sitemap - I just create a sitemap.xml file
Wombaticus 5-May-16 5:20am View
Yes, you'll need to regenerate the sitemap after every update to ensure ti contains links to all possible URLs - including one for each error code in your case.
Wombaticus 5-May-16 5:19am View
Yes, you'll need to regenerate the sitemap after every update to ensure ti contains links to all possible URLs - including one for each error code in your case.
Wombaticus 4-May-16 4:22am View
As Peter_in_2780 says, this limit is set by your ISP, not Outlook, so you can't do it. Maybe try a different ISP if you can. Or, if you MUST use email, you'll need to split the file up somehow. Or else use a web-service such as WeTransfer (Google it.)
Wombaticus 25-Apr-16 5:10am View
Well don't use a web-page - create a web service or just a simple generic handler to return the time value and nothing else.
Wombaticus 7-Apr-16 6:44am View
That is! But it's using VB, not C#. It's not hard to convert, you'll have to do that. There are online converters if you get stuck. Google "vb to c#"
Wombaticus 7-Apr-16 6:40am View
see below
Wombaticus 4-Apr-16 4:41am View
Rather than changing the user input using JavaScript (which is unsafe - what if they have JavaScript disabled?) - you'd do better to sanitise it in code after PostBack (and set ValiodateRequest="False" in the page directive to avoid the 'potentially dangerous Request' error).
Wombaticus 3-Apr-16 7:05am View
Try adding
Return false;
to your MyReset function.
Wombaticus 1-Apr-16 10:03am View
BY default ASP.NET has a 4MB upload file size - are you sure your video is actually uploading? You can increase this limit in web.config
Wombaticus 1-Apr-16 7:34am View
I've given you one! But I was assuming you have a textbox somewhere on the page that you want filled with the ID values. Then you do that as I said. If you want to create your textbox in the table using the Response.Write then you need to do that:
Response.Write "<input type=""text"" id=""IDs"" value="""
Response.Write oRS(IDs)
Response.Write """ />"

Wombaticus 1-Apr-16 7:13am View
I assume you've added
to the search button? And updated your javascript as I suggested?
Wombaticus 1-Apr-16 7:12am View
I assume you've added
to the search button? And updated your javascript as I suggested?
Wombaticus 1-Apr-16 5:57am View
If you want my advice, skip VS2010 and go for VS2012. And VS2008 if you really want an earlier version. 2010 sucks.
Wombaticus 4-Mar-16 6:20am View
yes... if an average search takes 30 minutes there is something you need to look at there... may be just a matter of adding some indexes to your database tables, or optimizing your SQL.
Wombaticus 4-Mar-16 6:16am View
I'd suggest that instead of using "visibility" use "display":
In your div tag style use display:none;
In your js use document.getElementById('divConfirmPrompt').style.display='inline';
...might help.
Wombaticus 25-Feb-16 11:42am View
You need to research responsive design / responsive CSS
Wombaticus 23-Feb-16 13:40pm View
This code is pure JavaScript and nothing to do with ASP.NET. Whatever your problem, it is not a .NET one.
Wombaticus 22-Feb-16 13:41pm View
This may help
Wombaticus 15-Feb-16 12:42pm View
You could use FTP
there are also free ftp wrapper classes out there. Google them.
Wombaticus 15-Feb-16 8:44am View
1. Validate dateTimePicker_Time.Text
2. Use a parametized query
Wombaticus 15-Feb-16 4:09am View
Your question doesn't make sense.... a DATETIME variable is not a string.
Wombaticus 15-Feb-16 3:10am View
I don't understand...
tempdate = Now
dt = Now, formatted nicely as a string
drDomain.CREATED_DATE = dt ( = Now) converted back to a date
WHat is the point of all that?

If you want to format the time Now for SQL then why not
string dt = Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
though persoanlly I prefer
string dt = String.Format("{0:yyyy-MM-dd HH:mm:ss.fff}", Now)
Wombaticus 15-Feb-16 3:10am View
I don't understand...
tempdate = Now
dt = Now, formatted nicely as a string
drDomain.CREATED_DATE = dt ( = Now) converted back to a date
WHat is the point of all that?

If you want to format the time Now for SQL then why not
string dt = Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
though persoanlly I prefer
string dt = String.Format("{0:yyyy-MM-dd HH:mm:ss.fff}", Now)
Wombaticus 15-Feb-16 3:10am View
I don't understand...
tempdate = Now
dt = Now, formatted nicely as a string
drDomain.CREATED_DATE = dt ( = Now) converted back to a date
What is the point of all that?

If you want to format the time Now for SQL then why not
string dt = Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
though personally I prefer
string dt = String.Format("{0:yyyy-MM-dd HH:mm:ss.fff}", Now)
Wombaticus 15-Jan-16 12:14pm View
Can't help directly but - and this is probably a cheat for which I'll get right-royally told off, but never mind :) - if your file is an .xlsx, then by changing that extension to .zip you can extract the contents into a number of .xml files. One of these, in a "xl/worksheets" subfolder will be called "sheet1.xml" (let's assume the data you want is in sheet1) and you can then easily extract the data from there via a number of XML-helper methods. :)
Wombaticus 15-Jan-16 6:54am View
OK, sorry - me not reading the question properly... :(
Wombaticus 15-Jan-16 5:30am View
AM I missing something? WHat's wrong with
select Date, UserName, TradeAmount from ListOfTrans order by Date desc limit 2
Wombaticus 18-Dec-15 16:51pm View
I would suggest you edit your post to remove your email addresses.
Wombaticus 11-Dec-15 7:24am View
cookieless=false means that session state is stored in a cookie
Wombaticus 5-Dec-15 13:19pm View
There is no single answer to this - the "best" solution is the one the developer feels most comfortable with.
Wombaticus 1-Dec-15 6:09am View
Double-posting is frowned upon....
Wombaticus 1-Dec-15 6:05am View
If it's called home.html why are you calling it with http://url/page.html? That aside, it's most likely you haven't configured IIS correctly, but without knowing what you've done there it really isn't easy to say much. But basically:
Have you application in a new folder;
Convert this into a web application in IIS;
You can test browsing to it within IIS - and check the URL it uses there.
Wombaticus 29-Nov-15 17:46pm View
Well... as long as it's only an assignment for college and not a real-world application I guess you can get away with it... like I said look to XML then.
Wombaticus 29-Nov-15 16:52pm View
What do you mean their computers don't support database connections? Why not? But if you want to store data in text files, you can.... I'd suggest you look at using XML files - but be aware that security will be somewhat limited....
Wombaticus 26-Nov-15 6:35am View
You can still use the WebUtility class for this
Wombaticus 26-Nov-15 5:21am View
Well, ok, but I don't think you need to create a helper method - can't you just use Server.UrlDecode to do it?
Wombaticus 26-Nov-15 4:52am View
%20 is the hex value for the space character - it is a good thing to have it there instead of a space, especially if you are going to create links or URL's with it.
Wombaticus 25-Nov-15 16:55pm View
There are a number of ways... you could simply add an
element after the table, and style it as you like using CSS. Or, you could add a border-bottom style attribute to your table, again using CSS.
Wombaticus 17-Nov-15 12:46pm View
Can't you add some error catching to find out?
Don't you need to give the full path to the picture file location, not a relative one?
Wombaticus 16-Nov-15 4:43am View
I haven't tried it, and it's not for me. I just note that the question asked for a VB.NET answer, and your answer is not in VB.NET.
Wombaticus 16-Nov-15 4:21am View
That's not VB.NET, but never mind...
Wombaticus 14-Nov-15 8:18am View
Well it looks like you have a function - maybe an event handler for a button? - somewhere in your code called "Convert", which is confusing things...
Wombaticus 13-Nov-15 3:22am View
This isn't how "Quick answers" works. You must try to solve it yourself, and ask here if you run into a specific problem, showing what you have done.
But, for starters, I would look at why your database query is taking so long you feel the need for a progress bar at all....
Wombaticus 11-Nov-15 17:44pm View
As far as the folders are concerned, that's normal even with v4.5 installed. Look in control panel (installed programs) to get a better idea of which versions are installed. Assuming you project isn't too large, if it were me I'd just re-build it from scratch - an empty project, add any project references it needs, then copy / paste the files from your original into the new project folder(s) and then including them into the project. You'll probably find it goes ok.
Wombaticus 10-Nov-15 17:54pm View
It's better to post your code here. No-one wants to click on a link that could be to anything...
Wombaticus 4-Nov-15 5:06am View
Seriously, why bother? All the user has to do is install a different PDF reader plugin....
Wombaticus 3-Nov-15 18:29pm View
You could start by searching the articles here on Codeproject - there are loads of them on just this topic
Wombaticus 29-Oct-15 4:20am View
I don't really understand the question. The CSS won't know what the corresponding code is; you'll have to provide it somehow. So just provide it - then you can use CSS if you want to style and position it, but a simple <br> with bnth inside a <div> would do it.
Wombaticus 28-Oct-15 4:30am View
OK, sorry, had the second bit wrong, should be
gvAgency.Columns(N).ItemStyle.HorizontalAlign = HorizontalAlign.Center
but setting
<asp:TemplateField ItemStyle-HorizontalAlign="Center" /><asp:TemplateField>
is OK. Both these methods work for me in VS 2012 and .NET 4.5
Wombaticus 27-Oct-15 18:13pm View
You seem to have missed out the onclick event on your buttons... but that aside, you can easily pause and resume the display by adding two buttons
<INPUT TYPE="button" NAME="pauseTime" VALUE="Pause Timer" />
<INPUT TYPE="button" NAME="resumeTime" VALUE="Resume Timer" />
and two corresponding functions
function pauseTimer() {
running = false;
function resumeTimer() {
running = true;
timerID = setTimeout("showCountDown()",1000);
However... this just pauses the display, time itself does not stop, so on resuming it carries on as if the clock had been counting down all the while. If you want to carry on with the next number down you should use a counter to count down, not the real time.
Wombaticus 27-Oct-15 17:43pm View
What IDE are you using, and what version .NET?
Wombaticus 27-Oct-15 17:43pm View
What IDE are you using, and what version .NET?
Wombaticus 27-Oct-15 14:54pm View
An asp:Dropdownlist renders as a select element; there is no difference.
Wombaticus 25-Oct-15 6:58am View
If you've just copy/pasted this
from you code, then there's the error right there: you've missed the opening < on the closing tag. Anyway, you could write
<XMLAuthenticateRequest />
Wombaticus 24-Oct-15 3:55am View
It's a standard table, just add a style selector to each alternate row with the style set to give it a bottom border. (And likewise give the whole table a top border)
Wombaticus 23-Oct-15 12:54pm View
Thanks - I'd missed that TIME_TO_SEC function. Much better than my clunky solution above!
Wombaticus 23-Oct-15 8:01am View
Well a redirect won't help - generic handlers don't produce a response that will show up - you'll just get a blank screen. You either need to read the response in JavaScript or, if your handler does something like write to a file or send an email you can test the response that way. But I'm afraid without seeing much more of your code there's not much to go on...
Wombaticus 23-Oct-15 7:01am View
Well what is the error? It can't be the XML Parsing error in your title. It's more likely a javascript error in a calling page, but there is not enough information here to know.
Wombaticus 23-Oct-15 6:40am View
How can that possibly return an error? Are you trying to read that response as XML? You've sent plain text, which it is there. But when you do want to return XML you should set the response.contenttype to "text/xml"
Wombaticus 23-Oct-15 5:11am View
Your code above has nothing to do with XML...?
What has the variable sImgName got to do with anything?
Why respond with "File not exists" if Request["image") is NOT = "" ?
Why not wrap the whole lot up in a try..catch block to find out just hwat the error is?
Wombaticus 23-Oct-15 4:08am View
or, you could use the split() function using " " as the delimiter, and examine the array returned to get your command.
Wombaticus 23-Oct-15 4:02am View
SO you want to end up with a v, a or p? You could use the same method then but look for a space instead of a - sign, and use I+2 instead of I+1. Or, check first for i=url.lastIndexOf("-"). if we can assume that this custom command comes at the end. Or, finally, if it is always at the end, you could simply extract this last letter using url.substring(url.length-1,1), though you'd have to check first that there is a custom command at all, again by checking for a space.
Wombaticus 23-Oct-15 3:40am View
Can you be a little more clear about what you need to extract then? In the example
what are you looking to end up with?
Wombaticus 23-Oct-15 3:00am View
Sorry, yes, my bad. I should have written
Wombaticus 22-Oct-15 17:09pm View
Thank you! (For the record, timediff only accepts two parameters, and you missed and AS in 'AVG(TimeDifference) AvgTime', but still you got me there! :)
Wombaticus 22-Oct-15 6:31am View
Don't know where you get your value of 72 from... safer not to hard-code things like that - better:
i = url.indexOf("-");
if (i>0) {
var customCommand = url.substring(url, i+1);
Wombaticus 20-Oct-15 6:01am View
It doesn't matter as I only want to count rows - but really 'SessionID' shouldn't have been in that 1st SQL query at all - I've removed it now
Wombaticus 20-Oct-15 5:25am View
It doesn't matter, you could use either - it's only counting the number of rows.
Wombaticus 13-Oct-15 10:56am View
Well, don't submit teh form with a submit button - use an ordinary button and add an onclick function to call teh javascript function
Wombaticus 13-Oct-15 6:19am View
First thing you need to do is add some onclick handlers to your buttons....
Wombaticus 12-Oct-15 17:47pm View
It's most likely an IIS thing - if it were me, I'd put
"The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler"
into Google....
Wombaticus 8-Oct-15 7:13am View
Wombaticus 8-Oct-15 7:11am View
And your question is....?
Wombaticus 7-Oct-15 18:15pm View
So long since XP.. but I used to run multiple sites on it. Don't know but what's wrong with using the IIS management console? You can easily set up separate applications using that.
Wombaticus 25-Sep-15 5:31am View
My mistake - I was thinking it was an application. Anyway, the first thing you need to do is figure out exactly where the error is occurring. Add a breakpoint after the showdialog line then hit F5 to run the program. It will stop at the breakpoint and then step through your code one line at a time by hitting F11 til you hit the error.
Wombaticus 23-Sep-15 12:13pm View
Most likely you haven't re-populated the grid on postback...
Wombaticus 16-Sep-15 16:38pm View
I'm not sure I understand your problem... but you say "I can make the modal and I can make the alert but I can't figure out the code to connect the two." I think maybe what you're looking for is to add an onblur event to your text box which calls your javascript function.
<input type="text" onblur="myfunction" />
and myfunction() will chekc if the imput is valid and popup the modla if not. (In .NET code you add this by (if you have an <asp:Textbox ID="txt1" runat="server" />)
txt1.Attributes.Add("onblur", "myfunction()")
Wombaticus 16-Sep-15 12:04pm View
There are a few articles here on CP about this - this one has a prety simple and configurable solution
Unless you're suing jQuery-ui elsewhere, it's a bit sledgehammer-and-nut approach to this.
Wombaticus 7-Sep-15 12:56pm View
Indeed... well, using
document.getElementById('ques29').className = 'cname';
should. (i.e. use the ID of teh label, not teh radio button.
Wombaticus 7-Sep-15 12:43pm View
If thr condition is not met in your code above, then pos is left undefined
Wombaticus 7-Sep-15 12:38pm View
I would imagine you can just use
document.getElementById('ques29').className = 'cname';
where ques29 is the ID of the radio button, and cname is a style defined in your CSS, such as
.cname { font-weight: bold;}
Wombaticus 22-Aug-15 9:54am View
WHy would you want to use Java? It's not a good language for websites, as it requires a browser plugin to be enabled, and many peoiple don't like it.
If you mean Javascript, then no - it will be part of the solution, but not all of it. People are viewing your page in their browser on their machine, and you need to get the information back to your server and process it there, so some kind of server-side language, such as or php will be needed.
SQLite is a very lightweight databse solution that requires no installation - just a reference to the dll, and it stores data in files. That really would be your simplest way to go - acheiving what you want could be done with not much code at all. But no, I am not going to write it for you. You must try yourself, and ask for help if you get stuck on any specific points.
Wombaticus 22-Aug-15 5:48am View
MsgBox does exist in VB.NET... I get your point, but not sure I really agree with it; VB.NET would be the natural progression, and I can't help but feel that it elicits an unfairly negative response amongst those that consider themselves "real" coders. The whole thing about .NET is that each of the languages target the same framework, so to a degree the choice of language is immaterial. I say "to a degree" because performace will still be an issue for certain applications, but I'd wager that for the majority of real-world business applications C# offers no advantages over VB. There may be an argument for C# in terms of finding a job, but purely in terms of the language iteself... nah, I don't see it. Which is better for the OP I'd suggest depends on their skills, and what they want to achieve. If they want a job, perhaps yes go for C#. If they're just coding for a hobby, they may be better off sticking with VB.
Wombaticus 21-Aug-15 8:23am View
You need to add an id="age" attribute to your input markup. "name" is not teh same as "id"
Wombaticus 18-Aug-15 9:30am View
Why are you selecting MAX(year) if you want the highest qualification? I would have thought you'd want MAX(b_Id) in there somewhere.
Wombaticus 1-Aug-15 11:50am View
Yeah - mind you, it still seems a bit wasteful to have to convert a date to a string and then bsck to a date again. Things like
If IsDate(ds.Tables("tbl").Rows(0)("datecolumn")) Then...
will fail for valid dates, and
ANd just trying to assign
to a date variable gives the error without first jumping through this hoop of converting to a string and back again....
Wombaticus 1-Aug-15 11:42am View
Ah, YES! Well done - that works :)
Wombaticus 1-Aug-15 11:30am View
still gives the same error
Conversion from type 'MySqlDateTime' to type 'String' is not valid.
Wombaticus 1-Aug-15 11:06am View
No it's nowt to do with that, ta
Wombaticus 1-Aug-15 11:04am View
01/08/2015 14:23:29
and then
d = CDate(ds.Tables("tbl").Rows(0)("datecolumn"))
gives the error....
As mentioned above, I can "solve" this by amending my SQL to
select DATE_FORMAT(datecolumn, '%d-%M-%Y %H:%i:%S') as datecolumn from datatable where ID = 1
but this seems very wasteful, converting to a string and then back again to a date (in code)
Wombaticus 1-Aug-15 11:04am View
01/08/2015 14:23:29
and then
d = CDate(ds.Tables("tbl").Rows(0)("datecolumn"))
gives the error....
As mentioned above, I can "solve" this by amending my SQL to
select DATE_FORMAT(datecolumn, '%d-%M-%Y %H:%i:%S') as datecolumn from datatable where ID = 1
but this seems very wasteful, converting to a string and then back again to a date (in code)
Wombaticus 1-Aug-15 10:47am View
Ta, but I found that page already and it doesn't help
Wombaticus 1-Aug-15 10:43am View
I'm actually running this in an ASP.NET page (Sorry, bad tag to the Q)
If I add a line
sb.Append(ds.Tables("tbl").Rows(0)("datecolumn").GetType.ToString & vbCrLf)
It writes out MySql.Data.Types.MySqlDateTime
Getting the value is the problem...
As a workaround I can amend the SQL to
select DATE_FORMAT(datecolumn, '%d-%M-%Y %H:%i:%S') as datecolumn from datatable where ID = 1
and this works, but I would prefer not to have to go round altering all my SQL statements.... besides, it's a bit wasteful converting dates to strings and back again.
Wombaticus 19-Jul-15 12:55pm View
There is no excuse for such rudeness as this. You should be ashamed.
Wombaticus 16-Jul-15 9:12am View
Well, why not do what that error page suggests, and that will give you a better idea where the problem lies.
Wombaticus 16-Jun-15 3:31am View
I don't know what to say, I'm afraid - the above works for me. As an alternative to using appSettings in web.confog to hold such values thogh, you may want to consider using Application variables in a global.asax file. Set them in Application_Start - eg:
Application("Version") = "8.5"
and then you can read them anywhere you want in code behind using
... = CStr(Application("Version"))
or in JavaScript
... = '<%= CStr(Application("Version")) %>';
Wombaticus 14-Jun-15 15:27pm View
What .NET version are you using?
Wombaticus 7-May-15 17:49pm View
Next step si to take account of the current month and day, to see whether or not they have turned 18 if the current year - their date of birth = 18
Wombaticus 7-May-15 17:45pm View
Well, start by searching your code for any statements that set LblFarmID.Text
Wombaticus 19-Apr-15 6:08am View
It wonn't. The src attribute needs to be a URL, absolute or relative, but a URL.
Wombaticus 15-Apr-15 5:37am View
Try casting it to int, for starters...
Wombaticus 15-Apr-15 4:03am View
I mean just two separate tests:
if (a=='') {a='0';}
if (b=='') {b='0';}
Wombaticus 14-Apr-15 18:38pm View
what's with the "else if" ...? Check a, then check b, independently.
Wombaticus 21-Mar-15 12:11pm View
Page_Load is called before your Register_Users event handler. You need to understand page lifecycle, and in particular the IsPostBack event.
Wombaticus 20-Mar-15 19:29pm View
I would think the strUrl in the 4th parameter needs to be eclosed in apostophes thus:
"ShowSubscribe('" + strUrl + "')"
Wombaticus 27-Jan-15 17:02pm View
A quick and dirty way of sorting anything in winforms applicataions is to add a listbnx, set visible=false and sorted=true, add the items to that, and let it sort them for you - then just read them back in order.
Wombaticus 19-Jan-15 12:22pm View
I would presume you should check for this condition first then - something along the lines of
If queueMAILSERVER.Result Is Nothing Then...
Wombaticus 5-Jan-15 3:24am View
Works for me - try instead (which is the homepage - it's the 360 tool you'd be interested in) - or else just Google MagicToolBox
Wombaticus 12-Dec-14 5:45am View
Try reading what you have written as a stranger would (i.e. anyone else here) and ask yourself: what can we possibly say about it, or help you with?
Wombaticus 3-Dec-14 13:49pm View
The button event must be fired - put something else in there to test it and you'll see.
DO not rely on session timeout - especially on development machines running XP or Win7 (i.e. not Windows Server.) If you really want to ensure continuity, I suggest you use cookies.
Wombaticus 16-Nov-14 16:29pm View
Well of course it will - there is no player input in your Do...Loop
Wombaticus 27-Oct-14 6:19am View
Personally, I stopped using session state in my applications years ago. I much prefer to use cookies instead, over which I have complete control.
Wombaticus 23-Oct-14 6:38am View
Try looking at HTML Agility Pack
Wombaticus 22-Oct-14 8:34am View
Are you quite sure? A common mistake is that the after the first time you are appending items to the second drop down without first clearing the old items - as they appear at the end, you may not have noticed them...
Wombaticus 9-Oct-14 11:07am View
Do you really want content providers being able to decide what cookies can and can't be set on your computer? Do you not think that you, as an end user, should have total control over that?
Wombaticus 9-Oct-14 10:33am View
You can't, is the simple answer. Browser policies on cookies are set by the end user, not the content providers.
Wombaticus 14-Sep-14 9:05am View
Timer1.Enabled = False
in the Timer!_Tick event. But what's the point of the Timer? WHy not just put your Sendkeys in the Button click event?
Wombaticus 13-Sep-14 12:57pm View
> if other people will see my process on task bar
Then look to ways to stop it from showing on thr task bar - that is a different problem easily managed.
Wombaticus 11-Sep-14 9:18am View
I would help but, sorry, I failed my mind-reading course at Hogworts.
Wombaticus 8-Sep-14 6:42am View
whatr's the extra + after teh final null doing?
.... Casl.CASLEXCEPTION is null)+";
Wombaticus 7-Sep-14 6:40am View
Do it in the RowDataBound event - get the value of the Status column for that row and set the forecolor apprpriately.
Wombaticus 25-Aug-14 14:25pm View
Are you re-binding your dropdownlist items in page_Load on postback? It should work otherwise.
Wombaticus 20-Aug-14 7:03am View
see the comment titled "Total crap" on this article
Wombaticus 18-Aug-14 4:12am View
UPDATE MAWB SET Weight = '0' WHERE Weight = ''
before your ALTER statement.
Wombaticus 18-Aug-14 3:46am View
Check your data integrity - perhapos set all empty string values to 0 first.
Wombaticus 16-Aug-14 9:09am View
Presumably your delete operation is tied to a button click event of some kind, in which case you would do better to assign the confirm dialog to that - eg
Button1.Attributes.Add("onclick", "return confirm('Do you really want to delete this?')")
Wombaticus 12-Aug-14 7:17am View
also try 4guysfromrolla
either browse or search for what you want. They have tons of good learning articles there.
Wombaticus 11-Aug-14 5:10am View
Google for SQL bitwise operators
Wombaticus 10-Aug-14 9:10am View
There are loads of code samples already online for this - use Google.
Wombaticus 8-Aug-14 12:00pm View
Try here
Wombaticus 8-Aug-14 8:38am View
Your .Close method is being called after the return statement - so in fact is not being called at all
Wombaticus 5-Aug-14 6:11am View
If it was me, I'd convert FromDate to a date representing the 1st of the month of FromDate, and ToDate to the 1st of the month following ToDate (both simple operations doable with a single line of code each) then use a simple SQL statement with these:
select * from #Table where myDate between FromDate and ToDate
Otherwise you're going to have some rather ugly SQL to deal with...
Wombaticus 3-Aug-14 8:34am View
Best solution? Get a better web host. There is no excuse for your site being down for prolonged periods of time.
Wombaticus 1-Aug-14 9:11am View
Perhaps this will help then
Wombaticus 1-Aug-14 7:06am View
What's wrong with just Request.ServerVariables("REMOTE_ADDR") ..?
Wombaticus 31-Jul-14 13:18pm View
page_load is called before OnItemDataBound, or indeed before any controls' events.
Wombaticus 26-Jul-14 10:33am View
Your understanding is wrong.
Remove your // script tags and it won't work - the // are only comment identifiers within javascript, not html - so html ignores them and reads teh script tags as normal.
Wombaticus 26-Jul-14 10:04am View
Why? What are you hoping to achieve?

For inline code, yes, it s mandatory. Javascript calls can be made within event handlers though without it - eg: <input type="button" onclick="alert('hi')" />
Wombaticus 26-Jul-14 8:20am View
It's a tricky one this - but really, rather than redirecting users after a post back, you might do better to add a javascript function to redirect them from the cleint side instead.
Wombaticus 24-Jul-14 5:47am View
In that case you may want to look at a VPS (Virtual Private Server) - half the cost for the same functionality, and move to a dedicated one later only if demand dictates.
Wombaticus 24-Jul-14 5:33am View
I am not clear what ASP.NET has to do with this, as you seem to be implying you are trying to do this via a SQL statement? I suggest you look at the CAST and CONVERT functions in SQL
Wombaticus 24-Jul-14 5:27am View
I really don't think you can run this from a shared server. I think you'll need to create an application that will run on a schedule from your friend's home/office server to do this - shouldn't be a problem assuming you have remote access to the database (ie not only from localhost). You may also need to use a third-party email relay service to send the emails, dependiong on how many there are and the policies of the hostiong company.
Wombaticus 24-Jul-14 4:28am View
Most forms of SQL allow you to retrieve dates from the database pre-formatted as you want, which will be a much simpler solution.
Wombaticus 18-Jul-14 6:07am View
You're only returning one row - that with the given ID number. You're confusing this with the row number, hence your error.
Wombaticus 3-Jul-14 18:20pm View
I would try calling your buildstring() function from the onclick event of the submit button isntead, and within that use the setAttribute method to set the forms action property to the string str, and simply return true from the function. I would also suggets removing all spoaces (or repalce them with underscores or hyphens) in the filename/string yuou create.
Wombaticus 27-Jun-14 4:57am View
The first step is to find out which part of page/code is causing this. As I said, URL-rewriting is one possible cause, if you are using that. Or Server.Transfer, maybe? If not, are you dynamically changing any server controls? An example maybe some linked lists, so when the user selects something in one, the second changes accordingly?

If nothing else, try removing controls one by one until (hopefully) you find it works - once you know where the problem lies you can find a way to solve it. It's a bugger of a problem though, which can be very hard to track down and solve.
Wombaticus 26-Jun-14 8:38am View
This is a nightmare error, as it can have so many causes ... one rarely documented one is if you are using any kind of URL-rewriting ..

You may also want to try adding the following to your system.web section in config:
<pages renderAllHiddenFieldsAtTopOfForm="true" controlRenderingCompatibilityVersion="4.0"/>
<httpruntime requestvalidationmode="2.0"/></httpruntime/>
Wombaticus 26-Jun-14 8:33am View
Have you tried a simple Reset button?
<button type="reset" value="Reset">Reset</button>
Wombaticus 20-Jun-14 4:04am View
Sorry - change the ByRef in the function definition to ByVal - as it is, your ornum value is being set to 0 on each call
Wombaticus 19-Jun-14 12:24pm View
Not sure what's wrng with your code, but a simpler function would be someting like

Function fBase26Encode(ByRef lngNumToConvert As Long) As String
Dim s As New StringBuilder
If lngNumToConvert > 0 Then
Do While lngNumToConvert <> 0
s.Append(abc(lngNumToConvert Mod 26))
lngNumToConvert = lngNumToConvert \ 26
End If
Return StrReverse(s.ToString)
End Function
Wombaticus 3-Jun-14 8:21am View
Can I suggest you do NOT use this solution unless there are compelling reasons to do so? It has a lot more overhead than is necvessary for a simple drop-down menu, and a pure CSS solution (i.e. no Javascript) is always preferable where possible. Finally, you will not learn very much, other than manipulating some jQuery.
Wombaticus 3-Jun-14 7:39am View
Try Googling for "CSS dropdown menu" and you will find lots of tutorials and code examples
Wombaticus 25-Apr-14 3:58am View
Well in that case I think you may need to look at using an HttpWebRequest instead, as that will run in a separate thread.
Wombaticus 24-Apr-14 17:32pm View
Not sure if this is relevant, but have you looked at asynchronous vs synchronous AJAX ?
Wombaticus 28-Mar-14 6:55am View
Also, you should declare the imag without "new" at the top, then set = new on each loop
Wombaticus 28-Mar-14 6:53am View
"For Each c As Control In tc.Controls"
If there are no controls in the cell, then this loop won't execute - might that that be teh case?
Wombaticus 18-Jan-14 14:03pm View
This is an annoying problem which can be caused by a number of issues. IF you Google it you will find all sorts of advice, none of which helped me. Eventually I stumbled across something that worked, but it may only help you if your application is using the .NET 4 or 4.5 framework - in which case try adding
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
to the <system.web> section of your web.config file.
If that's not applicable, or doesn't help, try Googling this error - as I say, there is a ton of information out there....
Wombaticus 17-Jan-14 11:49am View
Oh yes - spot on. Silly me - should have seen that one!
Wombaticus 17-Jan-14 11:35am View
I believe you... I believe MIcrosoft... but all I can tell you is that
cs.CommandText = "select min(ID) from some_table_with_no_records"
If objCmd.ExecuteScalar() Is Nothing Then ...
will throw the exception
Conversion from type 'DBNull' to type 'String' is not valid.
If objCmd.ExecuteScalar() = Nothing Then ...
Operator '=' is not defined for type 'DBNull' and 'Nothing'.
and I have to use
If objCmd.ExecuteScalar() Is DBNull.Value Then ...
in order to get the right result.
Perhaps the fact I'm testing against MySQL is relevant here?
Wombaticus 17-Jan-14 11:25am View
If you say so - but in my VB tests I have to test against DBNull.Value to catch cases where there are no records returned - seems odd that C# and VB should treat this differently.
Wombaticus 17-Jan-14 8:49am View
I don't know about C#, but in VB you can't test ExecuteScalar = null like that - you have to use
If cs.ExecuteScalar() Is DBNull.Value Then ...
Wombaticus 13-Jan-14 9:13am View
In VB you just set the page size when creating the doc:
Dim pdfDoc As New Document(PageSize.A4)
...whatever that is in C#...
Document pdfDoc = new Document(PageSize.A4);
or something...
Wombaticus 8-Jan-14 6:28am View
hmm.. don't think it's quite as simple as that, unfortunately. I just tried this on a table of my own and it returned all rows with an A,B,C,D or E somewhere within the target field, not just those beginning with one of these. I then tried
but still with no luck....
Wombaticus 8-Jan-14 6:27am View
hmm.. don't think it's quite as simple as that, unfortunately. I just tried this on a table of my own and it returned all rows with an A,B,C,D or E somewhere within the target field, not just those beginning with one of these. I then tried
but still with no luck....
Wombaticus 7-Jan-14 4:32am View
I don't find the examples on that page the least bit enlightening. I'd be interested to see how you would use regexp in this case - that might help me learn how to use it!
Wombaticus 5-Jan-14 9:25am View
This will be a web-server setting binding the domain to the site - the server administrator needs to bind both and also to the site.
Wombaticus 7-Dec-13 9:00am View
To not print certain controls on a form add a style sheet with its media property set to "print" - eg
<style type="text/css" src="path_to_css_file" media="print" />
and in that set
for any elements you don't want to print.

As do the URL at the bottom, that is a prnter setting on the client side, and there s nothing you can do about that.
Wombaticus 7-Dec-13 8:40am View
Fetching a text file from a remote server has nothing to do with ODBC. There are lots of ways to do this: Use FTP or (better) look into the WebCLient class
Wombaticus 7-Dec-13 3:51am View
You're welcome - do you have it working now? No, I don't have a blog... I'm too busy for that! :) (Or maybe I'm just too slow - othe busy people seem to manage ti...)
Wombaticus 6-Dec-13 13:43pm View
Suppose 90260 has
latitde = 34.534
longitude = -110.245
then your query would be

SELECT zipcode, ( 3959 * acos( cos( radians(34.534) ) * cos( radians( latitde ) ) * cos( radians( longitude )
- radians(-110.245) ) + sin( radians(34.534) ) * sin( radians( latitde ) ) ) ) AS distance
FROM dbo.ZIP HAVING distance < 25 ORDER BY distance ASC

(Take out the distance and having clause if ytou want to test it for all values)
Wombaticus 6-Dec-13 13:36pm View
If you want to find zipcdes within 25 miles of zipcode 90260, you need to first get teh latitude and longitude of 90260, adn use those in the query in place of YOUR_LATITIUDE and YOUR_LONGITUDE
Wombaticus 6-Dec-13 13:33pm View
I don't understand what numbers you are using in your query... you are supposed to enter the latitude adn longitude. 90260 is not a valid number for any latitude - it only goes from -90 to +90, and longitude from -180 to +180
Wombaticus 6-Dec-13 13:02pm View
DId you try my last suggestion above? I don't have or use SQLServer, so can't run a direct comparison, but all I can say is that the query I have works for me, and according to the documentation SQLServer treats HAVING just like WHERE when used without a GROUP BY clause (as is teh case here) so it really ought to work for you.
Wombaticus 6-Dec-13 12:42pm View
hmm.. ok, well in that case try that same query just replacing HAVING with WHERE:

SELECT zipcode, ( 3959 * acos( cos( radians(94595) ) * cos( radians(latitude ) ) * cos( radians(longitude)
- radians(94595) ) + sin( radians(94595) ) * sin( radians(latitude ) ) ) ) AS distance
FROM dbo.ZIP WHERE distance < 25 ORDER BY distance ASC
Wombaticus 6-Dec-13 12:36pm View
What database are you using? It seems most odd giving that error when (if) you have specified "AS distance" in the query
Wombaticus 6-Dec-13 12:25pm View
I don't understand - it won't work using a WHERE clause instead of a HAVING one.
Wombaticus 6-Dec-13 12:12pm View
well your query is completely different from what I gave you, so I can't comment.... why do you have such a complex WHERE clause? You don't need a WHERE clause at all, just the HAVING one I gave.
Wombaticus 6-Dec-13 12:04pm View
If I was you, I'd convert the lat/long fields in my database to a numeric format, and save the problem of converting them in the SQL query.
Wombaticus 6-Dec-13 12:00pm View
Well it depends on what database you're using but most will have a CAST or CONVERT function - eg
radians(convert(YOUR_LATITUDE as float)) (or whatever)
Wombaticus 6-Dec-13 12:00pm View
it's just a constant - it's the way the maths works out.
Wombaticus 6-Dec-13 11:54am View
Well it depends on what database you're using but most will have a CAST or CONVERT function - eg
radians(convert(YOUR_LATITUDE as float)) (or whatever)
Wombaticus 8-Nov-13 5:41am View
You want spaces separating your menu items? Try adding
margin-right: 10px;
to the style for these list items (.menu li)
Wombaticus 3-Nov-13 8:46am View
Within Visual Studio you can set this via the project's properties pages, where tehere is a checkbox labelled "Enable XP visual styles" - also see
Wombaticus 23-Oct-13 3:16am View
Gooogle "Windows Task Scheduler" for your operating system. It's a feature of Windows that allows you to run programs automatically on a schedule that you set - e.g. every 5 minutes, in your case.
Wombaticus 22-Oct-13 12:45pm View
I'd be tempted to build an index table - parse each sentence in turn and store each word along with its Sentence_ID in this. You'll then be able to retrieve results very quickly, as well as order them by the number of matches etc. Of course you'll need to re-index each time the sentences table is updated.
In fact... if you stored the word's posution in the sentence as well, you could even do away with your sentence table altogether :)
Wombaticus 22-Oct-13 8:31am View
Or, (better, IMO), build the app to send just a single email, then run it as a scheduled task to execute every 5 minutes.
Wombaticus 16-Oct-13 7:00am View
OK, well OnRowCommand is a postback event, so there's no point putting your code there. You need to call your javascript in the OnItemDataBound event, and prevent the postback.
Wombaticus 16-Oct-13 6:41am View
You most likely have an error in your javascript then
Wombaticus 16-Oct-13 6:07am View
You need to pass your values as paramaters to the openpopup function, not as the CommandArgument, which is not relevant here.