In XML.....mysql connection string and queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmohan
    New Member
    • May 2008
    • 6

    In XML.....mysql connection string and queries

    Hi everybody,


    How to write the connection string and sql queries in the XML.

    I use the mysql database.

    I use the following connection string and query using asp.net with C#.

    Connection String:

    con=new OdbcConnection( "Driver={My SQL ODBC 5.1 Driver};Server= VBNET4;Port=330 6; Database=netmus k; User=root; Password=harsha ;Option=3; Min Pool Size=5; Max Pool Size=60; Connect Timeout=2;");
    con.Open();



    Query:

    try
    {
    con.Close();
    con.Open();
    cmd = new OdbcCommand("Se lect firstname,usert oolbarid,pass_w ord from user_table where firstname='" + txt_username.Te xt + "' and pass_word='" + txt_password.Te xt + "'", con);
    dr = cmd.ExecuteRead er();

    while (dr.Read())
    {
    String getuname = dr.GetString(0) ;
    String getloginid = dr.GetString(1) ;
    String getpword = dr.GetString(2) ;
    }
    dr.Close();



    Please help me


    Thanks in Advance.

    J. Mohan.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    1. What are the results that you are getting now? What results are you expecting?

    2. What is in your database now? Are you sure you're accessing the right tables?

    3. Are you getting a particular error message? If so, could you post it?

    Comment

    • jmohan
      New Member
      • May 2008
      • 6

      #3
      Originally posted by jkmyoung
      1. What are the results that you are getting now? What results are you expecting?

      2. What is in your database now? Are you sure you're accessing the right tables?

      3. Are you getting a particular error message? If so, could you post it?

      Thanks for your reply,

      Here are my clarifications,

      (1)I need to save and retrieve data from mysql database using xml

      (2)My datbase is mysql. Sure, I am accessing the right tables.

      (3). No I am not getting any error message with this javascript. The connection is established and data is save and retrieved from the mysql database using the javascript.

      I need to work with xml instead of javascript.

      Please give me the suggestion,

      Thanks in Advance,

      J. Mohan.

      Comment

      • jkmyoung
        Recognized Expert Top Contributor
        • Mar 2006
        • 2057

        #4
        I need to work with xml instead of javascript.
        This doesn't quite make sense.

        XML is just a format. It doesn't specifically do things unless you define a language and processing rules for it, eg xslt. XQuery is a form of xml that is capable of handling the syntax of queries, but doesn't connect to the database for you.You can use javascript to get the output back as XML...

        Define what XML application you're using, and then it might be possible to help.

        Comment

        • jmohan
          New Member
          • May 2008
          • 6

          #5
          Originally posted by jkmyoung
          This doesn't quite make sense.

          XML is just a format. It doesn't specifically do things unless you define a language and processing rules for it, eg xslt. XQuery is a form of xml that is capable of handling the syntax of queries, but doesn't connect to the database for you.You can use javascript to get the output back as XML...

          Define what XML application you're using, and then it might be possible to help.
          Hi jkmyoung,

          I am developing a toolbar in the toolbar studio. The toolbar is located at internet explorer browser like yahoo, google toolbars.

          Toolbar controls gets the functionality by using the javascript.

          Toolbar has a dropdown list. Toolbar should get the data from the mysql database and the data should be added to the dropdown list.

          Therefore, there is a need of mysql database connection and query statement to do the both job.

          I am unable to do that both job using javascript. Therefore, I have planned to make the mysql database connection and sql queries statement using xml which is a platform independent for exchanging information. So, I asked you like that.

          Could you please give me an example of the XML with javascript for making mysql database connection and saving and retrieving data using sql query statement.

          Thank You,

          J. Mohan

          Comment

          Working...