Click here to Skip to main content
15,910,083 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Acessing certificate store of local system Pin
Dave Kreskowiak29-Feb-08 3:27
mveDave Kreskowiak29-Feb-08 3:27 
GeneralCan't find appropriate control Pin
cstrader23228-Feb-08 3:32
cstrader23228-Feb-08 3:32 
GeneralRe: Can't find appropriate control Pin
Xmen Real 28-Feb-08 3:42
professional Xmen Real 28-Feb-08 3:42 
GeneralRe: Can't find appropriate control Pin
cstrader23228-Feb-08 4:01
cstrader23228-Feb-08 4:01 
GeneralRe: Can't find appropriate control Pin
Xmen Real 28-Feb-08 4:36
professional Xmen Real 28-Feb-08 4:36 
GeneralRe: Can't find appropriate control Pin
cstrader23228-Feb-08 4:57
cstrader23228-Feb-08 4:57 
QuestionMySQL Database entry problem Pin
freefika28-Feb-08 3:05
freefika28-Feb-08 3:05 
GeneralRe: MySQL Database entry problem Pin
Dave Kreskowiak29-Feb-08 3:40
mveDave Kreskowiak29-Feb-08 3:40 
I don't use MySQL so my answer may be wrong.

Your "function" is badly written. It doesn't return a value, so it's a Sub, not a Function. Your code also specifies that a query string be passed to it, though that string MUST use the two hard-coded parameters in the code.

Your also not specifying the size of the fields when you create the parameters. I don't know if this is causing the problem, but I'd fix it to be sure:
Public Sub InsertBankLogo(ByVal BankName As String, ByVal BankLogo() As Byte)
    Dim cn As New ObdcConnection(ConString)
    Dim cmd As New OdbcCommand("INSERT INTO tblBank (Bank_Name, Bank_Logo) VALUES (?, ?)", cn)
    cmd.Parameters.Add("@BNAME", OdbcType.VarChar, field length).Value = BankName
    cmd.Parameters.Add("@PIC", OdbcType.Binary, field length).Value = BankLogo)

    cn.Open()
    cn.ExecuteNonQuery()
    cn.Close()
End Sub

There's about a dozen more things wrong with this, but the biggest part is that you're not specifying the length of the fields that the SQL code is expecting.



A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007




Questionvector Pin
Danisto27-Feb-08 23:13
Danisto27-Feb-08 23:13 
GeneralRe: vector Pin
Christian Graus27-Feb-08 23:18
protectorChristian Graus27-Feb-08 23:18 
GeneralRe: vector Pin
Colin Angus Mackay29-Feb-08 0:44
Colin Angus Mackay29-Feb-08 0:44 
GeneralRe: vector Pin
MidwestLimey29-Feb-08 5:58
professionalMidwestLimey29-Feb-08 5:58 
GeneralRe: vector Pin
Danisto2-Mar-08 19:36
Danisto2-Mar-08 19:36 
Questionvb code on dates Pin
Danisto27-Feb-08 21:58
Danisto27-Feb-08 21:58 
GeneralRe: vb code on dates Pin
Christian Graus27-Feb-08 22:58
protectorChristian Graus27-Feb-08 22:58 
GeneralRe: vb code on dates Pin
Paul Conrad28-Feb-08 6:43
professionalPaul Conrad28-Feb-08 6:43 
QuestionSearching a Specific Record from DB !! Pin
Vikrant Badhai27-Feb-08 21:27
Vikrant Badhai27-Feb-08 21:27 
AnswerRe: Searching a Specific Record from DB !! Pin
Christian Graus27-Feb-08 23:00
protectorChristian Graus27-Feb-08 23:00 
GeneralRe: Searching a Specific Record from DB !! Pin
Vikrant Badhai27-Feb-08 23:05
Vikrant Badhai27-Feb-08 23:05 
GeneralRe: Searching a Specific Record from DB !! Pin
Christian Graus27-Feb-08 23:10
protectorChristian Graus27-Feb-08 23:10 
GeneralRe: Searching a Specific Record from DB !! Pin
Thomas Krojer27-Feb-08 23:22
Thomas Krojer27-Feb-08 23:22 
GeneralRe: Searching a Specific Record from DB !! Pin
AndrewVos27-Feb-08 23:30
AndrewVos27-Feb-08 23:30 
GeneralRe: Searching a Specific Record from DB !! Pin
Dave Kreskowiak28-Feb-08 3:11
mveDave Kreskowiak28-Feb-08 3:11 
GeneralRe: Searching a Specific Record from DB !! Pin
Vikrant Badhai6-Mar-08 20:52
Vikrant Badhai6-Mar-08 20:52 
GeneralRe: Searching a Specific Record from DB !! Pin
Jeremy Falcon28-Feb-08 3:48
professionalJeremy Falcon28-Feb-08 3:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.