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 :)

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 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

After reading through a few days of rather intense conversation on this matter I figured I'd toss in my 2 cents worth here for any who care to read it.

1) A recurring point that seems to be coming up is whether or not the U.S. Military has the right to ban the sale of a product within establishments that fall within their jurisdiction on their property. First, it's U.S. Military property, they have the right to say that bars of soap are not allowed to be sold there if they want to. Second, contrary to popular belief, the U.S. Military does not answer to or have to abide by civil legal or constitutional standards. They have their own legal code and rights standards in place and are a separate entity from the rest of the country in that regard.

2) Another point that seems to be at issue is whether or not it is right to play as the bad-guy in a military video game. This argument is particularly strengthened by the fact that it just so happens to be a recent bad-guy in our world's history. While I can admit to a level of distaste in the idea of playing as a 'terrorist' even in a fictional sense, can you honestly say it's any different from playing the Russians or N.O.D. or any other bad-guy in any other military style game that's come out where cross-faction play has been possible?

3) People have made a big deal over ...

jon.kiparsky commented: Well put. +1

An example of where a DIV can do what a table cannot do would be the following:

Person wants to have a graphic centered inside a group of text with the text wrapped around the graphic. (ok, table CAN do this...).
Person further wants to have some text placed directly over top of the graphic, separate from the text that's wrapped around it (Uh oh, table can't do this).
Person wants a segment of their page to persistantly appear in the [B]exact same location[/B] every time the page is shown, regardless of other page content (Absolute positioning of DIVs can do this).

Elihu5991 commented: Now you really have me wanting to learn DIVs. I've always wanted to though but this is a really good point. +0

[QUOTE=LevyDee;1310825]For instance, in my for conditions, I cant say, (int i = 0; i != songs.count; i++) like I would be able to in c++.[/QUOTE]For that one I would say this instead:[CODE]for (int i = 0; i < songs.Count; i++)[/CODE]Since Count is based on numbers starting at 1 and the array is based on numbers starting from 0 this will effectively stop the FOR loop prior to going out of bounds.

[COLOR="green"]EDIT: Just thought of this but it may be songs.Length instead of songs.Count... hmm... brain not working today, not sure.[/COLOR]

Otherwise, your method appears sound.

Hope this helps :)

I'd recommend that you check out the following [URL="http://www.google.com/#hl=en&q=text+append+io+site%3Amsdn.microsoft.com"]search[/URL] for many links related to the process you're looking for :twisted:

What you're looking for is the Append file access mode which opens an existing file for writing but places new content at the end of the file instead of overwriting from the beginning. For this you can use the standard filestream method of accessing the file and utilize the [URL="http://msdn.microsoft.com/en-us/library/system.io.filestream.aspx"]append access mode[/URL] or you can use the [URL="http://msdn.microsoft.com/en-us/library/system.io.file.appendtext.aspx"]File.AppendText[/URL] method depending on your needs.

Hope this helps :)

Geekitygeek commented: google == friend :D +3

Well congratulations everybody on just handing out code to someone. My particular favorite was this one:[CODE]Button1(.................)
Process p=new Process();
}[/CODE]That being said... when someone comes to the forum and says "[I]please help me with the code behind file..as i am really confused...otherwise give me some tips to start doing the code[/I]" do you think that they benefit more from having completed code snippets dropped in their lap or from being told [B]how to[/B] go about coding the application they're working on?

DangerDev and ddanbe good on you two for pointing the user in the right direction :twisted: At least some folks are still following the 'developmental learning' model around here as opposed to the 'here's a free hand out, go turn it in to your teacher' model.

Now as to the original question, similar to ddanbe I'm going to provide a [URL="http://www.daniweb.com/forums/thread295345.html"]reference to another thread[/URL]. Perhaps the information in [URL="http://www.daniweb.com/forums/thread295345.html"]that thread[/URL] will help you sort out your calculator code issue.

Have you perhaps tried running a check against [URL="http://msdn.microsoft.com/en-us/library/system.io.file.getcreationtime.aspx"]File.GetCreationTime[/URL] for the files in the list to determine the created date for the file(s) against the date range you're targeting?

Hope this helps :)

Simply put, because you don't always want to wait until the end of the program to free resources that are no longer needed by the application.

For example, if you were to hold on to the memory allocated every single time the program calls a class object, or every time the program performs a calculation, or every time the program performs any operation, then eventually your memory usage for a larger, more complex program, would be off the scale.

What might start off as a few bytes here or a couple of kilobytes there would eventually work into megabytes of unreleased memory resources and slow down the operation of your application. Assuming that the application then continues to run for an indefinite amount of time (For example, I don't always close every browser window in my FireFox application and leave 1 or more windows open for days at a time) then those megabytes of unreleased memory become gigabytes of unreleased memory.

As you can see, if you assume that leaving the memory cleanup to the closing of the application will be sufficient you can cause some rather serious memory usage issues with your application.

Hope that helps :)


