ChrisHunter 152 Posting Whiz in Training Featured Poster

Sorry I realise I've posted this in the wrong section, it's been a while since I've visited DaniWeb.

JamesCherrill commented: OK, I moved it. +14
ChrisHunter 152 Posting Whiz in Training Featured Poster

Porridge made using water instead of mild and a cup of black coffee... I'm on a lean mass building diet and this my second breakfast of the day... I'm bored of eating already!

ddanbe commented: Success! I lost 20kg in 10 months +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

It's a question typed straight from a homework sheet by the sounds of it but what I think @Santanu Das is asking is if an item is marked at £100 and the seller sells it for a 10% loss on the the on the marked price, what is that price and how is it worked out.

@Santanu Das, to work out a persentage of something you take the number that number, devide it by 100 and then multiple it by the persentage you wish to find.

For example 10% of £100 is worked out as:
£100 / 100 = 1
1 x 10 = 10 <---- Stick a % on that and that 10% loss of a £100 item.

This can easily be googled so please show that you have at least tried solve or google it yourself before you post a question.

We're always happy to help but the rules do state that you should you have at least attempted to solve the problem yourself first.

Happy coding!

ChrisHunter 152 Posting Whiz in Training Featured Poster

HA! That's for me to know and you to find out ;)

You're homework, your problem... Unless you've shown that you've made a conscious effort and not just looking for someone to do your homework

ChrisHunter 152 Posting Whiz in Training Featured Poster

"Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid." - Albert Einstein

ChrisHunter 152 Posting Whiz in Training Featured Poster

I don't know to be honest. If its an app where the user needs to enter text I'd show a messagebox if the string was empty.

try putting the try catch in MethodA and throwing the exception in MethodD. It should just fall through to MethodA.

strRusty_gal commented: Thanks for the reply +3
ChrisHunter 152 Posting Whiz in Training Featured Poster
ddanbe commented: Sure is! +0
diafol commented: That is bloody hilarious! +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

My brother had an S4 and he had a problem with the battery swelling up and not charging properly/ loosing charge quickly.

Turned out to be a know fault and they replaced it so do a few searches to see if it's a known fault. Hopefully they might replace the battery for you.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Mine is more stubble than a beard. I trim it every week and haven't clean shaved in about 4 years but still can't get it to join fully on the right side!.

Since sporting the stubble at 21 I've had a maid at a hotel said "my son is his age and he doesn't look like that" and a guy I work with almost have a heart attack when he found out I was only 24 and saying "F.... hell is that it, you must have had a hard life, my watch is older that you!"

If I clean shaved I'd probabbly get turned away from the rides at Alton Towers...

diafol commented: heh heh +0
<M/> commented: lol +0
mattster commented: You should be a comedian, that's hilarious lol! +0
ChrisHunter 152 Posting Whiz in Training Featured Poster
  1. 16 in collage but most of the course was written work or MS Access DB so really started at 19 in uni.

  2. C# and SQL because I haven't tried much else.

  3. I did because I've always found it hard to consentrate when reading or listening. I always hated education but stuck with it and I'm glad I did. It paid off in the end.

ChrisHunter 152 Posting Whiz in Training Featured Poster

No problem, I'm glad I could help.

ddanbe commented: Yes, great help! +15
ChrisHunter 152 Posting Whiz in Training Featured Poster

Try value.ToString().Substring(0, 10). If the object passed in as value param isn't a string it won't work. What will you pass in as value param?

You might also need to change the string format to include - instead of /.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I'm with happyGeek on this one. I watch the odd TV show like Men Who Jump Off Roofs or The Island but the majority of it is un watchable. I have to endure The Only Way Is Essex and Big Brother...

ChrisHunter 152 Posting Whiz in Training Featured Poster

I wouldn't mind getting a tattoo from this fella, they look amazing and the detail is unbelievable!

This Guy

blackmiau commented: uh, yeah! +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

I can't unfortunately blackmiau it's my firend's work so I don't own it.

Wales never dissapoints diafol. I go camping in near Porthmadog and at Llyn Gwynant campsite every year.

We broke down over looking Llyn Clywedog. We had to wait for 3 hours before the breakdown service came but I could think of worse places to get stranded!

ChrisHunter 152 Posting Whiz in Training Featured Poster

This is a still of me, taken from my friend's GoPro, just after his bike broke down on him during a ride in the middle of Wales. It's not a cruiser but thought you might appreciate it @blackmiau.

