Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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 could do 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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well...

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

:twisted:

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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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 …

jon.kiparsky commented: Well put. +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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 exact same location 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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

For instance, in my for conditions, I cant say, (int i = 0; i != songs.count; i++) like I would be able to in c++.

For that one I would say this instead:

for (int i = 0; i < songs.Count; i++)

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.

EDIT: Just thought of this but it may be songs.Length instead of songs.Count... hmm... brain not working today, not sure.

Otherwise, your method appears sound.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'd recommend that you check out the following search 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 append access mode or you can use the File.AppendText method depending on your needs.

Hope this helps :)

Geekitygeek commented: google == friend :D +3
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well congratulations everybody on just handing out code to someone. My particular favorite was this one:

Button1(.................)
{
Process p=new Process();
p.startInfo.FileName="calc";
p.start();
}

That being said... when someone comes to the forum and says "please help me with the code behind file..as i am really confused...otherwise give me some tips to start doing the code" do you think that they benefit more from having completed code snippets dropped in their lap or from being told how to 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 reference to another thread. Perhaps the information in that thread will help you sort out your calculator code issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Have you perhaps tried running a check against File.GetCreationTime 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 :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Curious...

Was there a reason why you had to create another thread instead of simply adding to the one you created before 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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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.

Additionally, if I actually GO to google.com I enter a simple search 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 …

kvprajapati commented: Links!!!! +10
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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 file.GetFiles() and FileInfo.Length() 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.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

msdn.microsoft.com 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 file.GetFiles() usage to determine the existance and full name of the file you are attempting to delete before attempting to delete it.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If I understand your question correctly (you didn't give a lot to work with) you're looking for something like this:

SqlDataAdapter da = new SqlDataAdapter ("SELECT * FROM Table WHERE column='@varNameHere'",con);
da.SelectCommand.Parameters.AddWithValue(textBox1.Text);

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:

da.SelectCommand.CommandText = "SELECT * FROM Table WHERE column='@varNameHere'"

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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
ddanbe commented: Nice work :) +7
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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 this google search 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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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 …

almostbob commented: red text, thankyou +4
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Bordeaux0113;

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 can be found here as well as here. 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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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 quick search there 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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

your code looks good but where is con.Open()

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 …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, Umm... If you have SQL Server Management Tools available for you for the DB you're working on do this:

  1. choose the Date_Registered column within your table
  2. Column Properties > General > Default Value or Binding
  3. Enter "getDate()" (without quotes)

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
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

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!

Done :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As suggested by Duki in this thread I figured I'd compile all the workable examples and explanations here towards the question of "Why do we use get/ set to change properties?"

Properties provide the opportunity to protect a field in a class by reading and writing to it through the property. C# properties enable this type of protection while also letting you access the property just like it was a field.
Becuase of get /set our class contains control over the input.
let say E.g. if you don't need to use get/set. you colud write function for setfunct or getfunct insted of using Property.
But that's a real problem like -- you'd rather write myc1.Y = 3; and be able to write things like myc1.Y += 5; , instead of myc1.SetY(myc1.GetY() + 5); //where myc1 is a object of class. So instead C# has properties.
Inside the setter, the keyword 'value' is the variable containing the value that is getting assigned to the property setnumberY.

Reason we use properties is it's a virtual.Another benefit of properties over fields is that you can change their internal implementation over time. With a public field, the underlying data type must always be the same because calling code depends on the field being the same. However, with a property, you can change the implementation. For example, if a customer has an ID that is originally stored as an int, you might have a requirements change that made …

finito commented: good work +2
ddanbe commented: Just noticed it. Well done! :) +7
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Only thing I'm going to say here is... when did DaniWeb become the equivalent of a compiler's built-in syntax and error checker?

If you have a specific problem with the code or it's not working in an expected way it would be appreciated if you would provide the error details for the community here to work with instead of plastering a chunk of code (without the code formatting braces) into the page with the title "check the code for errors".

Ezzaral commented: Agreed. +13
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... first off... this same question was already answered for you at least once in the past.

Secondly, this same question was already answered for you at least once in the past......

