سلام این خطا در برنامه ویندوزی تجت شبکه داخلی برای ثبت در دیتابیس روی میده برای چی هست و چیکار بیاد کرد؟ این خطا هر از چند مدت بوجود میاد بعد از چند مدت دوباره درست میشه همون اطلاعات را میشه دوباره ثبت کرد؟
system.data.sqlclient.sqlexception (0x80131904) : A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 – An existing connection was forcibly closed by the remote host.)
Untitled.jpg
دستورات بصورت زیر وارد میشه
public void DoCommand(string ole)
{
con = new SqlConnection();
con.ConnectionString = variable._ConnectionString;
cmd = new SqlCommand();
cmd.Connection = con;
con.Open();
tr = con.BeginTransaction();
cmd.Transaction = tr;
cmd.CommandText = ole;
cmd.ExecuteNonQuery();
tr.Commit();
con.Close();
}