Was there a reason why you had to create another thread instead of simply adding to [URL="http://www.daniweb.com/forums/thread302739.html"]the one you created before[/URL] for the same topic?

Just seems like you decided that, since you didn't get the answer you wanted 5 days ago, you were going to re-post the question again rather than adding your new info to the existing thread where it belonged.

Geekitygeek commented: agreed..duplicate threads = unclean..UNCLEEEAAN! :p +2

Is it just me, or does nobody do any research prior to coming here and posting questions?

I mean, even without going to external sources (Google.com, msdn.microsoft.com, etc.) I'm able to pull together the following list of posts within DaniWeb alone that are related to sending mail from an ASP.Net app and perhaps have information that would solve the issue without having to create a new post that is not only poorly titled but lacking in any displayed effort whatsoever.[LIST]
[][URL="http://www.daniweb.com/forums/thread68369.html"]Post # 1[/URL]
][URL="http://www.daniweb.com/forums/thread46832.html"]Post # 2[/URL]
[][URL="http://www.daniweb.com/forums/thread290191.html"]Post # 3[/URL]
][URL="http://www.daniweb.com/forums/thread261391.html"]Post # 4[/URL]
[*][URL="http://www.daniweb.com/forums/thread242799.html"]Post # 5[/URL]
[/LIST]Additionally, if I actually GO to google.com I enter a [URL="http://www.google.com/#hl=en&source=hp&q=C%23+ASP.Net+formmail"]simple search[/URL] and receive numerous pages of information on how to do exactly what you're asking for.

Now don't get me wrong... I don't mean to sound like an ogre or anything... but seriously... you couldn't find any of these resources? Or was my initial assessment correct that you didn't even try to find the information before posting here and hoping someone would provide you with some code you could copy/paste directly into your project without doing any work?

And hey, if the above information isn't what you were looking for... perhaps providing a detailed question with a descriptive subject showing the steps you've tried and the issue you're facing might get you more specific help to the actual problem you're encountering :twisted:

Hope this helps :)

__avd commented: Links!!!! +10

Nice intro :) nice to see when someone makes an effort instead of posting a one liner (or half liner) to the community intros forum. Welcome to DaniWeb.

I would start with a ruler and a calculator.

First, place the ruler along the bottom edge of the directory and measure it's width, then place it along the left edge and measure it's height. Multiply the two numbers and there you go :icon_twisted:

Alternately if you're just looking for the total size of the files within the directory...

A combination of [URL="http://msdn.microsoft.com/en-us/library/wz42302f.aspx"]file.GetFiles()[/URL] and [URL="http://msdn.microsoft.com/en-us/library/system.io.fileinfo.length.aspx"]FileInfo.Length()[/URL] might work for what you'd need. Using GetFiles to get a list of files within the directory itself and FileInfo.Length to get the size (in bytes) of each file and summing them up would get the total. You might need to do some recursive pathing if you want to include the sizes of all subdirectory content as well.

Hope that helps :) If it's not what you were looking for, perhaps a bit more detail on what specifically you needed would help someone come up with the best solution for you.

[URL="http://msdn.microsoft.com/en-us/library/system.io.file.delete.aspx"]msdn.microsoft.com[/URL] indicates that the path needs to include: "The name of the file to be deleted. Wildcard characters are not supported."

Of course, if you'd read the link I posted instead of focusing all of your energy on typing ?'s into your posts you might have seen that :twisted:

Basically when using file.Delete() you must specify the absolute path to the file (unless the file is local to the working directory of your application) and the full filename of the file. If you are receiving no error message it is likely due to the fact that "the file does not exist" as indicated in my previous post (likely as a result of your not providing an extension for your filename).

If there are multiple possible file extensions for the file you are attempting to delete then perhaps you might want to look into a [URL="http://msdn.microsoft.com/en-us/library/wz42302f.aspx"]file.GetFiles()[/URL] usage to determine the existance and full name of the file you are attempting to delete before attempting to delete it.

As it seems to come up often enough I figured I'd throw together a quick snippet outlining basic methods for data manipulation in SQL Server using C#.

In all examples the coder will need to substitute their own connection string details and variables.

I utilised parameters for 3 of the examples but they can just as easily be replaced by direct references to dynamic controls in your application if desired. The benefit of parameters, however, is that they set the 'type' of the variable being passed and add an additional level of type checking to the app.

I'm hoping I didn't bugger any of the code samples when throwing them together.

