So I guess what I was trying to get at is this. Why are you trying to build the whole thing 2 dimensionally? Why not build your 'ruler' in one step and use the magic of Z-Axis to place the square wherever you'd like over top of it?

I'm somewhat curious why you wouldn't do something along the lines of the following:

1) determine the width of your primary rectangular div
2) determine the width of your central piece
3) deduct half the width of the central piece from half the width of your rectangular div
4) divide the remaining space by the number of increments you require
5) use float: left to place your fixed-width div containers with tick image (I find divs more cooperative than spans) from the left side in to the central piece and float: right to place your fixed width div containers with tick image from the right side in to the central piece and absolute position your central piece over top of the works in the middle.

Just a thought, but once you've done the maths to determine the width of your 'tick' divs it's just a matter of putting 4 floated left and 4 floated right and you're done with your ticks.

Feel free to ignore me though. I'm just tossing random thoughts out to try to help based on my interpretation of the required end result.

Essentially you're asking it to send a variable that for all intents and purposes does not exist. One option is to try what flexibleres suggested and set a default value so that it is going to send at least NULL to the stored proc. If you want to get more complicated you can set some basic error handling in your page-side script that checks for a value in the middle name and if there is none, THEN sends NULL to the stored proc. Either way, as long as at least NULL is sent (as opposed to nothing, which is vastly different) you shouldn't get this error.

The only catch here being that you cannot have a Not Null qualifier on your table column or it will REQUIRE a value no matter what, and NULL will not suffice.

So... my first question is... is this website hosted on a domain somewhere or is it hosted on your local computer?

The reason I ask this is because your connection string seems to be pointing at an access database on a local drive as such:
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\CitiesDatabase.accdb

So... if it's hosted online one might want to double-check the connection string to ensure it's properly pointing to the .accdb file location. One may also want to make sure that the perms on that file are set correctly in such a way that the code can actually reach the file (i.e.: readable/writable).

It's somewhat difficult to tell as the code you provided doesn't seem to fully encompass the connection string other than to reference a connection type and a .mdb file and doesn't indicate anywhere within where it would be referencing CitiesDatabase.accdb.

My thought is that, if it's not related to the code above... you may have data connections hard coded into the front end of your page in datatables or dropdowns or the likes which are pointing at local files instead of site resources.

Um... I guess first off the main question is do you know what pseudocode is?

In case you don't it's the written process of working out the logic for a given code problem. I.e.: The steps that will be required to reach a required conclusion. It doesn't involve actually writing the code itself, just the logical steps you'd take to get the job done.

Having said that... Are you really asking people here to do this for you?

Logout issue seems resolved for me (I didn't do anything on my end it just stopped logging me out as of some time after I went to bed last night).

Wow... Let me start by saying I love the new look. And I'm sure once it's all smoothed out it'll work great too :D

That being said...
1) I keep getting logged out every couple of minutes and I don't think it's my browser as I have zero issue with staying logged into any other site I'm on, my cookies are active, etc etc etc (insert list of common website connectivity reasons here).
2) I would have liked to have kept my "Practically a Posting Shark" title but when I went to modify something else found that my old (read: provided by DaniWeb prior to the change) title was longer than 20 characters.
3) I kinda liked/had grown attached to my old avatar but I'm guessing as it was stock from the old bb it had to go /pout

Edit:If it helps I'm using Firefox 11.0 btw and am on Win7 64 bit on a PC whose specs I'll leave out of it as they have nothing to do with this issue (and have been known to make my friends a bit green with envy)

Oh snap! I forgot to close this.

Yeah the issue was me being out of practice and completely forgetting that, while a C# program will carry forward variables from state to state, a web-based script will not carry said variables to the next page state without storing them in some way between states.

Being lazy, I'll just store the "answer" in an invisible field on the page as it's only a "Human Verification" deal and not of any grave security concern.

Thanks again for the help folks :D

