Tech Off Thread

8 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Where do I look to find what I want?

Back to Forum: Tech Off
  • User profile image
    pdcjlw1

    I am new to the object oriented Visual Studio programming and I am having a lot of trouble finding out how to do stuff I want to do. Let me give you an example. If I want to round a varible to 2 decimal places where do I look for the sytax of doing that? How do I know if I just need to use a .round type of thing or will it be more like a round(x,Var1) kind of thing. Or how do I setup a dropdown box to read from a table instead of a manual entered list. And the biggest one, how do I connect to a data source. I can copy the string someone else has used to connect to say SQLServer, but there seems to be several ways you can connect to a database. Is one better than the other? Does it depend on the kind of data or the amount of data or how busy the database is? Or maybe how many different tables I will use? And don't get me started on DataTables. I really don't know what it is they do? Any good references on this stuff?

     

    thanks.

  • User profile image
    NotSoTragic​Hero

    A few places.

     

    Check out the MSDN Library.  Along with the API, it has a lot of good references and tutorials.

    http://msdn.microsoft.com/en-us/library/default.aspx

     

    If you can't find what you need by doing a Google search, you can always just ask here, or on the MSDN or CodeProject forums:

    http://social.msdn.microsoft.com/Forums/en-US/categories

    http://www.codeproject.com/script/Forums/List.aspx

  • User profile image
    pdcjlw1

    NotSoTragicHero said:

    A few places.

     

    Check out the MSDN Library.  Along with the API, it has a lot of good references and tutorials.

    http://msdn.microsoft.com/en-us/library/default.aspx

     

    If you can't find what you need by doing a Google search, you can always just ask here, or on the MSDN or CodeProject forums:

    http://social.msdn.microsoft.com/Forums/en-US/categories

    http://www.codeproject.com/script/Forums/List.aspx

    Ok. I just went to the MSDN and looked up DataTable and it gave me this:

     

    Dim workTable as DataTable = New DataTable("Customers")

    And says the new DataTable is now called Customers. So what does that make workTable? Why can't I just say:

    Dim Customers as DataTable.

  • User profile image
    spivonious

    I'd forget about database access until you get a little more experience with making windows and getting some code down. When you're ready, read some materials about ADO.NET.

     

    Contrary to some older languages, like VB6, most functions in .NET are in the class that they work on. So where in VB6 you'd call UCase$("hello") to get "HELLO", in .NET you'd say Dim s as String = "hello", s.ToUpper() to get "HELLO". Intellisense is great for discovering these things. Just make a variable and type a dot after it. The list of functions will pop up and you can hover over them to get basic descriptions.

     

    edit: for your question about DataTables,

     

    Dim workTable as DataTable = New DataTable("Customers")

     

    creates a new DataTable object, referenced by the variable "workTable", with a Name property of "Customers". If this table was in a DataSet referenced by ds, you could then type ds.Tables("Customers") to get a reference to the table.

     

    Dim customers as DataTable

     

    doesn't create any object at all.

     

    Dim customers as New DataTable() (or Dim customers as DataTable = New DataTable(); same thing)

     

    creates a new DataTable that has nothing in its Name property.

     

    It sounds like you're not too experienced with object-oriented programming. This is required knowledge for understanding and programming with the .NET platform.

  • User profile image
    Sven Groot

    To be honest, it sounds like you'd benefit from some tutorials or introductory books rather than trying to learn from reference materials. Just using reference materials is possible if you have a reasonable understanding of the fundamentals, but it sounds like you're not quite there yet.

     

    I'm sure somebody here can recommend a good book to get you started on .Net and OO concepts.

  • User profile image
    pdcjlw1

    Sven Groot said:

    To be honest, it sounds like you'd benefit from some tutorials or introductory books rather than trying to learn from reference materials. Just using reference materials is possible if you have a reasonable understanding of the fundamentals, but it sounds like you're not quite there yet.

     

    I'm sure somebody here can recommend a good book to get you started on .Net and OO concepts.

    That makes sense. I really don't get to do much new stuff at work. Once I told them I wanted to learn the .Net programming they gave me existing programs to maintain. So when I go look at them I really don't see much I understand. I think a book that gave you projects to complete so that instead of just reading about how it works I would have projects to complete that would allow me to use the new techniques. So like, read a chapter on some feature, then here's a project that makes you code using that feature. Something like that I think would work well.

  • User profile image
    blowdart

    pdcjlw1 said:
    Sven Groot said:
    *snip*

    That makes sense. I really don't get to do much new stuff at work. Once I told them I wanted to learn the .Net programming they gave me existing programs to maintain. So when I go look at them I really don't see much I understand. I think a book that gave you projects to complete so that instead of just reading about how it works I would have projects to complete that would allow me to use the new techniques. So like, read a chapter on some feature, then here's a project that makes you code using that feature. Something like that I think would work well.

    Wrox's Beginning series tends to do that, building up an app or two as you go through the chapters. Well, excluding Beginning ASP.NET Security, because that approach didn't fit.

     

  • User profile image
    SlackmasterK

    A lot of the old VB stuff still works in VB.NET, and a lot of VB.NET coders still do things the old way.

     

    So the way you know might work, but your app's future coders will hate you for it. Smiley

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.