2fcdb3ed5b0354c7b35018c583b0b5fa

ChrisHunter 152 Posting Whiz in Training Featured Poster

Music on a BSC IT course? I've never heard of that.

It depends on the place you study and the type of person you are. My University wasn't the greatest because they invested heavily in the sports department and not IT but it was still worth while.

My advice is to make sure you take the time to understand what you're being tought, you'll be a more confident programmer at the end of it all. There will always be people in your class who don't listen and rely on others to do their work that but quite often they don't graduate.

Also don't forget to ask questions if you don't understand something, your tutors will always be willing to help. There will always be someone here at DaniWeb that will be willing to help you too, as long as you're willing to try, myself included.

Mya:) commented: :) +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

Contrary to popular belief, the notion that goldfish have a memory span of just a few seconds is false. It is much longer, counted in months.

... I guess I don't have the memory of a goldfish.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I went through a similar patch just before the new year @diafol. I decided it worth regretting not having done the things I wanted to.

I went out and bought myself the motorbike I'd wanted since I was a nipper and had been putting off for years. I'm planning to learn how to surf this summer too and looking into possibly working in New Zealand for at least 12 months.

As for tattoos, I've always wanted one and I had vouchers to get one, but I couldn't decide what I wanted to get and didn't just want a tattoo for the sake of getting a tattoos. I'll get one eventually, possibly on my side or back.

diafol commented: Great +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

Sorry I didn't see your reply. Ignore my last comment if it's working.

