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
Tuman Sahu
1.4k
293
9.2k
SocketException: when connection through mysql
Feb 11 2020 4:17 AM
Hello friends,
I want to create a connection between mysql remote server and asp.net
Where database server information is as follows
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.7.26-0ubuntu0.16.04.1 - (Ubuntu)
Protocol version: 10
User: root@localhost
Server charset: UTF-8 Unicode (utf8)
my webconfig code is as follows
<connectionStrings >
<add name ="rtd" connectionString ="server=192.168.x.x; port=8090; Integrated Security=False; Initial Catalog=rtu; User Id=root; Password=123;" providerName ="MySql.Data.MySqlClient"/>
</connectionStrings>
In code behind on page load
Dim str As String = ConfigurationManager.ConnectionStrings("rtd").ConnectionString
Dim conn As MySqlConnection = New MySqlConnection(str)
Dim cmd As MySqlCommand = New MySqlCommand("SELECT * FROM realtime order by id desc limit 1")
Dim da As MySqlDataAdapter = New MySqlDataAdapter()
cmd.Connection = conn
da.SelectCommand = cmd
Dim dt As DataTable = New DataTable()
da.Fill(dt)
rtgrid.DataSource = dt
rtgrid.DataBind()
when is am execute following code socket exception occurs and error is below
SocketException: A connection attempt failed because the connected party did not properly respond after a period
of time, or established connection failed because connected host has failed to respond
can anyone suggest me where I am wrong?
Reply
Answers (
2
)
Running a simple loop for displaying and saving once
Data Export to Excel from Gridview