ChrisHunter 152 Posting Whiz in Training Featured Poster

If you to cut down the amount of code in your project only call the insert method from the button events and the call the connect method at the start of the insert method and the close method at the end of the insert method. It only saves a couple of lines but it makes the code tidier, more readable and efficient.

Also mark this solved if i've managed to solve it for you.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Yeah just like that but you only really need to define "SQL sql;" once at the top and then just do the "sql = new SQL();" as the first line of each method (it's not essential but it's good practise to re-use variables in this way).

ChrisHunter 152 Posting Whiz in Training Featured Poster

As good practise you should have a class seperate from your interface methods (i.e. button clicks) so that they aren't as accessible and to organise your application better. Simply make another class with the connection and insert command in and simply call that from the button click events.

ChrisHunter 152 Posting Whiz in Training Featured Poster

this one, only people from Belgium 'll understand, but it's a quote going in Flemish/Belgian history for sure ;)

Is it "Put that plate" or "Turn that off Ploat"?

ChrisHunter 152 Posting Whiz in Training Featured Poster

i want to make a new sheet one each button click in excel

Can you clarify this a little please?

is the button on an spread sheet or on the C# WinForm?

ChrisHunter 152 Posting Whiz in Training Featured Poster

have you tried using Val or Value ? it should store the value you store in it in the most appropriate format type.

ChrisHunter 152 Posting Whiz in Training Featured Poster

what type of DB will you be using ? you could just create stored procs specific to each application and just use a single DB.

Or

You could have a number of DB's on a single server and just access then when and where they are needed. It's easily done through a stored proc from 1 DB accessing tables in another

ChrisHunter 152 Posting Whiz in Training Featured Poster
ChrisHunter 152 Posting Whiz in Training Featured Poster

if you're still looking for a solution to this take a look at this link.

It's a walk through of how to databind a chart in both C#.NET and VB.NET.

ChrisHunter 152 Posting Whiz in Training Featured Poster

put it in a frame at a slight angle and call it Art...

ChrisHunter 152 Posting Whiz in Training Featured Poster

Put your CV on a job website (such as 'Monster' in the UK), look for student placements and under grad jobs. I was in your position whilst at university but managed find a job. Be confident, sell yourself and focus on what you have to offer and not what you don't !

ChrisHunter 152 Posting Whiz in Training Featured Poster

Ah, that may be why some models i've seen with higher speeds (i.e. the 500mbps set) is cheaper than the slower sets.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Does anyone own a set of these TP-Link Mini Powerline Adapter or any powerline adapters for that matter ?

I'm looking at getting a set to save trailing wires around the house and pulling up carpets to lay them. I've read the review from eBuyer but just wanted to see if any DaniWeb users have used them and what they think of them ?

ChrisHunter 152 Posting Whiz in Training Featured Poster

tbl1 is the name of the table with the PK you want to reference and ID will be the PK you want to reference.

myForeignKey int FOREIGN KEY REFERENCES tbl1(ID)

Do this when you creating the second table, if you the table already exists do it in an ALTER statement.

Alot of people might not like this site but it's help me alot in the past:

http://www.w3schools.com/sql/sql_foreignkey.asp

ChrisHunter 152 Posting Whiz in Training Featured Poster

that is because when you defined the array you defined it with a maximum of 5 indexes so you can only store 5 values. A list is probably the best solution to your problem.

If you're interested in how to stop that error from appearing and you want to add as many values as you like define you array like this:

double[] myArray = new double[0];
int index = 0;

and when you add a new value:

myArray = new double[index] = userInput;
index++;

this should let you keep adding to your array by increasing it's size every time the user wants to add a new val

ChrisHunter 152 Posting Whiz in Training Featured Poster

Here to help, arrays are better if you want to access a specific piece of data without having to itterate through the entire data set or to store data in a table like format but lists are quick and best from pulling large amount of data to be displayed (i.e. customer records to data grid view).

Edit: A list may actually be best for your app, may make it more efficient.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I what is salesCollectionList ?

You don't want to use a for loop if values can only be added one at a time.

Take the for loop out and replace it with a simple if

Change salesCollectionList.Add() which is used to add to lists to:

salesCollection[indexNumber] = userInput;

so it should look more like:

double[] salesCollection = new double[5];
int index = 0;

private void btnAdd_Click(object sender, EventArgs e)
{
    bool flag;
    double userInput;

    if (index <= 5) //Only executes if maximum number of values has NOT been reached (max is array size)
    {
        flag = double.TryParse(tbxUserInput.Text, out userInput);
        if (flag == false)
        {
            MessageBox.Show("Please enter a valid numeric value"); 
            tbxUserInput.Clear(); // Clear the contents of this object (A Text Box)
            tbxUserInput.Focus(); // Set the focus onto this object (A Text Box)
            return; // Drop out of the program/Event and RETURN to the Main Frame
        }
        else
        {
            salesCollection[index] = userInput; //Stores userInput in array index specified by index
            tbxUserInput.Clear();
            tbxUserInput.Focus();
            index++; //Will increase every time to move to next index
        }
    }
    else
    {
        messageBox.Show("too many values entered");
    }
}

