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

Reputation: 3 Apprentice
Group:
Members
Active Posts:
31 (0.05 per day)
Joined:
11-July 12
Profile Views:
289
Last Active:
User is offline Jan 24 2014 05:40 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   jgferguson has not set their status

Posts I've Made

  1. In Topic: How to use more than one Quote in String

    Posted 24 Jan 2014

    Hi there,

    Without testing your code, have you tried using single quotes around the command? I have found this works in most of the scenarios where double quote marks are used.

    Failing that, would need to look into it a bit further but it would be worth ruling a single quote out first.

    Hope this helps,
    Jerry.
  2. In Topic: connection not initialized properly in VB.Net code

    Posted 23 Oct 2013

    Hi,

    At first glance I can't see any obvious issues. Have you tried using a breakpoint at the ExecuteNonQuery line and testing for the state of the connection? My personal preference is to build the sql string then open the connection, execute the query and close the connection straightaway. This means the connection is not maintained while you are moving from row to row but only opened to do the work and then closed.

    Also you might want to check on the use of parameters in MySQL - see:-

    http://dev.mysql.com...parameters.html

    I think you would need to replace all the question marks in your procedure call with the parameter names.

    Hope this helps,
    Jerry.
  3. In Topic: Date Conversion Error In Select Query - SQL

    Posted 23 Oct 2013

    Hi,

    I have had similar problems recently when upsizing MS Access mdb's to SQL Server.

    The most effective method I have found is to use the Convert function in T-SQL to convert the string value to a date, as in

    Convert(date, '23/10/2013', 103)

    The 103 is used to determine the format of the date string, in this case UK format (dd/mm/yyyy). The full list can be found at:-

    http://msdn.microsof...y/ms187928.aspx

    Your code would become something like:-

    Dim DA_TripAlert As New SqlDataAdapter("SELECT * FROM D_Trip WHERE Payment='Pending' _ 
    AND LoadDate <= convert(date, '" & Date.Today.AddMonths(-1).ToShortDateString & "', 103)", ConStr_TransLink)
    
    



    Hope this helps,
    Jerry
  4. In Topic: Load PDf Files in Vb.net application

    Posted 23 Oct 2013

    Hi Christian,

    As normal there is more than one way to achieve what you want. One method that I have used in the past is to create a new form in the project and put a Web Browser control on the form.

    http://msdn.microsof...#code-snippet-2

    In the button click event of the form where you enter the file name of the pdf file you would just open the new form and set the WebBrowser.Navigate property as the full path and file name. This has a benefit that the form with the open file can be contained within your application.

    As an aside, would it be worth thinking about using the OpenFileDialog to allow the user to select the pdf file they wish to open from those in the relevant folder. This would remove the need to type the file name into the text box and thus the chance of the wrong file name being entered.

    http://msdn.microsof...filedialog.aspx

    Hope this helps.

    Jerry.
  5. In Topic: Populate ComboBox with DataTableAdaptor Query (VB 2010)

    Posted 2 Oct 2013

    Hi,

    You are nearly there - the data source for the combobox control should be set to the container for the data that is filled by the Adapter.

    Dim DA as new DataAdapter(sqlString, Connection)
    Dim DT as new DAtatable
    
    DA.Fill(DT)   'using the sql string to select the contents of the Combobox
    
    cboFormNo.DisplayMember = "FormNo"
    cboFormNo.ValueMember = "FormNo"
    
    cboFormNo.DataSource = DT
    
    
    


    In any code I do I bind the datasource to the control after stating the DisplayMember and ValueMember - not sure if this can be done first or not but it works for me. Try binding datasource to control AFTER setting display and value members.

    Good luck,
    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?