SQLite parameters

Posted on 2011-05-03
Last Modified: 2012-06-27
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.
Question by:dizzycat
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    It should be the same. Are you receiving an error?

    Author Comment

    Yes, it says there is a problem with the parameters
    , I just thought that the sqlite parameters were
    LVL 83

    Accepted Solution

    Try using Parameters.AddWithValue("paramname", value)
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    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


    Author Closing Comment

    That's great, thankyou.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
    Creating and Managing Databases with phpMyAdmin in cPanel.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now