I might point out, from a quick browse of your recent posts that the reason for the most recent down vote was most likely as a result of posting in a solved thread with a new question.

Generally, if you have a new and unique question it gets a new thread, if your question is "solved" by someone else's post's resolution then it gets no thread at all. Resurrecting someone else's solved thread to start your own question is generally looked down upon.

As mentioned above, however, if you didn't get reputation loss from it, it really doesn't affect you other than as a reminder that you perhaps didn't do something in the accepted way, which is kind of the point of the voting system around here last I checked :)

You know... I never thought about that... the thing I've been doing is generating (for testing sake) the answer into the hAnswer.Text at the point it's generated. It never occurred to me that during the postback of the page it might clear the variable...

I always kind of figured the point of a locally stored variable was to store info between states lol

Depending how you plan to go about it, it seems like a simple matter of assigning different functionality based on different access and ownership permissions.

You're going to need a database table of some sort for general authority levels (Admin, user, advertiser). You're going to need another table in that database to keep track of listings and who owns which ones (advertisers) to allow them owner specific permissions (review, modify, delete) once added. This additional DB table could also track the bidding or you could have a 3rd table for this purpose.

Beyond that, the "how" is really dependent on the media... It would be somewhat pointless for me to start throwing c# ASP.Net script at you if you prefer to work in VB for example. And likewise pointless for me to throw MS SQL database structures and/or queries at you if you're going to use some other method to store the data.

Well, as I said, if I insert a line that says hAnswer.Text = hAns it then places the value into hAnswer... following that, the comparison of hAnswer.Text to hAns should match but it still doesn't for some reason.

It's been a long while since I've last been here but I've spent the last 2 hours pulling my hair out trying to figure this out and I'm hoping for a bit of help with this one.

I have a question/response check (a human verification check) on my page and it refuses to work... I've written the code such that it generates the question and answer on Page_Load only on the first (non postback) load. I've generated a label which has it's text property pulled from the Question as generated on Page_Load and I'm trying to validate the answer from the generated answer from Page_Load. For some reason it always validates as false even if I put the answer straight from the expected answer into the text box I'm validating from.

Question/Answer Generation:
[code] private string hQuest;
private string hAns;

protected void Page_Load(object sender, EventArgs e)
    if (IsPostBack == false)

private void humQChange()
    humScript regHum = new humScript();
    hQuest = regHum.getHQuestion();
    hAns = regHum.getHAnswer();
    hQuestionLabel.Text = hQuest;

[code] private bool checkHumResp()
if (hAnswer.Text == hAns)
return true;
testLabel.Text = "Failed";
return false;
Even if I put a line of code in that tells it to fill hAnswer.Text with the value from hAns I still get a failure when validating one against the other. Both are string based variables so this isn't making any kind of sense to me.

Any suggestions?

[QUOTE=topxuchenghua;1446556]Lack of
sqlConn.BeginTransaction();[/QUOTE]Not sure if this is currently a standards requirement for TSQL or not but at the time that I wrote the snippets it wasn't absolutely required in order to make the code work.

My intention was to show the basic usage as required to complete the tasks as at the time it was a very commonly asked question and the snippets are sufficient to allow someone a working ability to fulfill the functions stated (with the exception of the above corrected typos of course).

I'm sure that the code could benefit from a plethora of refinements but still functions as stated :)

[QUOTE=lapssone;1434555]oh, my God, above what is written in the recovery are not in line with the meaning of[/QUOTE]Sorry if this seems rude but... um... huh? This post made no sense at all to me. What were you trying to say here?

[QUOTE=tom_289;1434423]on line 7 what does "feedbackAdapt" as i think its a parameter or sumthing....[/QUOTE]
Was actually a typo

feedbackadapt and feedbackconn should be sqladapt and sqlconn

Sorry for the confusion

Good Morning and welcome to DaniWeb.

Your thread is important to us and has been placed in a priority queue.