Check the table names and field names are correct. It could be a case of a capital letter is needed instead of lower case.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Comment out the contents of your if statement (DON'T DELETE IT) and paste this into it:

deleted = dataGridView1.Rows[selectedindex].Cells["MovieID"].Value.ToString();
cmd3 = new SqlCommand("ALTER TABLE dbo.MovieCopy DROP CONSTRAINT FK_MovieCopy_Movies",cnn);

cmd1 = new SqlCommand("Delete From MovieCopy where movieid=@movieid",cnn);
cmd1.Parameters.AddWithValue("@movieid", deleted);

cmd2 = new SqlCommand("Delete From Movies where movieid=@movieid", cnn);
cmd2.Parameters.AddWithValue("@movieid", deleted);

cmd1.ExecuteNonQuery();
cmd2.ExecuteNonQuery();

cmd4 = new SqlCommand("ALTER TABLE dbo.MovieCopy ADD CONSTRAINT FK_MovieCopy_Movies FOREIGN KEY (MovieId) REFERENCES dbo.Movies(MovieID) ON DELETE CASCADE", cnn);

dataGridView1.Rows.RemoveAt(selectedindex);
dataGridView1.Refresh();

Try that. I've put the delete for the MoveCopy first so that the primary key in the Movies table can be deleted without any problems (hopefully).

I've also put the dataGridView1.Rows.RemoveAt(); at the end so that the ID of the movie that is being deleted is the selected movie.

Let me know how you get on.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Try deleting the record from MovieCopy table, before deleting from the Movie table, so that the reference to the Movie table record doesn't exist.

Also you might need to move dataGridView1.Rows.RemoveAt(selectedindex); and put it below cmd4 = new SqlCommand.

By the looks of it you're deleting the record at "Selectedindex" which removes that row and the row at "Selectedindex" is now the row below meaning MovieID won't be the ID of the row that has just been removed from the datagridview.

Hope this helps.

ChrisHunter 152 Posting Whiz in Training Featured Poster

It's C# so this is the best place for it.

This is the only way I can think to do it using a loop...

double Total = Convert.ToDouble(numbers[0]);

for (int i = 1; i < numbers.Count(); i++)
{
    Total = Total * Convert.ToDouble(numbers[i]);
}

It would be the best way if you have a lot of numbers or the amount of numbers would change but if you only have a constant amount of about 4 or less number the way you have done it is good.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Yes just use string.IsNullOrEmpty(texBox.Text).

It returns true if the string is empty and false if it have charactors in it (including spaces).

So you could do:

label.Text = string.IsNullOrEmpty(textBox.Text) == true ? "please enter the part no " : " ";

OR

if (textBox.Text.Length > 0)
{
    label.Text = "please enter the part no ";
}
else
{
    label.Text = " ";
}
Knight_YUVA commented: 10 +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

I'd say a minimum of 4 tables.

* Customers table
    - CustomerID (Int PK)
    - CustomerName (VarChar)
    - Address (VarChar)

* Products table
    - ProductID (Int PK)
    - ProductName (VarChar)
    - Cost (Float)

* Orders
    - OrderID (Int PK)
    - CurstorID (Int FK)
    - TotalCost (Float)

* OrderDetails table
    - OrderDetialsID (Int PK)
    - OrderID (Int FK)
    - ProductID (Int FK)
    - Quantity (Int)

Having the table structure above means 1 customer can have many orders and 1 order can have more than 1 of many products.

It will give you a more complete set of data if you are doing invoicing, stock taking or generating reports on how well products are selling and which customers are placing the most orders.

ddanbe commented: Nice & neat +14
ChrisHunter 152 Posting Whiz in Training Featured Poster

Hate the stuff! It makes everywhere look scruffy as hell, it gets every where and there's too many people who sound like a camel when they're eating it!

I got it stuck to my shoe twice last week.

I don't want to hear people chomping, it don't want to see what people are eating and I 100% don't want have to scrape it off what ever clothing it gets on, just brush your teeth or eat smint!

Screw it I'm moving to Singapour!

ChrisHunter 152 Posting Whiz in Training Featured Poster

I've got to say I've always been of the opinion that iPhones are over rated, over priced, average smartphones with Apple still riding the on the back of the ground breaking advances of original iPhone (and great marketing) by churning out handsets with little improvements.

After reading specs and reviews though my opinion of the 5s is completely different. I've recently bought the Lumia 520 because I only needed something basic that lets me go on the internet, music, satnav, calls and texts which means I won't be upgrading any time soon...

However my lovely girlfriend is due for an upgrade next month so if I'm nice enough I might be able to convince her to get one and drain the battery on her on a daily basis!

ChrisHunter 152 Posting Whiz in Training Featured Poster

What language is it in? you might have posted it in the C# form but in the other thread you created for this very question you mentioned a HTML file and never mentioned anything about any C#.NET controls.

You need to be a LOT more descriptive with your questions because that is unbelievably vauge and you need to show evidence that you have at least attempted it yourself.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Using webBrowser1.Url.Equals is simply comparing the current value of the Url with http//www.yahoo.com to see if they are the same. this would be good if you wanted to use it as a condition in an if statement but isn't used for setting it's value.

According to the link I sent you earlier you have to do something like the following:

// Pass in the website Url
public void MyMethod(string address)
{
    if (!address.StartsWith("http://"))
    {
        address = "http://" + address;
    }

    try
    {
        webBrowser1.Navigate(new Uri(address));
    }
    catch (System.UriFormatException)
    {
        // put messageBox here if required
    }
}

Once you've done the above you can then get the current Url from the webBrowser by accessing the Url property (which will help solve one of your other threads on here).

Hope this helps.

pardeepkhatri commented: very much cooperative +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

What code do you have already?

This should be a bit easier for you to solve than the URL one in your other thread, you might just be missing a datatype conversion.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Also it looks like you're asking for an ATM application without having shown any evidance that you've attempted it yoursel.

The rules also say you have to show you've attempted it yourself first.

There's also a lot of help at hand if you use Google, there are examples of the code needed everywhere

ChrisHunter 152 Posting Whiz in Training Featured Poster

Sorry rubberman it was a sarcastic comment because it was such a vague homework like question.

Sorry for the sarcasum Micheal.

rubberman commented: NP. Understood that. Precisely why I up-voted your comment... :-) +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

software...

bradly.spicer commented: You beautiful man +2
rubberman commented: Actually, software is the output of software engineering... :-) +12
ChrisHunter 152 Posting Whiz in Training Featured Poster

The price might be different for you guys as you would be classed as foregin students and the application process will be a lot different.

You could alway ask to see how much the fees might be and what the application process would be.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I couldn't tell you to be honest. It was £3,500(GBP) per year for my course when I was studying but I left just before the rise in fees. Now I think it's around £8,500 per year which is insane!.

ChrisHunter 152 Posting Whiz in Training Featured Poster

The default images are similar to the ones used on quite a lot of other forums that are like DaniWeb (i.e. MSDN form), I think they're used to avoid confusion if new user's have used other forums before.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I think I'd probably sit in my living room trying to figure out how to fly the thing for an hour or two before getting frustrated, putting it back in it's box and realising it was a waste of money and that I p****d my girlfriend off for no reason...

I have a broken remote controle helecopter in cupboard, I know how this one plays out.

