Hi Everyone,

 

My first post to the group!

 

I'm fairly new to ASP.NET and I'm trying to do a fairly simple insert
into a MySQL table, here is the code:

 

Sub addGame_Click(ByVal Sender As Object, ByVal e As EventArgs)

        Const strConnString As String = "Driver={MySQL ODBC 3.51
Driver};Server=localhost;Database=adnlleague;" & _

            "User=adnladmin;Password=password;Option=3;"

        Dim objConn As New Data.Odbc.OdbcConnection(strConnString)

        objConn.Open()

 

        Const strSQL As String = "Insert Into adnll_games (game_name,
status, added) Values (" & _

            "@game_name,@status,@date)"

        Dim cmdInsert As Data.Odbc.OdbcCommand

        cmdInsert = New Data.Odbc.OdbcCommand(strSQL, objConn)

 

        Dim storNameParam As New Data.Odbc.OdbcParameter("@game_name",
System.Data.Odbc.OdbcType.VarChar, 100)

        storNameParam.Value = gameName.Text

        cmdInsert.Parameters.Add(storNameParam)

 

        Dim storStatusParam As New Data.Odbc.OdbcParameter("@status",
System.Data.Odbc.OdbcType.VarChar, 100)

        storStatusParam.Value = strGameStatus

        cmdInsert.Parameters.Add(storStatusParam)

 

        Dim storDateParam As New Data.Odbc.OdbcParameter("@date",
System.Data.Odbc.OdbcType.VarChar, 100)

        storDateParam.Value = System.DateTime.Now.Date

        cmdInsert.Parameters.Add(storDateParam)

 

        cmdInsert.ExecuteNonQuery()

        bindCurrentGames()

        objConn.Close()

    End Sub

 

The problem is nothing happens, no error message, no insert occurrs etc.
Can anyone see what I'm doing wrong?

 

Thanks.


*****
This e-mail and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. The 
contents of this e-mail represent the views of the individual(s) named above 
and do not necessarily represent the views of Merthyr Tydfil County Borough 
Council.

Mae'r e-bost hwn ac unrhyw ffeiliau a drosglwyddir gydag ef yn gyfrinachol ac 
wedi'u bwriadu ar gyfer pwy bynnag y cyfeirir ef ato neu atynt. Mae cynnwys yr 
e-bost hwn cynrychioli barn y sawl a enwir uchod, felly nid ydyw'n dilyn ei fod 
yn cynrychioli barn Cyngor Bwrdeistref Sirol Merthyr Tudful.

Cyngor Bwrdeistref Sirol Merthyr Tudful
Canolfan Dinesig
Stryd Y Castell
Merthyr Tudful
CF47 8AN

Merthyr Tydfil County Borough Council
Civic Centre
Castle Street
Merthyr Tydfil
CF47 8AN

Teleffon\Telephone: 01685 725000

http://www.merthyr.gov.uk

[Non-text portions of this message have been removed]






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/u8TY5A/tzNLAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to