If I understand your question correctly (you didn't give a lot to work with) you're looking for something like this:[CODE]SqlDataAdapter da = new SqlDataAdapter ("SELECT FROM Table WHERE column='@varNameHere'",con);
da.SelectCommand.Parameters.AddWithValue(textBox1.Text);[/CODE]Essentially, you'd need to modify the correct command type within the adapter with the parameter you wanted to add... I am not 100% sure because I haven't tried to manually override the default adapter methods recently but you may also need to actually set your SELECT statement with the use of the following instead of in the actual adapter declaration in order for the SelectCommand methods to work as well:[CODE]da.SelectCommand.CommandText = "SELECT
FROM Table WHERE column='@varNameHere'"[/CODE]Hope this helps (and hope I'm not butchering it at the same time) :)

EDIT: As I thought (and as saravind pointed out before I could finish typing my reply) you do need to set the CommandText separately instead of in the declaration of the adapter when using parameters :)

AngelicOne commented: cleared me up! thanks +1


I might suggest you have a look at the following:[LIST=1]
[][URL="http://www.daniweb.com/code/snippet217193.html"]Code Snippet provided for Passing Data Between Forms[/URL]
][URL="http://www.daniweb.com/forums/thread290554.html"]Previous Discussion about Passing Variables Between Forms[/URL]
[][URL="http://www.daniweb.com/forums/thread259179.html"]Previous Discussion about Passing Data Between Forms Back and Forth[/URL]
][URL="http://www.daniweb.com/forums/thread174490.html"]Previous Discussion about Passing Variable to Another Form[/URL]
[/LIST]I hope one of those helps you out :)

ddanbe commented: Nice work :) +7

Try/Catch generally should be used in any scenario where the outcome of your code is not 100% guaranteed to produce the desired result.

An example would be the file.create example that nssltd posted above but it could also be used for things like database manipulation (try to insert information and catch the error if it doesn't work).

Another component not mentioned above but still part of the try/catch family is "finally" which is a 'catch-all' piece of code which fires after both try and catch have completed their bits. Basically 'try' fires up it's piece of code and if it fails then 'catch' steps up and tries to salvage things so the program doesn't fail entirely. Once either of the first two is completed in what they're doing it moves on to 'finally' who steps in to do whatever needs to be done to finish up the task.

This is all part of the larger picture that is 'error handling' within the C# language. For some additional information about this I suggest reading the first 2-3 listings in [URL="http://www.google.com/#hl=en&source=hp&q=C%23+try+catch+finally"]this google search[/URL] as, looking over the list, they all seem to be good reference points for beginner programmers.

Hope that helps :)

Suzie999 commented: clear, to the point +1

Ok, a brief note on backgrounds...

Size of the background in the web browser (IE, Chrome, Firefox, etc.) is based on the resolution of the screen displaying it (minus the number of pixels required for the borders/menu bar/etc of the browser itself).

Generally it's not a good idea to try to make a 'full screen' background for a website as most of the people who will be viewing the site will likely not be using the same screen resolution as you will.

What I normally recommend is that you try setting a background of a fixed size width wise that tiles vertically and is centered horizontally (or fixed size vertically that tiles width wise) and has an easily repeated pattern that's not too complex (or painful on the eyes).

Alternately, if you want to have a graphic of some sort for your background, a fixed size image that is less than full screen on most resolutions that floats in the middle of the page with the content on top of it works well.

My usual target resolution for websites these days is 1024x768 as that is about the lowest resolution that the majority of people online are working with currently, many have much higher resolutions.

To sum it up, single 'full screen' background = bad, simple tiling background or floating fixed size (fit within 1024x768 screen which would be less if you take into account the amount of screen reduction from browser boarders and windows components) background = good.

Hope ...

almostbob commented: red text, thankyou +4

Personally I think it's a good idea in theory...

However, unless you can find a really solid concept for a project and a solid core group to work on the 'meat' of the project, I just can't see a group of 'random' people being able to sort out the sheer logistics of putting something like this together.

Most 'open source' projects I've seen successfully done are such that a core group puts together the majority of the content and others add to it over time (add-ons, bug fixes, etc). The additions get screened and incorporated into the primary source but it's handled by the core.

The concept of a large, loosely organized, subset of people putting together a workable program/project without such a core seems a near impossibility in my limited experience.

Best of luck with it though :)

macgurl70 commented: I have to agree, since the initial proposal sounds like a possible "design by committee" which is inviting disaster and possible splintering of the group. +0


Long story short, every user has some ability (well, almost every user) to affect another user's reputation positively or negatively by 'voting' them up or down in the posts they make.

The amounts that users can affect someone's reputation, per vote, are what you're seeing there. There are some cases (brand new user and a couple of others) where they have 0 ability to affect someone's reputation and there are many cases (veteran or more active users) where they can affect it moreso.

There are also some forums (for instance the feedback forum) where votes do not affect another person's reputation no matter how much ability you have to do so in the other forums.