I could list out the 4-5 times you've posted this same question but in the end it boils down to the fact that you have junk in your web.config files that is not compatible with the server settings that are on your web server and you need to eliminate all but the items that are compatible.

There is really no need to keep asking the same question over and over again because you're just going to get the same answer over and over again.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well dayum... I was about to go and give a big well-worded example of the use of methods vs direct data access and then I read the 1 reply and saw that pritesh had beat me to it :twisted:

It's basically just for data protection/hiding in the end.

By having get or set methods defined for a variable in a class you can set a variable as read only, write only, or read/write capable and the calling program need never directly access the variable directly.

Edit: A more fitting example for what I've described of the use of methods would be as follows

class Point {
    protected double x, y;
    public Point(double x, double y) { //Indirect access to x & y via public method "Point"
        this.x = x;
        this.y = y;
    }
    public double X {
        get { return x; } //Read Only access to protected/private variable "x" via public method "X"
    }
    public double Y {
        set { y = value; } //Write Only access to protected/private variable "y" via public method "Y"
    }
}

Let's say, for example, you have a program where you want to be able to set a value for "y" but not read from "y" directly... You then wanted to have a process run on "y" and the result set to "x" which you want to be able to read, but not be able to directly write to. You might approach that as follows:

class YtoXClass {
    private …
ddanbe commented: Good explanation (at 4 am?) +7
finito commented: good explaination +2
Duki commented: Great examples +7
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
public partial class Form : System.Web.UI.Page
{
    private void connecttodb()
    {
        OracleConnection conn = new OracleConnection();
        conn.ConnectionString = "User Id=WLL; Password=wll; Data Source=WLL;";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            String CommandText = "Select DepartmentID,Department from its_department;";
            OracleDataReader odr = GetDr(CommandText, ConnectionString);
            DropDownList1.DataSource = odr;
            DropDownList1.DataTextField ="Department";
            DropDownList1.DataValueField ="DepartmentID";
            DropDownList1.DataBind();
        }
    }
    private OracleDataReader GetDr(String sqltext, String ConnectionString)
    {
        OracleDataReader dr;
        OracleConnection oracle_conn = new OracleConnection(ConnectionString);
        OracleCommand Oracle_cmd = new OracleCommand( sqltext, conn );
        Oracle_cmd.Connection.open();
        dr = Oracle_cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
        return dr;
    }
}

Issue was with brace ending Page_Load. General rule of thumb that I work with is to always ensure that when I open a brace I immediately close it and then start filling betwen the braces with my statements. This way I never forget to close a brace. Also, not sure if the posted code reflects your actual code but ensuring that tab stops are enforced (4 spaces per indent level) uniformly throughout your code makes it easier to spot and correct things like that.

Hope this helps :) Please remember to mark the thread solved once your issue is resolved.

Edit:

u have missed brace for partial class form

Incorrect but s'all good...

Add a braces before "private OracleDataReader GetDr(String sqltext, String ConnectionString)"

This was correct :twisted:

Geekitygeek commented: well written and spot on +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I mean seriously... Especially when it was ME who was right first :'(

LoL Sorry, had to say it Ryshad. And I agree completely with what you said but um... now you and I are both guilty of refreshing the thread to point out that the thread didn't need to be refreshed :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Why would you want to do this though?

The only reason I could see for disabling task manager is if you're trying to do something you shouldn't be and don't want the user to be able to abort your processes.

Also, administrator (on many OS's) has the ability to lock out task manager access to non-admin users on a per-machine basis so there should be no reason to be doing so programatically for any valid purpose I can see.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm confused, are you wanting to record the date of the registration within the information you're recording about the registration? Or in a separate record/table?

If you simply want the current date/time within the same record it's as simple as adding a date/time column in your table and populating it either from the code-behind side with DateTime.Now or on the SQL side with (I think) dateTime.Now() (been a while since I used the commands directly within SQL).

AngelicOne commented: thanks +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

So nobody else has any "must-have" resources they want to share?

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

What you're looking for is a Modal form.

This is something that comes up often enough around here so here's a link to a previous thread where a modal dialogue was discussed (please don't post in the old form though, if you have questions about what is discussed there please post them here).

