jgferguson's Profile User Rating: -----

Reputation: 3 Apprentice
Group:
Members
Active Posts:
26 (0.08 per day)
Joined:
11-July 12
Profile Views:
197
Last Active:
User is offline Mar 15 2013 04:03 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   jgferguson has not set their status

Posts I've Made

  1. In Topic: Datagridview with combination of calculated fields and database fields

    Posted 5 Mar 2013

    Hi,

    I'm sure a DataGridView would provide what you are looking for.

    The trick is to put all the information you need into a DataTable or DataSet that will be the DataSource for the grid, add the new column and scroll through the table to add the values for the new column. Once completed then bind the datatable to the datagridview.

    I tend to use a DataTable as I normally don't need to refer to more than one source at a time, as opposed to a DataSet that can contain more tha one table.

    Once you have a DataTable you can add columns programatically:

    dim DT as new DataTable
    dt.columns.Add("Column1")
    
    
    


    I tend to find it is easiest if I populate the datatable from a sql query via a DataAdaptor and then add columns as required. Once you have added the necessary columns you can scroll through the rows in the table and add the new values to the extra column.

    There are numerous resources online that can guide you step by step through this process.

    Hope this helps.

    Cheers,
    Jerry.
  2. In Topic: Setting a filter on a dataset in a form

    Posted 5 Mar 2013

    Hi,

    Your Row Filter is basically a SQL 'Where' clause and you could look for further information on that.

    In your clause you have 2 comparisons in the one clause: the '=' and the 'like'. You only need one or the other and since you know what you are looking for I would just use the '=', so that you have

    
    "Cust_code = '" & me.tag & "'"
    
    
    


    Hope this helps.
    Jerry.
  3. In Topic: Display controls using loop and inserting records to Access DB, How?

    Posted 28 Jan 2013

    Hi,

    Question:- is the number of subjects per class always going to be 15 or will it vary depending on the choice of class?

    The better way to do this would be to split the information into two tables in your Access DB:

    Table1 - ClassInfo - the class name, section, a ClassID (number value as a primary key)

    Table2 - SubjectInfo - Subject ID (number value as Primary Key), ClassID (number ID as Foreign Key; this is used to identify which class the subject is related to), SubjectName, SubjectMaxPeriods.

    Thus you will then benefit from the designed flexibilities of a Relational Database such as MS Access.

    If you are unsure I am sure there are plenty of tutorials that will advise accordingly on '1 to many' relationships in database design.

    Hope this helps.
    Jerry.
  4. In Topic: Delete query

    Posted 25 Jan 2013

    Hi,

    We will need to see what the SQL command is in the DeleteMe() routine.

    For MySQL databases the Delete syntax can be found at:- http://dev.mysql.com.../en/delete.html

    Sorry can't be more help.

    Cheers,
    Jerry.
  5. In Topic: Sql connection

    Posted 25 Jan 2013

    Hi,

    It would help us greatly if you could explain what the problem you have is.

    I assume you are getting the message 'connection to SQL Server failed' which means there is a problem with your connection string. The following website will help point you in the right direction: http://www.connectionstrings.com/

    As we don't know what flavour of database you are attempting to connect to we can be of little further help.

    As a pointer perhaps, on my local machine I run SQL Server Express 2008 R2 - the connection string for my applications is 'Server=LocalHost\SQLEXPRESS; Database=MyDB; ...'

    Sorry can't be of more help - connectionstrings.com is a very useful site and will be a good place to start.

    Cheers,
    Jerry.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

jgferguson has no profile comments yet. Why not say hello?