Defining you array inside the event handler means it will be reinitialised every time the button is clicked and you'll lose previously entered vals

ChrisHunter 152 Posting Whiz in Training Featured Poster

you need to define your array and the int value that will be used to count the number of array indexes. Arrays start at 0 (so if you want 5 indexes your array index numbers will go 0,1,2,3,4).

An array is defined as follows:

int index = 0; //This will be used to itterate through the array
datatype[] myArray = new datatype[number of indexes required];

button1_Clicked()
{
    if (textbox1.text != string.Empty && index < maxNumberOfVals)
    {
        myArray[index] = //convert text box value to double
        index++;
    }
}

You will need a reset button to reset all values.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Decided to do Tough Mudder next year so looks like I'm going to have to do some faily intence training to get into shape for that !

Any suggestions ?

ChrisHunter 152 Posting Whiz in Training Featured Poster

When the user is entering the 5 values are they entering one value, clicks save and then entering the next value ? if they are entering them in the same box at the same time (e.g. 12 34 56) then you may need to tokenise the input.

Also have a read though these links they may be of some use to you:

http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx
http://www.switchonthecode.com/tutorials/csharp-basic-array-tutorial
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays11142005060354AM/WorkingWithArrays.aspx

ChrisHunter 152 Posting Whiz in Training Featured Poster

put a curly bracket before the break keyword.

ChrisHunter 152 Posting Whiz in Training Featured Poster

If there is already a background worker taking up the resources the lock will mean the new background worker wont be able to access the resource so you will have to put an action listener in to check when the resources become available.

Also try to make your queries more efficient to reduce execution time.

ChrisHunter 152 Posting Whiz in Training Featured Poster

It looks like it's the foreach close bracket...

Keep the positioning of your curly brackets the same, make its more readable and consistant (you have some on new lines and some at the end of lines).

ChrisHunter 152 Posting Whiz in Training Featured Poster

Anything by One Direction or Lenoa Lewis' cover of Run by Snow Patrol (i'm a big Snow Patrol fan).

ChrisHunter 152 Posting Whiz in Training Featured Poster

You might have already solved this but you would probably benifit more from using a console app and just opening the other application depending on the result of your IsProcessOpen method.

It would be quicker because it doesn't have to initialise the UI componants of the Win Forms app and (like on the Win Form app) you can do Application.Exit where required.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Click your name next to "Logged in as", scroll to the bottom and click "Edit Username".

ChrisHunter 152 Posting Whiz in Training Featured Poster

good for you...

ChrisHunter 152 Posting Whiz in Training Featured Poster

Tried Form1.Refresh() that might do the job

ChrisHunter 152 Posting Whiz in Training Featured Poster

What is it you want to do ?

What file type do you want to save the contact to ?

How do you want it formatting ?

Other than the above (which has nothing to do with saving contacts to another file) what code do you have to show your attempt ?

ChrisHunter 152 Posting Whiz in Training Featured Poster

Where you supposed to enter this into google ?

Have a look at this

ChrisHunter 152 Posting Whiz in Training Featured Poster

With the strain you put the body under during a session it's not supprising, not warming up properly would be a bit mistake !

ChrisHunter 152 Posting Whiz in Training Featured Poster

Vitamin D is good for your skin, people used to go on the sunbeds to get rid of spots but it's obviously not good for you so take vitamin D suppliments instead, see if they work or at least help.

I've never done crossfit, always wanted to but it looks intence and my stamina is abysmal, I'd be feeling sick if i ran a mile in about 10 mins !

What exercises are best to get ripped and get a solid core ?

I'm 6.1 and only 82.5kg but don't really want to bulk up so I can stay light... ish.

ChrisHunter 152 Posting Whiz in Training Featured Poster

So when you add new details do they get save straight to the DB or do they go to the GridView first ?

Can you take all the random empty lines out of your code too, it looks messy and makes it a pain to read through.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I did one for my final project at univercity but although it was only about 18 months ago I'm a bit rusty, i think in the context of a project (Rather than a disortation/ research) you should try to find articles and books on developments, made by others, within the area your project is for.

For example if your project is a I.M application you can review articles on how I.M applications have been developed and revolutionised, using quotes from articles on things like MSN Messanger, Skype and even BBM in you review.

I struggled to get started with my litriture review but hammered it when i got going. You've just got to think about what you want to do and what has already been acheieved in that area.

Good luck.

ChrisHunter 152 Posting Whiz in Training Featured Poster

You haven't closed off the Contact class before defining the Details class.

