|
You have my sympathy, but at Uni you are also expected to help yourself (at least I think so, I never actually went).
benducky wrote: he has been teaching the class out of a book 'Visual Basic is easy steps'.
well, maybe its a good starting point for pepole who have never programmed?
benducky wrote: he learnt programming in the 1970's.
Well, I learnt in the early 80's, and it was a lot harder than it is now, so no need to be derogatory.
benducky wrote: Provide a pseudocode design
Means you don't have to know any specific language, just show the logic to do it. Surely you can do this?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
On what you need to do, that is between you and your lecturer.
On how to do it, assuming you want to learn programming, and want to pass your course, you should:
- study the course material, no matter what it is or how old it is;
- buy and study additional material. And no I have no book recommendation for VB.NET but here[^] is my view on books.
Furthermore make Google your friend, and learn from the many good articles here on CodeProject.
|
|
|
|
|
Well, if I were you my first step would be to buy a copy of the book. Pretty cheap on amazon Visual Basic Easy Steps - Anderson[^].
Question though. Why are you doing a university course that teaches from a ten year old text book on an extinct programming language? Even the MS extended support period for VB6 has been and gone! Or is this a course in programming history? It certainly is to far adrift from current programming to be of any use in the real world.
Having said that, the principles of programming are unchanged since the seventies. Good code is still good code. Languages may advance, but design patterns never change, and all good programming is done to design patterns (because the design pattern tells us the best way to do it, and if you code the best way without knowing the pattern before then you just re-invented the wheel, but well done anyway), most of which where first worked out in the seventies!
|
|
|
|
|
benducky wrote: Over the last 8 weeks I've been having lectures with him he has been teaching the class out of a book 'Visual Basic is easy steps'.
And you are saying that over those 8 weeks you have made no attempt to discuss this with your lecturer. Or to go to the library and check out some alternative books that could help you? Or search the internet for useful articles?
You can learn the fundamentals of programming in Visual Basic (or most languages) in a weekend by reading a self-study guide. As to writing pseudo-code that is just a simple matter of expressing a possible solution to your problem in simple steps. Try explaining in pseudo-code how to open a door, that should get you started.
|
|
|
|
|
Hi,
you do make an impression of a little bit lazy, but nevertheless, instead to admonish you like the others I'm going to try to help you.
Your question is not really specific in regard of the pseudo code but one design that comes to mind are three methods.
One to read in the records of the salespeople, one to analyze and one to write out the result. And of course the main method.
Of course, one could do it in one method.
Definition of SalesPeopleRecord
FIELD DESCRIPTION DATA TYPE SalesPeopleRecord
Name : Character
Sale : Decimal
Main method:
Main Procedure SalesPeople
CALL ReadSalesPeopleRecords with filename
CALL AnalyzeSales with SalesPeopleRecordList
CALL PrintHighestSale with highestRecord
End Main Procedure
First method could be (read records):
Procedure ReadSalesPeopleRecords
While Not End Of File
Create New SalesPeopleRecord
Read Name of Salespeople
Store Name in Record
Read Monthly Sales Total
Store Monthly Sales Total in Record
Store Record in Record List
End While
Return Records
End Procedure
Second (analyze):
Procedure AnalyzeSales
Set highestSale to 0
Declare highestRecord
For Each Record In SalesPeopleRecords
IF CurrentRecord.Sale > highestSale THEN
SET highestRecord to CurrentRecord
SET highestSale to CurrentRecord.Sale
ENDIF
End For Each
Return highestRecord
End Procedure
Third (print):
Procedure PrintHighestSale
Write highestRecord.Name
Write highestRecord.Sale
End Procedure
Bye,
Thomas.
|
|
|
|
|
Hi,
I have an ASP.NET web application, code behind in VB.NET, and a separate VB.NET Console application.
I've created a button on the web page which when clicked should call the Console applition. like this...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
ConsoleServer.Main()
End Sub
ConsoleServer is a module of the Console Application which does all processing, I have added this module to my Web Solution.
It does go into the module, but doesnt open up the console window. I expect it to open the console window at the point where i write text(Console.WriteLine...). It just passes that point without opening the console window.
What do I need to do?
Many thanks
|
|
|
|
|
Well, firstly if it DID open a console window (and it won't), it would be on the server where you are running IIS, but most importantly, you CANNOT run a console app from a web page. It just cannot be done, otherwise there would be even more viruses than there are.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Oh, but it DID open a console window - on the server, and on a different desktop than the one you see when you login on the server.
You cannot launch a console window on the client side from an ASP.NET application.
|
|
|
|
|
Ok I sort of understand how it works now.
I've just tested and it seems like it is running the external application(just not showing the console window and I understand why it wont show it)
Sorted. Many thanks guys.
|
|
|
|
|
Hi folks,
I have created an app which takes a SQL table from a SQL 2005 server (separate from the machine running the application) queries it in some nice ways and generates an Excel spreadsheet with the required data.
The problem I have is that when I publish the App and get another machine to install it using the "setup" file created, it wants to download and install:
.Net Framwork 3.5
SQL 2008 Express edition
Both take ages to download and install and I don't see why the SQL Express is required.
Can I stop this process from happening as part of the install. Are they BOTH necessary??
Just to point out, AFAIK there is definitely no requirement for SQL 2008 Express to be installed on the client, the app just uses a connection string to connect to the remote database and queries are passed as strings..
Thanks
|
|
|
|
|
So, what did you do to create the installer??
|
|
|
|
|
Morning....
I didn't do anything...
You click on Builds, then Publish.. You select a path and then whether the clients will want automatic updates and then that it...
The setup files appear in the designated folder, the client runs them and then get prompted to install .Net 3.5 and SQL Express 2008....
Are these components defined in the code somewhere, or when the build is completed?? As it doesn't appear obvious.
As a side note, the application was designed and tested using connections to SQL Express (Locally installed), but then the connection strings were changed to use SQL 2005 (full vers)
|
|
|
|
|
nhsal69 wrote: then Publish.. You select a path and then whether the clients will want automatic updates
That's what I thought. VS Express is coming up with the dependanies itself.
I don't use the Express Editions, but in the full versions you can open the Project Properties dialog and there is a Publish tab in there. Clicking on that, you get a page that lists a bunch of information about how the project is, obviously, published, with a button labeled Prerequisits. Clicking on that button, you get a dialog that lists a of items that the installation will depend on being installed. On mine, I can just clear the dependancies I don't need, close the dialogs and re-publish the app.
|
|
|
|
|
It's resolved now...
I copied the entire Form1.vb and form1design.vb etc to notepad, created a new project and then pasted the code back into the new project..
This appears to have resolved the problem, I'm guessing that there must have been some residual "reference" somewhere which forced VB Express to require the above a pre-req, even tho they weren't utilised in the code...
thanks for you thoughts anyway...
|
|
|
|
|
I m doing a package in that MS Comm is using for data Receiving and sending.
I connected to machine and check communication it is working properly in VB and VB.NET.
If i short cable the package working in vb properly but in VB.NET OnComm event not working(Event not Enable). If i change Buad Rate then Junk value is comming and OnComm event enabled).
How can i solve this Problem.
|
|
|
|
|
You and we can help solve this problem if you reword your question to something that makes sense.
You lost me with what you posted!
|
|
|
|
|
I would like to output a decimal number and have the output routine
do the rounding for me. That is, I do not want to have to call the
routine Math.round. Please consider the following code fragment:
Console.WriteLine("Student {0} as a GPA of {1}", _
Name, gpa )
In this case, the variable gpa is of type decimal. I want to modify my format
string so that gpa will be rounded to two decimal places. Is there a way to
do this?
Thanks
Bob
|
|
|
|
|
|
As was posted,string formatting enables you to display just the number of decimal places you require, rounding is a different matter. unless you are prepared to write your own rounding algorithm (not difficult, but tedious and slower than any built in function) then what is wrong with Math.Round ? It does what it says on the tin, and it's in the System namespace and therefore unlikely to cause any slowdown due to loading excessive extraneous assemblies.
|
|
|
|
|
You can use the Format() function:
Console.WriteLine("Student {0} as a GPA of {1}", _
Name, Format(gpa, "0.00"))
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Hi everyone,
would like to import data from an excel table into a SQL table. The problem is that the data from only one Excel table has to be imported into 3 different tables of the same sql-database. So the main problem in my eyes is to associate every excelcolumn to the matching column of one of the trhee diffferent sql-tables. Of course this has to be done manually by the user. I could immagine two listboxes on a form. First-one for the excelcolumns (source) and anotherone for the sqlcolumns(destination) A third listbox could display the columns the user put together.
I have already managed to get the excel-data displayed in a datagridview without opening the excelfile with this code.
oAdapter = New System.Data.OleDb.OleDbDataAdapter( _
"SELECT * FROM [" & strSheetName & "]", OleDbExcelConn)
thanks in advance,
Jeiss
|
|
|
|
|
Why not select * to a data set, get the column names and do it yourself if you know where they should map up to? You could use LINQ or call a bunch of queries to load the data. Alternatively create a stored procedure that selects * into, processes it, and then frees the temporary table if you use one.
|
|
|
|
|
Hi Ted2102,
i suppose that your suggested solutions would do for an excel file with known columnnames and a constant number of columns. But that's not my case. The files i want to be able to import will not always have the same number of columns and their columnames will change from file to file. The only thing these files have in common is that they will contain contact informantions, like name, address, telephonenumber... a.s.o. That's why i wanted to be able to assign the columns of the Excel-file manually (in the listboxes of the form) to the ones of my SQL database.
I'm sorry for your efforts in helping me, but in the mean time the situation has changed and i have found a nice code snippet which does the kind of work i need.
As a beginner in VB i would like to progress in programming. And that's why i think it would be more important to practice a little bit with the technics used in this snippet. So my new question is now: Does anybody have a link to a good tutorial about learning "List(of Type)" and about "LINQ-queries" for beginners?
Any link or code-snippet would be appreciated.
Thanks for your help
|
|
|
|
|
Unfortunately, I have not found an ideal reference yet. I only found some documentation on a Microsoft website so far.
|
|
|
|
|
Hi Ted2102,
never mind. The documentation from Microsoft is not that bad. But there are not really enough easy code examples. They tend to explain everything only once, showing only one example. All that i can tell by now is that working with linq seems to be much more efficient.
By the way i discovered a pretty well-filled collection (not a collection in the Visual basic sense) in a separate CodeProject Forum.
Last but not least, don't bother about the continuously changing name under my messages. I only experienced little logon problems.... But everything should be fine now.
Anyway, thanks you for your help.
|
|
|
|