In order to expedite your thread please have the following ready:[LIST=1]
[]An example of the work you've done to solve this problem yourself
]An indication of any effort whatsoever
[*]Anything that indicates that you didn't just come here to have code spoon fed to you without any work on your part
[/LIST]Thank you for holding, the next available member will be with you shortly. While you are waiting, please feel free to review the following [URL=""]information[/URL] as it may help with your current needs.

1) it might help to share the specifics of the warning/error you are receiving as most people aren't going to be able to magically read your mind and determine the error you're receiving in order to help you solve it.

2) it might also help to share some of the code involved in the page that is generating the error... see point 1.

Other than that, I honestly don't know what's causing the error for you... my crystal ball has been in the shop for weeks now :twisted:

For return values use return...

if @count=0
insert into Author values (@authorname)
return 1
return 0

if 1 is returned then it succeeded, if 0 is returned then it failed.

At that point you simply check the returned value as it is received from the SQL server on completion of the stored proc and act accordingly in your C# program.

That being said, you can also be a bit more expansive with your returns and do an additional checking step to confirm successful insertion of the new record. This would require an additional return value however such that you have one for the name already in use (fail), one for name not in use but insert failed (for whatever unforseen reason) and one for successful insertion.

I threw this together to illustrate what I was trying to convey with my pseudocode before. Please note that the reason I used .ToLower() on my inputs is to ensure that all characters being compared are in the same case as upper and lower case characters count as different when doing a straight comparison. In order to get the same result with the second compared to first (instead of just first compared to second) simply add another pair of loops with the reverse order for the comparison and you're set.[CODE]static void Main(string[] args)
string unmatched = ""; // Define output string
string word1 = Console.ReadLine().ToLower(); // Read input of word 1
string word2 = Console.ReadLine().ToLower(); // Read input of word 2
char[] word1charArray = word1.ToCharArray(); // Convert word 1 into character array
char[] word2charArray = word2.ToCharArray(); // Convert word 2 into character array
bool match = false; // Matched character condition set

        for (int a = 0; a < word1charArray.Length; a++) // Iterate through characters in word 1 array
            for (int b = 0; b < word2charArray.Length; b++) // Iterate through characters in word 2 array
                if (word1charArray[a] == word2charArray[b]) // Check if current character in word 1 array matches current character in word 2 array and set flag if matched
                    match = true;
            if (match != true) // If no match through all characters in word 2 with current character in word 1 add word 1 character to output string
                unmatched += ...

It's not that it [B]cannot be done[/B] without stored procedures, it's more that it's not as secure to do so without stored procedures.

When dealing with login procedures it's safest to keep user and password variables from being passed around from place to place.

Using stored procedures keeps the entire process on the SQL server with no data being passed other than confirmation of valid or invalid results.


While I'm not about to go ahead and do your code for you I will do what I can to put you in the right direction.

Using the following method you should be able to determine the letters that are not repeated between the two.[LIST=1]
[]Input user selected words as character arrays
]Loop all characters in array 1
[]ForEach character in array 1 check each character in array 2 for equality
]if character from array 1 matches 0 characters in array 2 then append to string variable for output
[]as additional step you can loop all characters in array 2 and compare them to array 1 as well so that you get all characters from 2nd word that don't match first word as well
]output string with unmatched characters
[/LIST]Based on your original example "Computer Program" output for option 1 would be "Cute" output for option 2 would be "CutePga"

Well there's an option where you can pull the UN/PW from the DB based on a query which checks against the UN only and confirm the PW against the associated PW for the UN you pulled.

In doing this, even if the PW is incorrect you still verify that the UN exists.

However, if you're not careful with the coding then you've now pulled the PW into the code-behind as a variable which is potentially accessible.

What you [B]could do[/B] is have both functions as stored procedures on the SQL server however. Benefit of this is that the checks are all done on the SQL server and do not ever come across to the code-behind.

