ChrisHunter 152 Posting Whiz in Training Featured Poster

Yeah I had a bit of a problem with ants in my house before I left and I was expecting to return to a whole nest sitting on the couch but the 10 tons of ant killer I put down seems to have worked.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I knew that's what it was! I was that excited I think I told everyone I possibly could, even random people on the train to work.

I'm joking of course... in part at least.

In all serious though the changes are great.

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

I hate to be the one to crack this probably hated jokes but brace yourselves...

  • There are only 10 types of people in the world... Those who do understand binary and those who don't.
ChrisHunter 152 Posting Whiz in Training Featured Poster

If you want to allow the user to select more than 1 entry I would suggest using a list box control and changing the selection mode property rather than using a combo box because combo boxes should really only be used to select a single value.

You don't actually ask a question you've just stated that you need to update a table but I'm guessing you want to know how to update a table where the value of a record is the same as the name selected?

Do you want to update multiple values at a time?

ChrisHunter 152 Posting Whiz in Training Featured Poster

Off the top of my head this is the only way to loop through reach row of a DGV (data grid view), check if the rows have any empty cells and then delete that row.

//Only loop through if are rows to loop through
if (dataGridView.Rows.Count > 0)
{
    for (int row = 0; row < dataGridView.Rows.Count; row++)
    {
        for (int col = 0; col < dataGridView.Columns.Count; col++)
        {
            if (dataGridView.Rows[row].cells[col].Value = null || dataGridView.Rows[row].cells[col].Value.ToString() = string.Empty)
            {
                dataGridView.Rows.Remove(dataGridView.Rows[row]);
                break;
            }
        }
    }
}

Hope this helps.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Snatch as in one of Guy Ritchie's legendary British films and on of the early Jason Stathem appearences with Vinny Jones and the not so British Brad Pitt? That, along with lock-stock and the more recent RocknRolla are massively under rated.

As is Shane Meadows version of "Dead man's shoes" which shows how people with mentally challanged can be taken advantage of by others and the consequences of the actions that some people, like thoes depicted in the film, may call a joke. The actor who plays the mentally challanged brother also plays a major part in RocknRolla (which I've only just realised when recalling Dead Man's Shoes).

ChrisHunter 152 Posting Whiz in Training Featured Poster

It's a case of the company either needs to have enough funds to pay for a good website or know a dev that can do it for them at mates rates, other wise it's usually an off the shelf template or D.I.Y job.

That doesn't necessarily mean it's a bad company, they might be a top class plasterer who just wouldn't be able justify paying for a top website. The affect a website has on a company depends the company it's for really.

ChrisHunter 152 Posting Whiz in Training Featured Poster

PRAISE THE LORD FOR PEOPLE WITH COMMON SENCE! I tried explaining the security risks of web storage to people who use things like SkyDrive or iCloud or have spoken to a person with a fruit on their shirt and suddenly think they're tech gods.

Explaining why it's not the best place to store naked pictures of yourself (if that’s what you like to do in your spare time), or sensitive info like bank details, is like trying to fit a very large, square peg in a very small, round hole!

As you have all mentioned the cloud does have its obvious advantages and disadvantages. However although it is not as vulnerable as cloud storage, centralised storage isn't 100% safe, after all if someone wants something they will find a way to take it.

Obviously there will be more and more web apps appearing because more and more people are using the internet but as mike_2000 said 3D gaming simply need too much power and bandwidth to be worth it and tech needs to be developed a lot more before it's even worth considering but it will still never be as quick or powerfull as good old desktop rigs!

ChrisHunter 152 Posting Whiz in Training Featured Poster

If by Error message you mean an exception then you can put a Try/Catch in you method like this:

private void myMethod()
{
    try
    {
        .....
    }
    catch (Exception ex)
    {
        MessageBox.show("" + ex);
    }
 }

As for the obsolete problem can you not add DateTime.Now.ToString() to the end of the obsolete message?

ChrisHunter 152 Posting Whiz in Training Featured Poster

Great! welcome.

ChrisHunter 152 Posting Whiz in Training Featured Poster

At the moment it's Rudimental - Waiting All Night but Not Giving In by Rudimental and Naughty Boy - La La La by are awesome!

Disclosure 100% too...

ChrisHunter 152 Posting Whiz in Training Featured Poster

If you want to link Form1 to Form2 (in that you want to open Form2 when you click a button on Form1), first add a button to Form1 and in the button click event do the following:

Form2 frm2 = new Form2();
frm2.show();

and SHAZZAM! Form2 opens and they're linked.

Have a look at this thread http://www.daniweb.com/software-development/csharp/threads/437362/getting-started-with-c-the-list

ChrisHunter 152 Posting Whiz in Training Featured Poster

