TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Muhammad Nadeem
NA
548
66.6k
xamarin form app connect to shared server cpanel hosting
Apr 28 2019 2:03 AM
Hi,
I have xamarin forms app and I want to connect my app to my shared server mysql database. I want to connect my app with mysql database that is on real server here is the code to do this.
MySqlConnectionStringBuilder sb =
new
MySqlConnectionStringBuilder();
sb.Server =
"my ip addres or domain name"
;
sb.Port = 3306;
sb.UserID =
"myuserid"
;
sb.Password =
"mypassword"
;
sb.Database =
"mydbname"
;
sb.CharacterSet =
"utf8"
;
try
{
MySqlConnection con =
new
MySqlConnection(sb.ToString());
if
(con.State == ConnectionState.Closed)
{
con.Open();
// when connection is going to open then this happen "The type initializer for MySql.Data.MySqlClient.Replication.ReplicationManager threw an exception."
DisplayAlert(
"alert"
,
"successfully connected"
,
"ok"
);
}
}
catch
(Exception ex)
{
DisplayAlert(
"Error"
, ex.Message,
"ok"
);
}
I used Xamarin.MySql.Data Plugin in my xamarin form app.
https://www.nuget.org/packages/Xamarin.MySql.Data/
Please help me I want to online my xamarin form app/connect to my domain cpenal hosting.
Reply
Answers (
1
)
How to Convert pdf file in base64 string?
How to implement Voice chat & Call recording in Hybrid app?