Basically... SP#1 = check if UN exists in SB
if SP#1 returns records == 1 then execute SP#2
SP#2 check if PW matches record for associated UN
if SP#2 returns records == 1 then execute login
else execute failedLogin

Dunno if that makes sense but hope it helps.

AngelicOne commented: good logic +1


"Rabbit, how and when are these deaths to occur in either case? You make a vague statement implying that I will kill myself by killing you or kill my family by not killing you, however you do not state how either party dies or when. Is it not possible that I can kill you, eat you, sew your hide into a nice hat and live to a ripe old age but still 'die' eventually based on what you say? Is it not further possible that I may spare you, find my way home, eat a nice big meal with my family and watch them grow old around me, eventually dying of natural causes based on what you say? Please define the terms of your statement more clearly."


EDIT: And when he's busy paying attention to me, the bear eats him... I shoot the bear and end up with a bigger meal, more hide to make clothes with, and food to bring home to my family as well...

Sulley's Boo commented: LOL +7


For shame... I thought I'd trained you better in the art of posting questions :twisted:

No code examples, no real details of any sort. You're breakin' my heart here man!

Besides, the family dying is likely a result of him going off the deep end due to starvation induced madness when he doesn't shoot the rabbit and eat it. And him dying is likely the result of the fact that the rabbit is running around with some unfortunate disease that's given it the ability to talk while being deathly toxic to eat...

((Now I'm just being silly so disregard this part))

The thing that gets me about this 'scenario' is that there are no timeframes set for either statement.

"If you shoot me you will die" Well, if you don't shoot it you will still die, some day.

"If you don't shoot me your family will die" Again, eventually, everyone dies.

Personally, I'd take the chance and shoot the damn rabbit. I'm hungry, he's food, and the latter threat involves potentially killing my loved ones where the former threat involves my own death. I have no place to make a decision on behalf of others for their lives so... shrug

[QUOTE=Ancient Dragon;1336957]just use the [noparse][color=red] ... [/color][/noparse] color tags.[/QUOTE]One thing I'm curious about here is whether your example requires the noparse tags you used in order to work. If so, that may be why I had no idea you could do this because I don't recall coming across something in the past which says "if you want to use special formatting within the CODE tag formatting segments, use this additional step to surround the formatting tags or they won't work.

EDIT: I'm obviously not awake yet this morning as the noparse portion was likely just to ensure that the tags you were giving as example would show up without the parser converting them... duh...

In either event, it's interesting to know that color formatting will work in [B]some situations[/B] while failing in others. It would be nice to have the ability to use the additional formatting options in all cases instead of a little bit here and a little bit there.

I find myself curious what language(s) if any you used prior to learning C#.

The reason I ask this is because I notice that you don't use any braces with your if/else statements. While they 'technically' can be omitted (as is evident from the fact that your code works without them) I've found that people whose first language is C# usually use them like so:[CODE]if (number % 2 == 0)
type = "even";
type = "odd";
}[/CODE]Whereas people who started with a language such as python let the indents do the work for them mostly. The only reason this came up is that it can make it easier to sort the conditions relating to each state within the if/else structure and ensure that code is being placed/executed in the correct places. Potentially, if not careful, the statement:[CODE]else if (number % 2 == 0)
type = "even";
Console.WriteLine(type);[/CODE]Could be misinterpreted as having the writeline only occurring during the 'else if' portion.

Again, just a curiosity was all :)

Relating to your question, I would definitely have to agree with ddanbe about simplifying your statements. For a multiple possibility if/else there is a definite use for 'else if' but for something where there are only ever 2 possibilities a straight up if/else is enough.

The one thing that concerns me is that, based on your original code, you should never have an unassigned value as there is only even or odd if dealing with an integer and it ...

Actually, to be honest I've found that it would be nice to be able to apply colour tags to lines of code that I'm trying to accentuate when posting code example responses or quoting the original code segment provided by the OP.

Unfortunately, the way the system currently reads the tags, it doesn't seem to read the colour formatting when it's within the code formatting tags.