almostbob commented: than ks, my wife is loooking at me like Im insane, laughing at the screen +0
ChrisHunter 152 Posting Whiz in Training Featured Poster

I know exactly what you mean London-G, some stuff does stick but I do have to keep looking over previous code for help.

Practise makes perfect I guess...

ChrisHunter 152 Posting Whiz in Training Featured Poster

I haven't been very active over the last couple of months but I posted a few times before I went to Orlando, Fl for 2 weeks and as the old cliché I went on holiday and everything has changed!.

I only had a quick look but I have to say it looks great and I can't wait to have a proper look to see what other changes have been made.

Keep up the good work!

ChrisHunter 152 Posting Whiz in Training Featured Poster

Been there, done that and wear my "I don't regret my decision" T-shirt with pride!

ChrisHunter 152 Posting Whiz in Training Featured Poster

Happy St Davids Day, I love Wales. I can't wait for the weather to pick up enough for camping and a bit of climbing.

Hope you've had a good'n diafol

ChrisHunter 152 Posting Whiz in Training Featured Poster

Haha ddanbe you can't get him to open a new thread and then tell him to refer to the old one... saying that it's made me laugh!.

peymankop, to get the location (opsition on the form) of the button, simply create 2 int variable called X and Y and store the X and Y values of the button's Location property in them like so:

private int x;
private int y;

private void GetButtonLocation()
{
    x = button1.Location.X;
    y = button1.location.Y;
}

You will need to call GetButtonLocation() from you constructor method (the first method that is executed when the form loads).

ddanbe commented: Let's say, Ilike your comments :) +14
ChrisHunter 152 Posting Whiz in Training Featured Poster

define a private and public property like this:

private int _age;

public int Age
{
    get
    {
        return _age;
    }

    Set
    {
        _age = value;
    }
}

and to set the value of _age you pass the value to Age, or you can just do public int Age { get; set; )

ddanbe commented: Sheers! +14
ChrisHunter 152 Posting Whiz in Training Featured Poster

Happy Birthday <Michael>... but where's your birthday bunny?

Mine is 14th July and on that day:

  • Billy The Kid was shot.
  • The French revolution.
  • Capital punishment is abolished in Canada.
ChrisHunter 152 Posting Whiz in Training Featured Poster

Hi Sharan7081, welcome to DaniWeb.

DaniWeb users are more than happy to help you with any problems you might have, given that you can provide evidence that you've attempted to solve the problem youself and aren't just looking for someone to do the work for. (I think that might be why you have a down vote).

Having said that it sounds like you don't know where to start with this, so although I'm not going to give you the code I'll happily give you some ideas of what you need to do.

You can configure a DataGridView so that particular columns can be textBox columns, comboBox columns, checkBox columns as well as other types. Once you have chosen the type of column you want, using them is just like using a regular comboBox or textBox control (once you've accessed it through the DataGridViews columns property.

Here are a few links that might be of use to you:

DataGridViewComboBoxColumn class

DataGridViewComboBoxColumn DataSource

DataGrivViewTextBoxColumn class

Hope this helps and good luck.

ddanbe commented: Very helpfull! +14
ChrisHunter 152 Posting Whiz in Training Featured Poster

Same as the SELECT statement, the WHERE clause should be done on the unique identifier column (primary key/ ID column)

You should know the ID of the record as it should be returned as part of the SELECT statement something like: WHERE ID = myID.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I heard a good'en when someone on the radio was asked the difference between rugby and football, "Football is pretending to be injured for 90 minutes. Rugby is pretending you're NOT injured for 80 minutes".

If you don't agree with that you've either never heard of the Warrington Wolves player who ruptured a testicle and carried on playing for 20 minutes untill he was forced to come off, or you're a football player. . .

You can read the story here. The best part is he tweeted "Just coming out the hospital to go home... Seriously feel like I've left something?".

Englad all the way!

ChrisHunter 152 Posting Whiz in Training Featured Poster

ddanbe's suggestion works well I use it at the moment, plus if it stays are a DT format when you store it in a string it's easily converted back to DT type.

ddanbe commented: Well said! :) +14
ChrisHunter 152 Posting Whiz in Training Featured Poster

OHHHHHHH he went there !

ChrisHunter 152 Posting Whiz in Training Featured Poster

You shouldn't use Wikipedia to back up and argument or in research, it can be edited by anyone so it's unreliable.