Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8253153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:46:45+00:00 2026-06-08T00:46:45+00:00

I want to develop generalized application which can works with all type of databases

  • 0

I want to develop generalized application which can works with all type of databases (Oracle, MySQL, SQLite). So I have provide different data source to the each form from one common place.

And I also want to use parametrized query who can accept multiple parameters. I am unable to to pass multiple parameters using DbParameter, it works fine with single parameter query but
not with many.

So please help me…

            dbconnect dc = new dbconnect();//class which contain data source name
            DbConnection con;
            DbCommand cmd;
            DbDataReader dr;
            DbProviderFactory df;
            DataAdapter da;

            df = DbProviderFactories.GetFactory(dbconnect.dbprovider);
            con = df.CreateConnection();
            con.ConnectionString = dbconnect.sqlstr;
            con.Open();
            cmd = df.CreateCommand();
            cmd.CommandText = "update customer set" + " name='@name'," + "address='@address'," + "phone='@phone' " + "where code='@code';";
            cmd.Connection = con;
            DbDataAdapter daa = df.CreateDataAdapter();
            daa.UpdateCommand = cmd;

            DbParameter param = df.CreateParameter();

            param.ParameterName = "@name";
            param.Value = txtname.Text;

            param.ParameterName = "@address";
            param.Value = txtadd.Text;

            param.ParameterName = "@phone";
            param.Value = txtphone.Text;

            param.ParameterName = "@code";
            param.Value = txtcode.Text;
            daa.UpdateCommand.Parameters.Add(param);
            daa.UpdateCommand.ExecuteNonQuery();

            **But this not working.** 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:46:47+00:00Added an answer on June 8, 2026 at 12:46 am

    You’re only creating one parameter

            DbParameter param = df.CreateParameter();
    
            param.ParameterName = "@name";
            param.Value = txtname.Text;
    

    etc…

    You need to create a new DbParameter for each one

            DbParameter param = df.CreateParameter();
            param.ParameterName = "@name";
            param.Value = txtname.Text;
            daa.UpdateCommand.Parameters.Add(param);
    
            param = df.CreateParameter();
            param.ParameterName = "@address";
            param.Value = txtadd.Text;
            daa.UpdateCommand.Parameters.Add(param);
    

    etc….

    and add each one to the command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop an Android application which can run on all ,screen type
I want to develop a program in c# that can target and application or
I want to develop an app which can Block the Invocation of some Blackberry
I want to develop an Android app in which I have key log press.
I Want to develop a app which can identify corporate email accounts and when
I want to develop a simple iPhone application. However, I do not have the
I want to develop an app which broadcast messages which can be viewed only
I want to develop Widows Application in Gujarati language. But i don't have any
I want to develop an chat application, in which I successfully added files of
I want to develop an app which can send and receive data from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.