You should take unnecessary white spaces out to make it more readable (but not so it's one continuous word)

ChrisHunter 152 Posting Whiz in Training Featured Poster

You just need to know the basics really, how to tie a figure of 8, put a harnes on and belay properly. I do a lot of bouldering lately, all you need is shoes and chalk so I don't have to find someone who is free to climb and it's short but powerfull routs!

ChrisHunter 152 Posting Whiz in Training Featured Poster

If you want to be able to switch to a particular database depedent on a particular condition you could use a case statement withing your DB connection method which references at spacific connection string dependent on the case (if statements will work too).

ChrisHunter 152 Posting Whiz in Training Featured Poster

I mostly do indoor due to not knowing enough people who want to go outdoors but i get out as often as possible. You should get back into it, bouldering is big these days but sport/ lead climbing wins every time for me!

ChrisHunter 152 Posting Whiz in Training Featured Poster

I climb a minimum of 1 day a week but that's it at the moment (I've just moved house and started a new job).

I've refused to join a gym so far because I wanted to get ripped without one but might give in soon (not that i've been trying at home).

Climbing is amazing though, especially for your upper body, core and hands(until you start ripping skin off or crimping too hard) plus it gets the heart going !

ChrisHunter 152 Posting Whiz in Training Featured Poster
ChrisHunter 152 Posting Whiz in Training Featured Poster

I wasn't quite sure where to post this so I thought considering SSRS in VS 2005 produces XML scripts i thought this would be the best forum.

I have a table grouping which produces a number of tables using the same section of xml code. Due to this the problem I have is when i try to print the report (which has a number of tables that are generated from the same block of code) one of the tables starts before the pages break and over flows onto the next. It doesn't look very professional and isn't the most readable thing in the world.

I assume there is a way to check where the page break will be in relation to where the table will be stored on the excel sheet, and move the table to the next page if it over spills.

How ever i have no idea how to do it.

I'm researching as you read but a point in the right direction would be great.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Google 'MP3 player in C#'.

Also have a look at these links:

Existing DaniWeb thread

This is a thread on the MSDN forum on the same subject

Get stuck in and let me know how you get on with it.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Thats my motivational speach for 2012 Romeo DONE !

ChrisHunter 152 Posting Whiz in Training Featured Poster

If this isn't a perfect example of someone wanting someone else to do their homework for them then I don't know what is.

Google it, the code is out there but if you're on a programming course and don't put the effort in to understand it you're going to be one of those one's that drop out. I was almost that guy until until i got my act together.

If you find the code, read it and try to do it yourself. Refer to the code for hints or if you don't understand something.

You'll find if you finish something as simple as this you feel proud and start thinking of what could be possible.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Why would you be bothered by the company tracking THEIR OWN laptop ?

If the company have given you a laptop I'm guessing they gave it you to do work and not as a present for personal use. You should use the companies laptop like you would a computer in the office and if there's no inappropriate use of the laptop and you're not taking it to inappropreate places you should be fine.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Put AS after the brackets and before Subscribed_to_Business_XL see if that works.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Does the fan still kick in when you turn your PC on ? did you know the heat sink when you were cleaning the fan ?

If the fan doesn't kick in when you power-up check it's connections (but be as gentle as a butterfly).

ChrisHunter 152 Posting Whiz in Training Featured Poster

I have a 3Gs which I got off my sister to replace my broken toco lite and I've never been too interested in the latest phones because I'd rather go the pub and talk to a humans face but I do understand the capabilities of iPhones. However I have plenty of friends that have had the majority of iPhone models and watched from an "I'm not too fussed about any of latest phones" point of view and from here it seems as though the iPhone range does the majority of its sales due to how well Apple's marketing department sell the phone (the phrase "they could sell manor to a farmer" comes to mind). Not to discredit Apple, the iPhone is an amazing range of phones and i do like my 3Gs.

However like myself a massive percent of users will never have any use for a lot of the things the iPhone has to offer. In my personal opinion the iPhone seems to be like these "fixie" bikes, overly big glasses (sometimes plain glass or not glass in them) and geek sheek clothing that trendy London students ware (which was orignally ironicly fassionable as first but that seems to have been lost).

My point: iPhone is an amazing piece of ecuiptment but I think it's more the brand and the fact that people have spent so much on peripherals and apps, than the technology now. As HappyGeek said other handsets are available and just as good (if not better) …

ChrisHunter 152 Posting Whiz in Training Featured Poster

Main applications used for developing in C# and connecting databases are Visual studios (as nMaillet said) to write your C# apps and SQL server for your databases. I've only ever used 2005 onwards for both IDE's and prefer Visual studios 2010 version and 2008 version of SQL server.

If you know C++ then learning C# should be a breeze, theres a book called "Head First C#" that I purchased which is good but I didnt use much.

Good luck (you won't need it though).

ChrisHunter 152 Posting Whiz in Training Featured Poster

UserName: ____________________
Password: ____________________

Bob's your uncle and Fanny's your aunt!

In all seriousness the best thing to do is have your login screen match the colour scheme of the rest of your applicaion. keep your schemes consistant throught.