不保存到数据库 [英] Not saving to database

查看:94
本文介绍了不保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为该公司从事一个项目,在该项目中,我应该能够将客户信息保存到数据库中,并将其余信息加载到数据库中.发生的事情是我输入了信息,将其保存在数据表中,但没有保存到数据库中.现在有人会说代码有问题,但这是痛苦:我正在使用VS2008和SQL2005并面对此问题.但是,我的同事正在使用SQL2008,但是代码在他的计算机上运行正常.有什么问题,我该如何解决?谢谢

I am working on a project for the company where I should be able to save a customers information to the database and load it with the rest. What happens is that I put in the information, saves in the datatable, but doesn''t save to the database. Now one would say there''s something wrong with the code, but here''s the pain: I''m using VS2008 and SQL2005 and facing this issue. However, my coworker is using SQL2008 and yet the code is working perfectly on his machine. What is the problem and how can I solve it? Thank you

推荐答案

没有更多信息,这只是猜测,但您应该尝试做的事情很少:
-使用调试器检查代码,并检查插入操作是否已实际执行且未生成错误
-检查您使用的数据库是否正确
-如果在应用程序运行时已连接数据库,请检查编译是否覆盖数据库文件
-在关闭连接之前检查事务是否已提交
-并且,如果您具有Sql Server的标准版或企业版,请使用Profiler来查看Sql Server方面的情况.
Without any more information, it''s merely guessing, but few things you should try:
- using debugger go through the code and check that the insert is actually executed and no error is generated
- check that you''re using the correct database
- if the database is attached when the application runs, check that compiling doesn''t overwrite the database files
- check that transactions are committed before closing the connection
- and if you have standard or enterprise edition of Sql Server, use Profiler to see what''s happening on the Sql Server side.


您好朋友.... !!!

如果您的代码在您的同事系统上运行良好,那么您的系统上出现了问题...
Hello friend....!!!

If your code is work perfectly on your coworkers system then something wrong on your system...


就像是什么呢?我已经安装了VS2008和SQL2005 SP4.
Like what exactly could it be? I have VS2008 and SQL2005 SP4 installed.


这篇关于不保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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