The best thing to do might be to have everyone in 1 table called something like Users and a second table called UserType which could have the following fields:

Users table:
* ID
* Name
* Address
* UserTypeID (which is a reference to the UserType ID)

UserType table:
* ID
* Description (for example student, admin, faculty)

Then when you add a user you give them a UserType ID in the UserTypeID column.

This will give your database another level of normalisation (this is a good thing) because there will be no conflicting user ID's like their would be if you had different tables for each type of user, there will be less chance of duplication data between the different user tables(for example if someone changes from a faculty user to an admin user there won't be an entry in each table), and it will also mean it is easier to know what type of user it is.

All this would make it wayyyy easier when you're trying to something like populating a comboBox as you're trying to do as it means less complicated querying and quicker execution time which if you explain that in the justification (along with the normalisation bit from above) will help boost your marks (if this is for a college project that is).

ChrisHunter 152 Posting Whiz in Training Featured Poster

It depends on what you want to do with the data when you've retrieved it. Doing a union all on ID columns will cause a lot of problems because the two tables will have conflicting IDs.

For example, if you want to query some data using the ID of a value selected in the combobox, how would you be able to identify whether the ID belongs to the student table or the faculty table?

ChrisHunter 152 Posting Whiz in Training Featured Poster

Life is what you make of it there for YOU make your own opportunities.

ChrisHunter 152 Posting Whiz in Training Featured Poster

best thing to do would be to have a field, in the users table, that acts like a flag. It should be a bit data type and 0 if the user is offline, updated to be a 1 when the user signs in successfuly, and return to a 0 when they log out successfuly.

We will need to know how your tables are structured, in terms of where all the user info is stored, in order to give you a more accurate solution.

Dani may be a good person to ask about this as she has the little beacon next to the time of a post is that user is online (that will probably be dependent on a flag like the one I mentioned above).

Hope this helps.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Change is opportunity.

ChrisHunter 152 Posting Whiz in Training Featured Poster

The source should be the name of the server the DB is on and the catalog should be the name of the database so try adding a catalog attribute to the connection string just after the source attribute.

EDIT: Sorry my advice is for an SQL server database and not an Oricale DB.

ChrisHunter 152 Posting Whiz in Training Featured Poster

@Ketsuekiame Wow 40cm already! where about in the UK is that? I'm in Merseaside. Liverpool city center isn't too bad because it is a city but where I live (about 30 mins from Liverpool) it was about 5cm at 8am.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Do you mean you want to show a particular panel depending on the user OR do you want different panels which the user can switch between.

If it's the first option simply use panels and show and hide them as is required.

If It's the latter you should use the tabpage control.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Try just setting it in the properties window in design mode.

ChrisHunter 152 Posting Whiz in Training Featured Poster

**Fact is simply an individual's opinion that the majority do not disagree with.

There for a fact is always an opinion but one day your own opinion could become fact.**

That was way to philosophical for me, especially on a Friday!

ChrisHunter 152 Posting Whiz in Training Featured Poster

Sorry for my stupidity guys but I'd set the width of the report (the the dotted canvas behind the tables) so that it was bigger than the width of a landscape Excel page so it was continuing onto the next page.

Problem offically solved, thanks for all your help.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Alt + F4 should do the trick!

ChrisHunter 152 Posting Whiz in Training Featured Poster
  • Are you connected through wireless or a wired connection?
  • Is the router or modem turned on?
  • Are all cables connected correctly? (check them before answering in case one has come loose).
ChrisHunter 152 Posting Whiz in Training Featured Poster

Humm... The task I was working on that I was having this problem with has been put on hold for the moment but I'll give your suggestion go an see what happens.

Tar very much lar.

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

@Ketsuekiame it could just mean you took the chances and liked the result. Why would you regret a choice you've made if you liked the outcome.

ChrisHunter 152 Posting Whiz in Training Featured Poster

@diafol Yeah I usually go climbing and camping in Snowdonia, Llyn Gwynant for camping and then into the llanberis pass for a bit of boulding or a walk up snowdon. Never been to the south yet though.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I don't know how I can explain it any better to be honest, I simply get blank sheets because a table doesn't contain any data but still takes up space (so it can't be seen but it's hidden property is still true). If I set the hidden property to true when the row count is 0 it messes up the alignment when that table is the displayed.

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

EDIT:

=IIF(CountRows("TableName") = 0, True, False)

The only problem is now the pages alignment of the tables is off when I need to display the sheets again (when the row count is > 0).

ChrisHunter 152 Posting Whiz in Training Featured Poster

Good job you didn't try to climb back down or it could have ended a lot worse than it did.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Climbing up the side of a building unaided whilst drunk.

What happened?