That would suit the needs as you've stated them.

Hope it helps :) Please remember to mark this thread solved once your issue is resolved.

Geekitygeek commented: exactly right :) +1
ddanbe commented: Yes! +7
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

They've got a point AngelicOne and to be honest between nick.crane and Ryshad you've got 2 of the better helpers/posters in this sub-forum helping you which is why I stepped out of this one :twisted: I'd be heedin' their advice if I were you :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Fairly sure that if any moderators were feeling that friendly they'd approach you and not the other way around :twisted:

Considering how many other things they have to do on an average day (on a volunteer basis I might add) I wouldn't try to rush it :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Wow... seriously? My Blackberry couldn't even handle posting a reply to this while I was out today?

Ok, I'll type it again :P essentially when you use .\\SQLEXPRESS it assumes the default install location for SQLEXPRESS on whatever machine it's being run on.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

By the way, as indicated here you can use the following method to read the MDF file without attaching it to your installed SQL Server:

Data Source='.\SQLExpress'; Initial Catalog=; Integrated Security=true; AttachDBFileName='...\Db.mdf'

Where your path in Data Source matches the installation path (generally a default path) for SQLExpress and the path in AttachDBFileName matches the installed location of your mdf file at time of your program being run.

Of course you need to ensure that other details are a match to your particular DB file like the catalogue and such.

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

See, I agree with ardav about the fact that people do need to put some effort into trying to find their solution prior to posting a new thread... However, if people did that... 90% of the new questions posted wouldn't be and my post count would be around 100 instead of where it is now since I wouldn't have anyone to help :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Couple of reference points related to this topic:

Now I could be wrong here but it looks more and more likely that even though you are able to detatch and distribute your mdf file with your application it will still only be able to read the mdf if sql server (express, or whichever) is on your target machine as well. At least one of the above links does have a connection string sample of connecting to a local mdf file however.

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

One method for changing the column header is to change the name of the column as it's pulled from the DB with the "AS" modifier.

As for the width it can be dynamically set with the equivalent of:

dataGridView1.Columns[0].Width

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If anyone know of any programs that have the p.code and the actual code, where i can study it so that i'll understand exactly what i need to do to learn how to write p.code, and adapt to writting the p.code before my program......

While I don't have any side-by-side examples to provide I'll try to give a bit more detailed explanation of the process from my own understanding with a generalized example.

Let's assume you have a lemonade stand (ya, like one of those needs a software designed for it but we'll go with it anyway cus I'm not feeling very creatively inspired).

For each glass of lemonade sold you charge $0.50, there are 10 glasses in a pitcher and a pitcher costs $2.00 to make. You've purchased enough ingredients to make 40 pitchers and you want to track your sales but also have the software tell you when you've 'broken even' on your costs.

P.Code:
--Initial Setup--

  1. Prompt user for total investment in ingredients (in this scenario input will be $80.00)
  2. Prompt user for cost per glass (in this scenario input will be $0.50)
  3. Determine break-even point (investment/cost)

--Start Program--

  1. Prompt for number of glasses sold for each transaction (request 'Enter # of glasses sold')
  2. Calculate cost of current sale (number * cost)
  3. Add to running total (totalCost += cost)
  4. Display running total (output totalCost)
  5. Check if running total is equal or greater than target (if (totalCost >= investment))
  6. If …
Geekitygeek commented: very well written example :) +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

It all depends on how each element of the table needs to be seen by the end-user and what abilities they need to have related to managing that information.

If the end user just needs to be able to SEE the information (at a given point) then you can get away with just about any presentation method (from repeaters to tables and so on). If the end user needs to be able to modify information dynamically then you will be limited by presentation methods that allow for this (or have the ability to be programatically enhanced to provide dynamic update).

My personal 'rule of thumb' is... What ever looks best from the list of things that work :twisted: ie: find out what works for what your end user needs THEN worry about how it'll look.

Hope that helps :) Please remember to mark solved once your issue is resolved.