ChrisHunter 152 Posting Whiz in Training Featured Poster

Can you show us what you've managed to do so far please?

If you're having trouble getting the information out of your tables then the best thing to do is to retrieve all information using the same SQL querey.

How are the two tables linked?.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Apparently Apple are supposidly releasing 2 iPhones this year, the 5S and a cheaper iPhone for people with a lower budget . . . all a load of Bull to me, they churn them out with new thing that aren't even ground breaking anymore and people that are hooked on Apple witll buy them (or people that have invested too much money in accesseries to changed).

I bought my sister's old 3Gs a few months ago, they are a good bit of kit but there's no point in paying for "the next big iPhone" every 6 months.

ChrisHunter 152 Posting Whiz in Training Featured Poster

You could get the HitInfo for the DGV and then use that to set the AutoSizeMode property of the DGV's column like this:

private DataGridView.HitTestInfo hitInfo;

private Void MyDataGridView_ColumnHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
    //// Gets the details of the click that occurred on the DGV \\\\
    hitInfo this.MyDataGridView.HitTest(e.X, e.Y);

    if (this.hitInfo.Type == DataGridViewHitTestType.ColumnHeader)
    {
        //// Sets the AutoSizeMode property of the column clicked \\\\
        this.MyDataGridView.Columns[hitInfo.ColumnIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;            
    }
}

It may be more managable to do it this way and DataGridView.HitTestInfo is extremely useful when working with DGVs.

ChrisHunter 152 Posting Whiz in Training Featured Poster

If you're gaming online I'd suggest you get as usage limit as possible, it might be easy to reach your limit, especially if there are a few people using the same connection.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Saving Private Ryan - my No.1 film of all time, along with Black Halk Down.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Mikey's way will work (I've done it before myself) but like he said it can get messy. If you're doing it that way make sure you start the name of all your objects with the type of layout you want (e.g. adminFirstNameTextBox for admin view or say userFirstNameTextBox for a generic user).

Another way is to make use of the Component object but having one form but multiple Components that just sit on top of the form. This way only the relevant component needs to be displayed dependent on the type of user, rather than having to keep making objects visible and invisible.

As well as being a bit tidier by seperating the controles for the different useres, it would add a bit of structure to your program and make editing the controles for the different types of users a lot easier (Users will more than likely want to add or remove object like textBoxes... trust me it comes from experience).

ChrisHunter 152 Posting Whiz in Training Featured Poster

Can you claify your questions please? You've started a question in the thread title and finished it in the post itself and it's not very clear.

Also, Is there a different name for classes in C# when it comes to Java?

Yes objects in both Java and C# will have a class behind them but they may have different names (e.g. GridView is the Java version of C# DataGridView). Java may also have some object that C# doesn't and vice versa.

is an object in Java and a method in C# similar?

No, object in Java are the same as objects in C# in that they are an object (e.g. a textBox object represents the textBox on your screen and defines the properties and functionality for the textBox). Objects in both Java and C# contain methods which provide the functionality for that object.

Is there a way to see the codes of classes like "messagebox", using Visual Studio 2010?

It's usually hiden so that it can't be changed but it's properties can be set and it's built in methods can be used.

Best thing to do is to get a book about the fundamentals of object oriented programming, I can't remember the name of the book I used but I'll post it for you if I can dig it out. Also have a look at C-Sharp station, it has a some good tutorials that you might find useful...

ChrisHunter 152 Posting Whiz in Training Featured Poster

The best control to use when reading records from a database is probably a DataGridView as it's just a table which you can configure to display as much or as little as you like. The only difficult aspect of a DGV is getting your head around accessing individual cells, but if you've used arrays in vb you'll find it a breeze!

ChrisHunter 152 Posting Whiz in Training Featured Poster

or you can do textBox1.Text = comboBox1.SelectedText; if your comboBox displays strings.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Sorry I must have missread your first post. My reply above is a solution if you want to convert a dat formatted as "dd/mm/yyyy 00:00:00" this has been loaded from an SQL database, to dd/mm/yyyy format in C#.

Could you post your solution so I can have a look at how you did it please? Also it would help other people with the same issue.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Data Protection Act 1998, did that one to death at collage!

ChrisHunter 152 Posting Whiz in Training Featured Poster

I think it was just that company had a big ego, the words the recruiting agent said was "they said you didn't say how good you thought the company was enough and how much you would love to work for them", I had done research on the company and said it would be a great company to work for because of they producing and that I'd love to grow with the company and was willing to use new technologies etc... I think I did everything that was needed other than kissing their proverbial boot so I'm glad I didn't get the job in all honisty.

Rather than looking for a a kiss arse my current position took me on for me potential, enthusiasm and ambition to learn new technologies which is why I would have still chosen my current job over the other regardless

ChrisHunter 152 Posting Whiz in Training Featured Poster

When I interviewed for my job I went into the interviews I convinced myself I didn't want the job so that I wouldn't feel as nervures but still give the best possible interview I could. Don't be over confident but make sure you self yourself as a confident programmer and peerson in general.

I interviewd for a position about 6 months ago and they said they love me as a person and what i could do but I didn't praise the company enough, so make sure you do your research on the company and ask questions about things like staff turn-around, staff development schemes, technologies you'll be using (other then C# .NET) and are there any plans to move into different technologies in the future.

Luckily enough for me, not getting the job mentioned above meant I was able to interview for my current position which is exactly what I was looking for and I'm lucky enough to be working with a really good development team.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Click Here there are plenty of useful links from that search

ChrisHunter 152 Posting Whiz in Training Featured Poster

What did the error say?

Try putting buff = double.TryParse(txtTotal.Text, out total); in a try catch like this to see if it works:

try
{
    double.TryParse(txtTotal.Text, out total);
    buff = true;
}
catch
{
    buff = false;
}

Also you return result but result is set to 0 and never changed so you will always return 0.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Incase anyone needs it here is how the above can be done:

string.Format("{0:dd/MMMM/YYYY}", Convert.ToDateTime(reader["Date"]).ToLongDateString());
ChrisHunter 152 Posting Whiz in Training Featured Poster

@ddanbe you're right I was always told if you can you can use Java it would be easy to transfer to C# because of how similar.

C# sharp is just a highter level language than the other members of the C family, it automates more of the complex tasks like memory management and it's syntax is generaly closer to natural language sp it's easier to understand.

ChrisHunter 152 Posting Whiz in Training Featured Poster

You're right, for an instance method you have to declare an instance of the class it is defined in as below:

Form1 myForm = new Form1();    

public Mainform()
{
    this.myForm.PopulateComboBoxe(this.myComboBox);
}

and for static methods you DON'T need to declare and instance of the class that the method is declared in:

public MainForm()
{
    Form1.PopulateComboBox(this.myComboBox);
}

It means you can just access that one aspect of the class without having to create an entire instance of the class and have to do all the messing around that comes with it (i.e. passing in values to set it the instance).

It's useful to make your generic methods static (like a comboBox population method) which you just need to pass in a stored proc name.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Try putting a break point in a the position in your code where data is frist read from the file to see if it actually reads the data, then press F11 to step through the code and hover over your variables to try and see where the code is going wrong.

Sorry I can't be more helpful at the moment.

ChrisHunter 152 Posting Whiz in Training Featured Poster

It's not so much a case of which form is better it's just a case of unfortunatly there a lot of posters, who are quite often student's who go to university for the money (they counted for 1/3 of my course at uni), who post on a number of forums to do as little work as possible because after all the more doors you knock on the more answers you get.

I think its the design and colour scheme of DaniWeb, one of it's most difinitive aspects (a friend once said "what is that purple forum called"), that attracks more beginners because the colour is welcoming and not as intimidating as hard white schemes that are often used on programming forums. Unfortunatly people often get tared with the same brush (young drivers for example).

So as much as it's necro posting dioioib is providing the answer to a question someone else might have in the future which we can't really complain about too much (as long as it's a valid answer).

ChrisHunter 152 Posting Whiz in Training Featured Poster

If something is inaccessable due to protection level they are usually set to private and means they are NOT set to public. If a textbox on form1 is set to private it mean that the textbox can only be seen by form1 but NOT form2 and like wise for a textbox on form2 this is set to private and not public.

In design view go to the properties off all your textboxes and change their "Modifiers" property to say "public". This will make the textbox accessable and solve your "inaccessible" issue.

ChrisHunter 152 Posting Whiz in Training Featured Poster

it's set to private, make it public and it should work

ChrisHunter 152 Posting Whiz in Training Featured Poster

Unfortunatly the majority of the unfinished threads tend to stem from people who want their assignments doing for them without having to learn or do anything themselves, even if it's just Googling it. So they usually abandon the post when they realise they're not getting spoon fed.

It's a shame because it seems to have gotten worse over the last 6 months and puts people off posting here or geniune threads get buried in the mess, I know I post less because of it.

Sometimes poeple figure it out for themselves and don't post their solutions (i might have done that in the past).

ChrisHunter 152 Posting Whiz in Training Featured Poster

Set the "Modifiers" property of the controles on Form2 to "public".

  • At the top of Form1 declare a new instance of Form2 so you can access the controls on Form2 Form2 frm2 = new Form2();.
  • Next, in a method in Form1 do frm2.emriBox.Text = this.emriBox.Text; (this will put the contents of emriBox on Form1 into emriBox of Form2.
ChrisHunter 152 Posting Whiz in Training Featured Poster

You have to show that have at least attempted to solve the problem yourself and we're not supposed to give you the code as you might just copy it without understanding it and learning anything from it but the follow the instruction below (the line of code which is also below will put the input from form1 into form2, the rest is up to you).

At the top of Form1 declair an instance of form 2, make sure the textBox in form2 is set to public and do the following:

form2.textBox1.Text = this.textBox1.Text;
ChrisHunter 152 Posting Whiz in Training Featured Poster

Do you mean want to make the DataGridView un-editable ?

If so do the following:

dataGridView1.Enabled = false;

It stops the user from being able to use the DGV and then you can implement an "Edit" button whitch sets "Enabled" to "true".

ChrisHunter 152 Posting Whiz in Training Featured Poster

@Ancient Dragon, I think you're right about not being able to establish a DB through languages like C#, i tried it a while ago (I wanted to open and run an SQL file with a DB creation script in when a program is run for the first time) but there had to be a connection to a server already established before the script to create the DB could be run.

ChrisHunter 152 Posting Whiz in Training Featured Poster

"There's nothing more frightening then driving with a live goddamn cougar next to you"

"Well let me just quote the late-great Colonel Sanders, who said..."I'm too drunk to taste this chicken"

Both by Ricky Bobby from Talladega Nights: The Ballad of Ricky Bobby

ChrisHunter 152 Posting Whiz in Training Featured Poster

Can you be a bit clearer please @bnitishpai

Do you want to know how create a DB using a language like C# or Java in Visual Studios rather than straight in SQL Server Management Studios, if so what language are you using?

ChrisHunter 152 Posting Whiz in Training Featured Poster

Can you be a bit clearer please @bnitishpai

Do you want to know how create a DB using a language like C# or Java in Visual Studios rather than straight in SQL Server Management Studios, if so what language are you using?

ChrisHunter 152 Posting Whiz in Training Featured Poster

My power is I can break anything without actually wanting to. How many pull-ups can you do ? I can only do 10 and I'm a climber so you'd think I'd be able to do more :(

ChrisHunter 152 Posting Whiz in Training Featured Poster

Have a look at this Link, its another article here on DaniWeb for people in the same position as yourself. It give you a good list of tutorial websites and book that are great for learning, I've used a lot of them myself but I would suggest starting with the very basics by buying a book such as "HeadFirst C#".

ChrisHunter 152 Posting Whiz in Training Featured Poster

Pennywise the clown from the Steven King's I.T!

ChrisHunter 152 Posting Whiz in Training Featured Poster

Arr I get it now, thanks for the explanation.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I'm reading through a C# coding standards document and come across a section that reads as follows:

  • Try to prefix Boolean variables and properties with "Can", "Is" and "Has".

Can anyone give me an example of hows it's done or maybe a useful link on the subject please ?

I've had a bit of a Google myself but couldn't find a difinative answer.

Thanks in advance.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Where does the age of the employee come from is it calculated using their DOB? use the GROUPBY clause to group the employees by age

ChrisHunter 152 Posting Whiz in Training Featured Poster

It depends on where you get it I think, the foot and hands are supposed to be the worst.

Apparently it's really painful for muscular people.

ChrisHunter 152 Posting Whiz in Training Featured Poster

If you're strings will always contain words seperated by spaces you cour tokenise the string by the spaces.

You can also convert the string to a char array, loop through the array until you come to the first letter of a required word and keep looping through the array until the sequential array indexes match a given word.

ChrisHunter 152 Posting Whiz in Training Featured Poster

If the tatto studio isn't clean, you keeps scratching the tattoed area or it's not properly look after when it's healing it can get infected but if you've got your whits about you you'll be fine.

I got vouchers to get a tatto from my partner last year but I **** out and gave them away because i didn't know what I wanted.

ChrisHunter 152 Posting Whiz in Training Featured Poster

@HappyGeek not a hardcore gamer but you 2nd prestige already ! thats more than casual gaming to get to that level already !

The lack of team work and the kill steaks is the reason I switched to battlefield.

I played COD 2 and 4 in comps for the pc so it was all about tactics and team work so to hear COD is going back to it's routs a bit has me interested... Looks like I'm having my brother round with his copy to try it for myself.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I haven't played BO2 yet I dont like the rout call of duty multiplayer has gone down. I'll probably borrow BO over the Christmas break to play the Zombies though, it looks awesome !

ChrisHunter 152 Posting Whiz in Training Featured Poster

It's a joke about men... thinking its a sprint and not a marathon...

ChrisHunter 152 Posting Whiz in Training Featured Poster

@Stuugie IMHO the COD graphics haven't been that ground breaking since Modern Warfare, Black Ops Zombies is a lot of fun though! have you played Zombies on the Black Ops 2 yet?

ChrisHunter 152 Posting Whiz in Training Featured Poster

@Zick there was roumers of a movie being made for God of War, they're making the 4th game in the series too.

ChrisHunter 152 Posting Whiz in Training Featured Poster

I read somewhere that the chicken evolved from a T-rex... don't know how true this is, if it is true it's quite ironic.

http://www.dailymail.co.uk/sciencetech/article-448283/Proof-fearsome-T-Rex-evolved-chicken.html

ChrisHunter 152 Posting Whiz in Training Featured Poster

Assuming you're using Visual Studio, in the properties window for the picture box there should be a 'Mouse Over' event, which if under the picture box's events list, that will do the trick.

ChrisHunter 152 Posting Whiz in Training Featured Poster

Are you going to type the names of the train station into code or are they retrieved from a database ?

ChrisHunter 152 Posting Whiz in Training Featured Poster

Try using this:

System.Diagnostics.Process.Start("Your file path (including file name with file extention");
ChrisHunter 152 Posting Whiz in Training Featured Poster

The row and cell index's are dependent on which row and cell you want to store the value:

This is for the first cell of the first row

dataGridView.Rows[0].cells[0].value = textBox1.Text;
ChrisHunter 152 Posting Whiz in Training Featured Poster

Same as Stuugie I'm on Xbox, would be good to have a gaming rig but they're just too expensive and need up-grading too often.