• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 510
  • Last Modified:

SQLite parameters

Hi experts

Can someone show me how to write an sqlite parameter, here is the sql parameter i need to change to accept an sqlite patameter.

comm.Parameters.Add("@Name", System.Data.SqlDbType.NVarChar)
comm.Parameters("@Name").Value = txtName.Text

Hope somebody can help.
0
dizzycat
Asked:
dizzycat
  • 2
  • 2
1 Solution
 
käµfm³d 👽Commented:
It should be the same. Are you receiving an error?
0
 
dizzycatAuthor Commented:
Yes, it says there is a problem with the parameters
, I just thought that the sqlite parameters were
Different
0
 
CodeCruiserCommented:
Try using Parameters.AddWithValue("paramname", value)
0
 
käµfm³d 👽Commented:
I usually let .NET figure out the DB type, unless there is some problem where it can't. Does this work better?
comm.Parameters.Add(new SQLiteParameter("@Name", txtName.Text))

Open in new window

0
 
dizzycatAuthor Commented:
That's great, thankyou.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now