Results 1 to 4 of 4

Thread: VS 2008 Pro and database.

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    4

    VS 2008 Pro and database.

    Greetings,

    I am very new to VBasic and sure as hell newbie when it comes to database. I have learned just enough to design form, to do just basic calculation based on programmed formula. Recently I got Visual Studio 2008 Pro which has VBasic and different kind of database project along with many other projects that goes way over my head.

    Anywho, after reading several tutorials from many website, FAQ, forums, etc. I am still stuck. My project consists of 2 sections. Users create/load profile. Then do a search for specific item by words (*strings*) , select the item from result list, and do some calculations. The 2nd section is for me (Admin) to add/remove/edit items to/from database. Here is my problem..

    1) I am trying to figure out what my code should be in order to add/delete/update since most FAQ/Tutorial deal with VB6 and Access/MySQL or other things. There are too many Application versions, but none seem to include VStudio 2008 Pro guide. Not to mention after reading most of them tutorial, guide, etc confused me even more.

    2) For user section I don't want to bind database to textbox since I want the user be able to select name/item from search query/list. Then load the appropriate data based on selected name to the textbox.

    =========
    The following things I use...
    Since I have no clue about database, I selected Local Database which is MS SQL (not MySQL)

    frmACCAdmin
    CLTable ([ID], Name, Skill, Level, WL, Qty)
    Craftlist.mdf
    CraftlistDataSet.xsd

    Following code for adding didn't work..

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Me.BindingContext(CraftlistDataSet, "CLTable").AddNew()
    MsgBox("Successfully Inserted")
    End Sub


    All it does it give me pop up "Successfully Inserted" , but did not add given data to database. No error message of any kind, No error indicated in VS2008 coding/design window.

    I appreciate your help and time. Thanks in advance, most likely will have more questions later. Just need to get over this bump.

    Xad

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    4

    Re: VS 2008 Pro and database.

    Yes I have seen that one, though seems bit confusing because it seems in this tutorial he is creating a database table from within the frm and btn. If when dealing with much larger database, that is a lot of coding to create one, especially when it comes to allow Nulls, Primary Key (identifier) etc. Binding several tables together etc.

    I have a table already made using Add New Project > Database... Which in effect confuses me as far as code goes, because most of the code would be different.

    For example:

    da.UpdateCommand = New OleDbCommand("UPDATE tbl_Master SET FirstName = bla bla..

    I don't use OleDb, I use SQL, yes I also read that we have to change it to our database. But what is the command for that or where do i look it up to replace OleDbCommand?

    Another example:
    dr = ds.Tables(0).NewRow()

    I understand dr and ds, those are assigned, I understand NewRow(), but what is Tables? Is that the table name Tables or just a command? Would it in my case be

    dr = ds.CLTable(0).NewRow()

    or something else?

    For dataset, he did .. Dim ds As New DataSet() .. I already have a dataset, so just say ... Dim ds As CraftlistDataSet() ... ?

    The other thing is, there is buttload of codes in frmACCAdmin since i bound the textbox to database. Why the codes for textbox and button size is coded is beyond me but hey, not going to touch that.

    Is it better to use VS way of making database or still recommend to manually create a database by coding within the frm?

    Again I appreciate the help.

    Xad
    Last edited by Xadavus; Dec 11th, 2008 at 06:31 PM.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VS 2008 Pro and database.

    Oh boy... All I can recommend is going to your nearest book store and picking up some sort of "Databases - Beginners Guide" (title of course isn't real, it would be coincidental otherwise).

    Sorry pal, but I think you need to educate yourself to some level before you begin programming.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width