An explanation of how the numbers work [URL="http://www.daniweb.com/forums/thread288610.html"]can be found here[/URL] as well as [URL="http://www.daniweb.com/forums/post1272183.html#post1272183"]here[/URL]. As for how to actually vote the reputation, you should be able to see next to any post (on the upper right) a number with an up and down arrow next to it (the arrows won't appear for your own posts). By clicking one of those arrows you are voting that post up or down. You would also be prompted to affect the user's reputation (with a comment) at the same time. One thing to note is that there are also sub-restrictions on reputation voting that prevent you from excessively giving/removing reputation from the same user over and over.

Hope that helps :)

Bordeaux0113 commented: Nice person with good answer +0

Excellent :) But that still doesn't address the rest of what I said :twisted:

For example, if you were to go to Google.com and enter a [URL="http://www.google.com/#hl=en&source=hp&q=C%23+"by+value"+vs+"by+reference""]quick search there[/URL] you'd find that there are a number of resources right there that explain the concept(s) you're asking about. Additionally, if you look at the 3rd reference that shows up with the search I linked it is based out of the other site I mentioned... msdn.microsoft.com.

I've got no problem helping people with complex concepts or coding problems they're having but usually MY first stop when I don't know something is to check google :twisted:

ddanbe commented: Indeed, Google is your friend!! +7
Geekitygeek commented: totally agree :) +2

[QUOTE=finito;1298787]your code looks good but where is con.Open()[/QUOTE]Actually, I think that the adapter/fill will open the connection, what's missing is the close of the connection and the actual logic for populating his data.

That being said, in the stored proc on the SQL side it's performing several select statements without naming them individually. There are 5 counts and 3 sums being generated with no variable names associated to be called upon on the ASP.Net end of things. What this would generate is 8 return values without names that would be difficult to populate to a dataset as typed.

What is needed here is some output control on the SQL end to tie each of the SELECT statements to a return value variable such that it can be populated under that variable name (read: column name) in the population of the dataset. Once this is accomplished the dataset can be used to populate front-end fields by referencing the dataset line & column.

Alternately, if the set is to be populated using the existing method then as long as you know which row in the dataset represents which stored SELECT it may work but I still have some doubts over the lack of variable names/columns involved.

I'm thinking that if we were to add a variable to each SELECT line and then a RETURN line to return all the variables in one 'row' of data then you would be able to call on your results from row 0 of your dataset with ...

To start with, that's a pretty solid distinction to make and should be covered in your textbook.

Adding to that, have you perhaps tried looking at online references like msdn.microsoft.com or google.com to try to find the answer prior to posting here?

I ask simply because, honestly, this looks like a homework question and not so much like any effort was put into getting the answer prior to posting it to the boards.

Best of luck with your answer though, I just woke up so I'm not about to dig into my brain for programming theory lessons to provide here :twisted:

Well, way to steal my thunder Ketsuekiame :twisted:

You covered all the stuff I'd have said and more in most areas.

What I would add is that (again, depending what direction you are going to take) it seems that a lot of game developers are tending towards a combination of scripting languages and either C++ or Python for the bulk of their coding needs. As indicated above, C# is good if you're doing web-apps in ASP.Net or if you're doing basic windows forms but it lacks in flexibility and power over C++ and requires a larger resource overhead to run apps written in C#.

Ketsuekiame commented: Definitely good to mix low level languages and scripting lnaguages +1

Ok, Umm... If you have SQL Server Management Tools available for you for the DB you're working on do this:[LIST=1]
[]choose the Date_Registered column within your table
]Column Properties > General > Default Value or Binding
[*]Enter "getDate()" (without quotes)
[/LIST]It may give you some grief over the fact that prior fields may or may not be already filled in but it will achieve what was suggested by mono.

Alternately, as this is now several days old and it's still not doing what you wanted it to do why not just give up on that if you can't figure it out and instead have the date generated on the application side and inserted at the time of the record being sent like I originally said :)

Either works, mono's method works behind the scenes and without fuss but you seem to be having difficulty implementing it.

See, this is what happens when I buy a new game and take a few days off DaniWeb :twisted:

AngelicOne commented: nice comeback.. xP +1

Control Panel > Edit Options > Default Thread Subscription Mode

This setting decides how your default subscription settings affect all posts you make.

Generally it affects both new threads started by you and replies posted by you so unfortunately you can't have the best of both worlds (auto-subscribe to your own threads while not subscribing to threads you reply to) but that's where the setting is.

Hope that helps :)

[QUOTE=Duki;1285410]Just skimming through posts here - really think someone should write a code snippet with all of this in it. Very good material and explanations here![/QUOTE][URL="http://www.daniweb.com/code/snippet298980.html"]Done[/URL] :twisted: