|
-
Aug 21st, 2006, 05:13 AM
#1
Thread Starter
Addicted Member
Advice on what to learn for a test...
Hi guys,
Seeing as I've had a fair bit of help on here recently I thought this might be a good place to post this. I have a test on Wednesday with a company who will decide whether or not I will be suitable to take on as a work placement (work experience). One week ago I didn't even know what ASP.NET was and I had never used C#, so I've spent most of the week learning how to use Visual Web Developer and making data bound controls work with data source controls to display information from a database. I can now do this in design and source view, but I haven't really touched much on the C#. I have just got an email back from the company with feedback on what I've done so far...
Basically, its sounds a lot like he's using the IDE a little too much, ask him, now that he's got used to the Visual studio .NET IDE environment, that he should concentrate on coding up an aspx page manually, and produce the .cs code-behind file.
He should not be placing his c# code in the aspx file, he should have a .cs code-behind file.
It's good that he's looked into the DataGrid control, ask him if he can come up with a paging solution, for the GridView, thinking specifically about an index column. If he has time ask him to look into the repeater control.
He will be expected to understand the c# code-behind, so, for example, if there was a necessary line of code missing between the server connection and the datagrid bind function call, he would be expected to know which one was missing.
Can anyone help me by suggesting what he might ask me to do in C#? What does he mean by coming up with a paging solution using an index column? All the stuff that I've done so far in the aspx page (connecting to the database to display the info) can that be done in C#? Is that what I'm being asked to do in one way or another? I would agree that I'm in a sticky situation right now as I don't really know any C# but if I can get to grips with the part he wants me to do then maybe I will stand a chance.
Any help is much appreciated! Thanks in advance
-
Aug 21st, 2006, 09:57 AM
#2
Re: Advice on what to learn for a test...
First things first: ASP.NET is a technology. You would be using a codebehind language with it, such as VB.NET or C# or J# or Delphi.NET.
What they basically want you to know well is ADO.NET. Database is everything!
http://samples.gotdotnet.com/quickst...sOverview.aspx
Second, more important, is to avoid the drag and drop method of coding, as it doesn't let you learn everything you could learn with it. Instead of creating a data source through the wizard in IDE, create one yourself in the codebehind, bind your datagrid/gridview to it and head on from there.
Once you start on the ADO.NET you will understand more than half the points mentioned in the email that they sent you.
Further, you can implement paging for a gridview. When they say "thinking specifically about an index column," I am guessing that they mean it is to be sorted by a specific column.
-
Aug 21st, 2006, 09:59 AM
#3
Re: Advice on what to learn for a test...
He could ask you anything, it's not a predictable situation. He might even ask about data access layers, where you place your database-oriented methods in a separate class library. Do you know about class libraries?
-
Aug 21st, 2006, 10:35 AM
#4
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
Well I'm pretty much a novice to be honest, and I think they may have got the wrong end of the stick as to how much I actually know as it all went through a woman who doesn't know anything about all this stuff.
Things I do know are they use C#. After talking to a few peope after I got the mail I think he is suggesting that I learn how to do 'custom paging' rather than clicking the 'enable paging' check box. After reading up on this a little bit today but it looks really tough for what I know already - which is very little. I think they want me to do all the things I can already do in IDE but in C#. I mean I can quite proficiently build gridviews and data sources and link them up in the source view of the aspx page without looking in design view, but by the sounds of things I need to be able to do this in C#, in which case I wouldn't even know where to start so I'm bricking it. If I can just figure out how to do custom paging on a gridview (even if it's from memory) then that will be a start.
I don't think I know about class libraries, but then again I've practically finished a 700 page book on beginning ASP.NET 2.0 with C# so it's possible it was briefly mentioned.
-
Aug 21st, 2006, 10:38 AM
#5
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
This is what I was originally told to do, then today I got that email I posted above:
I have a small challenge for you! I would like you to come back in two weeks and do a simple test, we programme in C#, concentrate on retrieving datasets and their display via ASP.NET controls. (I understand it's easier than it sounds!)
-
Aug 21st, 2006, 10:43 AM
#6
Re: Advice on what to learn for a test...
It is easier than it sounds!
I am surprised though, how could this 700 page book not give you any knowledge of codebehind? Please tell me it was NOT a Wrox Press book.
You should first start with the ADO.NET tutorial I linked you to. It should give you a good idea how to retrieve data into a dataset, and bind to a datagrid. Once you do that, you can take the next step. I have done custom paging myself, I can show you an example of that if you'd like.
-
Aug 21st, 2006, 10:58 AM
#7
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
Thanks Mendhak, you're very helpful. How did you know it was Wrox Press haha! There is one chapter called 'Code' and I didn't understand a word of it. They make you do exercises without explaining what anything does. Pretty much everything was done in design view and anything done in codebehind was not explained properly at all. I also have a SAMS Teach Yourself which I haven't looked at but that's in VB and you probably hate them just as much!
I'll carry on reading that link you sent me and hopefully it will shed some light and fast, the closer to Wednesday it gets the messier my pants will be.
It would be good to see an example of custom paging, especially if it's in C# as I'm easily confused.
Thanks for all your help.
-
Aug 21st, 2006, 11:04 AM
#8
Re: Advice on what to learn for a test...
My example is in VB.NET, but C# and VB.NET are quite interchangeable if you understand what the code is doing.
http://www.vbforums.com/showthread.php?t=349671
Also, go back and re-study that Code chapter, ask questions here if you need to. But ask them in the ASP.NET forum because more people visit it.
Out of curiosity, can you get me an amazon link to the 700 page book you mentioned? I'm hoping you got the wrong Wrox Press book, because I studied from Wrox Press as well, those many years ago... "Professional ASP.NET 1.1" it was called.
-
Aug 21st, 2006, 11:08 AM
#9
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
Thanks, I'll take a look at that.
Here is the book "Beginning ASP.NET 2.0 with C#"
http://www.amazon.co.uk/gp/product/0...66239&v=glance
There is a Professional version of the book, but I'm sure I wasn't ready for that.
-
Aug 21st, 2006, 11:11 AM
#10
Re: Advice on what to learn for a test...
You were actually halfway there. You had the Teach-Yourself book, which is what you should have and probably did start with. I then recommend the Professional ASP.NET book from Wrox Press. I trust them almost blindly to teach well. I guess the problem was the 700 page book for beginners, the problem is the direction in which it sends you.
Anyways, for future reference, I definitely recommend this:
http://www.amazon.co.uk/gp/product/0...66239&v=glance
The professional one.
-
Aug 21st, 2006, 11:50 AM
#11
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
I've been reading through that link you posted (I'm still on the first page actually) and I've been trying to do an example myself just to get a basic idea of how I can deal with databases in code. I'm not sure what I've done wrong here but it must be something stupid. I have a button on the page and when I click it the egg timer comes up for about 15 seconds then goes away and no messages or anything appears. And of course nothing is written to the database. Perhaps I haven't indicated where the database is properly?
Code:
protected void Button1_Click(object sender, EventArgs e)
{
string Message = null;
SqlConnection Conn = new SqlConnection("Server=local;Trusted_Connection=yes;database=WroxUnited");
SqlCommand CmdInsert = new SqlCommand("INSERT INTO Products (Name, Description, Price, PictureURL) VALUES ('BOB', 'BOB', '10.99', 'DOGS.GIF')", Conn);
try
{
Conn.Open();
CmdInsert.ExecuteNonQuery();
Message = "New record inserted into Products table";
}
catch (Exception myException)
{
Message = "Couldn't insert record: " + myException.ToString();
}
finally
{
Conn.Close();
}
}
}
-
Aug 21st, 2006, 12:00 PM
#12
Re: Advice on what to learn for a test...
Lol @ egg timer. 
After you do this, go check the table Products. You should see the new rows added. Nothing is happening because you have sent no feedback to the page. You should place a label on your page, and in the finally statement, do this:
Label1.Text = Message;
-
Aug 21st, 2006, 12:05 PM
#13
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
I've refreshed the table and looked at the data and there is nothing new in there. Why would that be? Also, what does 'Message' mean, I thought it would just pop up in a message box when it was done with the message I typed in the code. If not, why is there info in the message?
Thanks
-
Aug 21st, 2006, 12:08 PM
#14
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
OK, I went for the label message and it showed the one in the 'Catch' section so I guess something is up.
-
Aug 21st, 2006, 12:20 PM
#15
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
When it says
SqlConnection Conn = new SqlConnection("server=local;database=WroxUnited;Trusted_Connection=yes");
What is local? I've just copied this off the site (well actually it was slightly different but neither work). I guess this is the bit that is wrong?
-
Aug 22nd, 2006, 05:03 AM
#16
Re: Advice on what to learn for a test...
(local) means your local instance of SQL Server. Do you have one?
Do you have a WroxUnited database in yoru SQL Server?
What was the error message coming up in the label?
-
Aug 22nd, 2006, 05:07 AM
#17
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
The message in the label was just what I had written in the 'Catch' scenario which was 'Couldn't do it'. I have a WroxUnited database in my project which is in the App_Data folder. I've done all my configuring of the databse within the database explorer of Visual Web Developer.
-
Aug 22nd, 2006, 07:26 AM
#18
Re: Advice on what to learn for a test...
Oh sorry, didn't notice that. In the catch portion, use this instead:
Message = myException.Message
That should give you the real error message.
-
Aug 22nd, 2006, 07:40 AM
#19
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
It didn't show anything that time. I commented out my other message and I just saw the egg timer for a few seconds and then nothing. How rude
-
Aug 22nd, 2006, 07:54 AM
#20
Re: Advice on what to learn for a test...
That is odd. Ok, try stepping through your code this time. You know how to do that right?
Go to the first line of that sub
string Message = null;
Press F9, so that a breakpoint is set. Run the application. Eventually the flow will 'break' there and the line with the breakpoint will appear yellow. Press F10 to proceed down the lines of code, it will eventually jump to the catch block as you say. When it gets to the line of exception, move your mouse over 'myexception' and it should show you what the error is. It can NOT be blank!
-
Aug 22nd, 2006, 08:44 AM
#21
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
myException = {"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,...
-
Aug 22nd, 2006, 09:14 AM
#22
Re: Advice on what to learn for a test...
This is probably the first time you're using SQL Express on your machine isn't it? It's a setup issue, basically. Go through this link to fix it so that your code can proceed. And hurry, Wednesday is almost upon us! 
http://www.datamasker.com/SSE2005_NetworkCfg.htm
-
Aug 22nd, 2006, 09:17 AM
#23
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
And hurry, Wednesday is almost upon us!
Tell me about it! I'll check out that link now.
-
Aug 22nd, 2006, 09:19 AM
#24
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
Oh and by the way, all this talk of servers and stuff, is it ok than I'm doing all of this on my laptop? It's not going to conk out?
-
Aug 22nd, 2006, 10:08 AM
#25
Re: Advice on what to learn for a test...
Sure, I program on my laptop too.
What are your laptop's specs though?
-
Aug 23rd, 2006, 06:02 AM
#26
Re: Advice on what to learn for a test...
-
Aug 23rd, 2006, 06:14 AM
#27
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
haha, unfortunately so! However....
I've managed to wangle an extra week by stating my case to them i.e. I spent a week getting to grips with ASP.NET with Visual Web Developer in general and then two days before they told me I would be expected to look at the C# code and spot missing lines, aswell as being able to create a custom paging solution.
In all honesty I would have been completely screwed if I had turned up today, I really do know nothing about C#. After admitting this to myself I have downloaded Visual C# Express Edition and have started some beginner video tutorials which I'm told at the end I'll be able to make an RSS reader program so that will be cool. On the other hand I'm on lesson 6, Object Oriented Programming and I'm finding it very difficult to understand everything to do with classes, methods, objects, arrays, namespaces, instances, inheritance and just about every other word I've heard so far. If I can get to grips with this in a week then maybe I can start to move back to using C# with ASP.NET. At the moment however I'm just about limited to textbox1.text = textbox2.text but I'll get there!
Thanks for all your help by the way, it's now hit me that I won't be able to learn all this as quick as I thought, but hopefully the video tutorials from learnvisualstudio.net will make it easier for me to grasp.
-
Aug 23rd, 2006, 07:45 AM
#28
Re: Advice on what to learn for a test...
Concentrate on the OO concepts most of all, you'll need them for everything you do. Understanding those concepts will alleviate your present difficulty and make things 5x easier.
-
Sep 3rd, 2006, 03:54 AM
#29
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
Hi again,
Good news, I am now a Junior Developer! Or at least that's the title they have offered me. Thanks for all your help Mendhak and others, I've still got a lot to learn before I go in (Monday 11th is my first day) but you've been a real help and no doubt you will continue to be once I've started!
I'm not quite sure how I got it to be honest. This lady asked me to create a Repeater control and connect to an Sql database using C#. That's probably easy peasy for you guys but I hadn't actually touched on the Repeater control while I had been learning and all my database connections had been done through the ASP SqlDataSource control in Visual Web Developer which I then found out didn't exist Visual Studio.
So anyway, she said I could use Google if I needed to and then said she'd be back in half an hour. So as soon as she left I opened up the browser and surprise surprise the wireless connection is not working, and to top it off they have no msdn help files installed. So although I wanted a go at doing what she had asked it's not something I could figure out in my head, so I thought the next best thing is to do something completely different that I can do and at least it shows I know something. So I built a Gridview (Datagrid in VS!) and a drop down box in the source code and connected them to an SqlDataSource to work together. It didn't work of course because no SqlDataSource existed in the ASP source code, but I assured her it worked in Visual Web Developer and she must have liked me because then the boss came in and offered me the placement.
So although I essentially bum fluffed it I got in, and now I have a week to learn what I couldn't do in the test and then some. My biggest fear now is how different Visual Studio is to the free Visual Web Developer.
To summarise...thanks! Oh and in case you're wondering Mendhak, I never got round to figuring out the C# data connection but it's the first thing on my to do list which starts right now!
-
Sep 5th, 2006, 06:56 AM
#30
Fanatic Member
Re: Advice on what to learn for a test...
Sounds to me like they use Visual Studio 2003? I wouldn't think that Visual Studio 2005 and the new Visual Web Developer would have different components in the toolbox.
You know I went for an interview for a web developer position about a year ago before I had much real world ASP.NET experience. I had plenty of C#/VB.NET/C++.NET experience, and I could do simple things in ASP.NET, but at the end of the interview the woman looked at me and said you seem more like a junior developer and we're trying to fill our middle position (out of three - junior, middle, and senior). I looked at her in absolute shock and asked if there was anything I could do. She gave me an image file from their design guys and asked me to slice it up with Adobe ImageReady. I spent all night learning how to do that and making a sample web page. She said they were impressed and would have gone with me but they found another guy with a little more experience and (here's the biggy) was available for more than 3 months - I had to go back to school in September. Anyways, I was new to building professional web sites and I learned the nested tables method. Needless to say a year later I know the wonders of CSS and will never use tables for anything other than tabular data!
I'm posting because I saw you were hired as a junior developer and my interviewer labeled me a junior developer. I thought it was an interesting comparison.
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Sep 5th, 2006, 07:21 AM
#31
Thread Starter
Addicted Member
Re: Advice on what to learn for a test...
Hiya,
Thanks for posting, sounds similar to what I did in a way. I went to the first interview knowing nothing and just hoping for some work experience and came back in a little under 3 weeks having learnt as much as I could in that time. Although I didn't manage to do what they asked they said they were impressed with my dedication. The strange thing is everything I have received from them since I left suggests it is a real job as opposed to a placement. My contract is the same as any other contract and my title is Junior Developer so it seems I might have got lucky and they'll train me up to stay with them. Makes sense really as there wouldn't be a lot in it for them if they trained me and then let me go.
Interesting what you say about Visual Studio 2003. Sounds a lot like that is the case. What are the tell tale signs, because I might be able to remember. One things for sure they had DataGrids instead of GridViews, does VS 2005 still call them DataGrids? The design surface was grey with spots all over it and I couldn't actually find the toolbox. I'm not sure if it's possible but they probably disabled it as they wanted me to do everything in code and they left me alone to do it. The Database explorer was over on the left. I can't remember a lot more than that but I do remember that at the top of the window it said something something C#, but I had design and html views.
-
Sep 5th, 2006, 07:34 AM
#32
Re: Advice on what to learn for a test...
I'm convinced you were attempting VS 2005 concepts in VS 2003, luckily you got the job, they do seem to be pretty loose about requirements since it is after all, for the position of a junior developer whom they will be looking to train and ramp up on skills. My advice, in the long term, is to stay with them for 2 years minimum. The skills and experience you gain just by working in such an environment cannot be found in any books anywhere. "Best practices," you could refer to them as.
VS 2003 has no gridview, just the datagrid. And there are no SQLDataSources for that matter. You can probably now see why I was against the drag-drop-easy method of creating connections. The codebehind approach to creating connections in both versions of ASP.NET is essentially the same, and that made my transition to ASP.NET 2.0 easy.
Now, Visual Web Developer is just one aspect of Visual Studio development. In Visual Studio, you can create windows forms, web applications, windows services, web services, console applications, class libraries, loads and loads of stuff. It is a very extensive and encompassing development tool, well worth the pricetag it comes with. There are also more debugging features with Visual Studio. Now that you've been hired there, you can try asking them for a copy of Visual Studio to take home and work on, or stay late at the office for a few days trying out everything in Visual Studio. There is much to learn.
And I quote from Hamlet, "There are more things in heaven and earth, gneville16, than are dreamt of in your philosophy."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|