ChrisHunter 152 Posting Whiz in Training Featured Poster

I spend at least 8hours a day 5 times a week infront of a computer in work, but if I don't go climbing or something like that after work it can be 12hours!

ChrisHunter 152 Posting Whiz in Training Featured Poster

Did you loose him?

Mine is propbably not going on a 3 week road trip around America with a couple of friends, even though my parents offered to loan me the money.

They're pretty good like that my parents, they'ed rather me borrow the money and experience something like that (because they know I work hard to pay it back as quick as possible), than not do it an regretting it later in life.

Moral of the story... Better to live in regret of the things you have done, than those you have not - Lucille Ball (almost).

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

@Peymankop. The best thing to do it to have two text boxes two allow the user enter to numbers, on for the X axis and 1 for the y axis. Then, once both values have been entered you want to get the size of the form the the button will be displayed and check that the numbers the user has entered for the X and Y axis of the button DO NOT exceed the size of the form that the button will be displayed on. If the values entered for the X and Y of the button do not exceed the size of the form then set the X and Y values of the buttons Location property with the X and Y values entered by the user and set the Visibility property of the button to true (set Visibilty to false in design mode so that it isn't shown as soon as the application is run).

Hope this helps. Please understand we can't give you the complete code as it would be doing your work for you. However we can give you as much guidence as we can to help you achieve what you need.

ChrisHunter 152 Posting Whiz in Training Featured Poster

You're not making much sence.

Are you trying to say that you want to type into a textbox, the postion that you want the button appear, and then you want the button to appear in the position you have typed into the textbox?

You need to make your question a lot more clear.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I can thankfully say after trying 1,000,001 differn't things I finally found the solution!

So my problem was that I had 1 template that would be used to generate a report for numerous clients. However, depending on the type of client, particular tables in the template weren't populated (just left blank) and causing blank sheets to appear in the report.

The solution was as simple as, in SSRS designer, putting the following expression in the Visible property of the table that was blank:

=IIF(CountRows() = 0, True, False)

This has frustrated the hell out of me for ages. Occam's razor springs to mind!

Thanks to everyone for your help.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Do you want the button to show when you put the cursor over a particular text box or when a particular textbox is clicked?

ChrisHunter 152 Posting Whiz in Training Featured Poster

It's not suprising that Oxford has done that. The fact that it is such a well respected university means it's going to be more a target for such problems as phishing scams and the like, and the easiest way to target the university is to target the student as not all of them are clued up on the issue.

I agree with Oxford in the way that educating their users isn't going to solve the problem as you will always get idiots that thinks "you've won £1,000,000" or "I only need you NI number and account details" is a genuine email.

It will always be the way that if there is a widely used resource, such as Google docs (which I've used in the past) and even Facebook, it will be misused to traget as big a prey as possible. After all why would you famine when you could feast (on sensitive information that is).

ChrisHunter 152 Posting Whiz in Training Featured Poster

I use CodeMaid to organise my code and StyleCop to add the necessary formatting like blank lines, comments and the rest.

Edit: I code in C# atm.

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

I wouldn't know the exact index of the sheets.

So as already discussed that won't work Eters. It's a report template that's generated for a large number of customers so the amount of sheets per report will differ from report to report.

The same report is done in PDF and it doesn't have blank (done by using expessions to set the visibility of the table objects but the same expressions don't work for the Excel report which I find weird because all the information, table orders etc are the same, it's literary just the application used to display it that is different.

I haven't tried the UsedRange yet but I'll give it a go.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Yeah that was my orignal idea but the number of and position of the sheets within the document differ from report to report so I wouldn't know the exact index of the sheets.

Thanks for your help, I'll keep trying.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I know I think it's something to do with the fact that the report is a generic report and in some cases a number of the tables arn't used (don't display any data) but might still be taking up space, others, I've got no clue about.

Yes I've got the Office library, is it possible to open up the excel work book before it's opened, remove the blank worksheets or add a macro (I've seen some examples of such a macro) that will do just that when the report is opened?

In all honesty I'm pretty un-educated when it comes to SSRS and the reports in question were made by someone else and I have the task of managing them.

So do you think removing the blank sheets in C# after the report has been generated?

ChrisHunter 152 Posting Whiz in Training Featured Poster

Is there a way to remove blank worksheets from an excel report that is generated in SSRS?

I've done some research and i could find solutions such as removing blank rows and even entire sheets but only via marcor's in excel, which won't work in my case as the report generates a new excel file each time the report is run so there is no template excel file to do it in.

Is there a way, either in SSRS before the report is finialised, or in the C# side after the report is finialised but before it's displayed, to remove the blank worksheets from the report?

Thanks in advance.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Apologies, once again I didn't read the post properly.