Click here to Skip to main content
16,004,587 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I have an application that uses a Crystal Report.
My database uses a password and it's okay in my pc. But what do I have to do if I need to install the application in another pc with a different mysql password?

All I have in my .NET C# win form is:
C#
private void VReport_Load(object sender, EventArgs e)
{
    this.proyTableAdapter.Fill(this.DataSet1.proy);
    this.reportViewer1.RefreshReport();
}


Another important thing: I DON'T KNOW ALMOST ANYTHING ABOUT CRYSTAL REPORTS. I want to use it because it's easy and looks good as I see, but I don't know many things, so please help me step by step. Just as a child. Thanks a lot.

One more thing: What about adding this codelines at the beginning of the initial method?

C#
private void VReport_Load(object sender, EventArgs e)
{
    this.proyTableAdapter.Connection =
    MySql.Data.MySqlClient.MySqlConnection
    ("datasource=localhost;username=root;" +
    ";password=anotherpassword;database=ctrlturnos");

    this.proyTableAdapter.Fill(this.DataSet1.proy);
    this.reportViewer1.RefreshReport();
}

Seems like it works, I tested it changing the password to 'anotherpassword' and it didn't connect to the dababase (as expected)
What do you think about this solution?
Posted
Updated 31-Mar-11 10:16am
v4

1 solution

You can set the new credentials using TableLogonInfo[^]
 
Share this answer
 
Comments
pancho2413 31-Mar-11 17:34pm    
Alright, it looks interesting. But how can I do? sorry, my unexperience don't let me see clearly. BTW, please read my question again. I added some info. Besides, if I use TableLogOnInfo I need to write something like 'using System.Object' at the beginning of the form?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900