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

  • SEARCH
  • Home
  • 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 8099565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:26:57+00:00 2026-06-05T22:26:57+00:00

Possible Duplicate: How can WCF consuming data from database phpmyadmin? I want to ask

  • 0

Possible Duplicate:
How can WCF consuming data from database phpmyadmin?

I want to ask about the connection string that should i write at WCF. My database is host at phpmyadmin.
How should I write the connections string? if the database is using microsoft access or sqlserver that run at my computer, I done it already. Now, I’m curious if my database at phpmyadmin.

Honestly, I already asked this question in this forum yesterday. I say a big thanks to whom answer my question but I dont think that is a answer. I’m sorry for being stupid and don’t understand what you said yesterday. If you get mad, you don’t need to answer. thanks.

Out of the topic, this my WCF code.

public class Jobs : IJobs
{
    SqlConnection conn = new SqlConnection("Data Source=127.0.0.1; Initial Catalog=mydatabase;User=ael;Password=123456;Integrated Security=False");
    
    SqlDataAdapter da;
    DataSet ds;
    Data data = new Data();
    List<Data> listdata = new List<Data>();

    public DataSet Details()
    {
        conn.Open();
        ds = new DataSet();
        da = new SqlDataAdapter("Select * from data", conn);
        da.Fill(ds);
        conn.Close();
        return ds;
    }

    public Data GetDetails(int jobid)
    {
        conn.Open();
        ds = new DataSet();
        da = new SqlDataAdapter("Select * from data where id = " + jobid, conn);
        da.Fill(ds);
        if (ds.Tables[0].Rows.Count > 0)
        {
            data.userid = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            data.firstname = ds.Tables[0].Rows[0][1].ToString();
            data.lastname = ds.Tables[0].Rows[0][2].ToString();
            data.location = ds.Tables[0].Rows[0][3].ToString();
            ds.Dispose();
        }
        conn.Close();
        return data;
    }

    public List<Data> GetAllDetails()
    {
        conn.Open();
        ds = new DataSet();
        da = new SqlDataAdapter("Select * from data", conn);
        da.Fill(ds);
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            listdata.Add(
                new Data
                {
                    userid = Convert.ToInt32(dr[0]),
                    firstname = dr[1].ToString(),
                    lastname = dr[2].ToString(),
                    location = dr[3].ToString()
                }
            );
        }
        conn.Close();
        return listdata;
    }
}

this is the wpf

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, RoutedEventArgs e)
    {
        if (textbox1.Text.Trim().Length != 0)
        {
            ServiceReference1.JobsClient jc = new ServiceReference1.JobsClient();
            var x = jc.GetDetails(Convert.ToInt32(textbox1.Text));
            if (x.userid != 0)
            {
                textbox2.Text = x.userid.ToString();
                textbox3.Text = x.firstname;
                textbox4.Text = x.lastname;
                textbox5.Text = x.location;
            }
            else
                MessageBox.Show("RecordNotFound ... !", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
        }
        else
            MessageBox.Show("EnterID", "Message", MessageBoxButton.OK, MessageBoxImage.Warning);
    }

    private void button2_Click(object sender, RoutedEventArgs e)
    {
        ServiceReference1.JobsClient jc = new ServiceReference1.JobsClient();
        dataGrid1.ItemsSource = jc.Details().Tables[0].DefaultView;
    }

    private void button3_Click(object sender, RoutedEventArgs e)
    {
        ServiceReference1.JobsClient jc = new ServiceReference1.JobsClient();
        dataGrid1.ItemsSource = jc.GetAllDetails() ;
    }
    
}

I already create a user at phpmyadmin, and use it at my WCF. but whenever I run, its show "login failed for user ael".
Is there something I need to change in the connection string?
thanks before.

  • 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-05T22:26:59+00:00Added an answer on June 5, 2026 at 10:26 pm

    If I understand correctly you need an example for the connection string.
    So for the connection string format please see ConnectionsStrings.com

    For example, if you are using the standard port and did not change it:

    Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
    

    Then you can to use the MySQL Connector (Namespace MySql.Data.MySqlClient downloadable here) and connect to the MySQL database programatically as explained in detail in this tutorial: Connection to the MySQL Server.

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

Sidebar

Related Questions

Possible Duplicate: Injecting data to a WCF service I have a WCF service that
Possible Duplicate: Can I retrieve an ipad unique device identifier that through Safari with
Possible Duplicate: Can't convert String into integer in ruby/ruby-on-rails I'm running through a tutorial
Possible Duplicate: Can I change all my links to just //? I've learnt that
Possible Duplicate: Can't pass mysqli connection in session in php Many of us have
Possible Duplicate: Can I set a breakpoint on 'memory access' in GDB? I want
Possible Duplicate: Can i override HOME Button on my own Home-Screen from my application?
Possible Duplicate: Can select * usage ever be justified? Curious to hear this from
Possible Duplicate: Can a recursive function be inline? I think that recursive function defined
Possible Duplicate: Can you remove elements from a std::list while iterating through it? I

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.