在程序中运行时缺少数据 [英] Data missing on running in a procedure

查看:82
本文介绍了在程序中运行时缺少数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的一个供应商我的服务器每隔30秒从不同的端口向我的服务器发送近1000条记录。通过lisener在C#Iam中通过存储过程(ADO.NET)将数据插入到文本文件和sql server表中。数据完全插入到txtfile中,但表中似乎缺少数据。而且服务也似乎定期关闭。



请给我任何帮助。



我尝试了什么:



通过在C#端创建任务来尝试同步。但是没有在sql服务器端使用



用于测试我只是从5个客户端多次发送相同记录但数据丢失

Hello Every one,

One of my vender send data to my server from different ports nearly 1000 records for every 30 secs. By lisener in C# Iam inserting the data into textfile and in sql server table by stored procedure (ADO.NET). The data gets inserted in txtfile completly but the data seems to missing in the table. and the service also seems to off periodically.

Any help please.

What I have tried:

Tried sync by creating tasks in C# side. But no use in sql server side

for testing i have just send same record multiple times from 5 clients but data is missing

推荐答案

如果数据未正确插入SQL Server,您可能基本上没有什么问题

- 数据永远不会被插入

- 插入失败并显示错误

- 插入由事务回滚



您没有提供任何有关数据的信息实际上是插入SQL Server数据库,但看看所有相关的日志文件,你找到任何可以解释这种情况的错误。此外,您还可以增强过程中的错误处理,以获得有关异常的更好信息。
If the data isn't inserted to SQL Server correctly, you may basically have few problems
- the data is never tried to be inserted
- the insert fails with an error
- to insert is rolled back by a transaction

You didn't provide any information how the data is actually inserted into the SQL Server database, but take a look of all relevant log files, do you find any errors that would explain the situation. Also you can enhance the error handling in the procedure to get better information about exceptions.


这篇关于在程序中运行时缺少数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