在Vb.NET exe(Windows应用程序)中花费更多时间进行登录 [英] Taking more time for Login in a Vb.NET exe (Windows Application)

查看:74
本文介绍了在Vb.NET exe(Windows应用程序)中花费更多时间进行登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在VS2005和SQL Server 2000中开发的应用程序.

如果我在执行机中有数据库,它会快速登录.但是当我在服务器中有数据库时,登录需要将近1分钟的时间(我的启动表单是Login)

我是这个概念的新手,有人可以对这个问题提出建议吗?

MyConnection字符串为:

I have a Application which was developed in VS2005 and Database as SQL Server 2000.

If i have database in Executing machine, it logins fastly. But when i have database in server it take nearly 1 minute for Login(My startup form is Login)

I am new to this Concept can anyone have suggestion for this Problem?

MyConnection String is:

dim con as sqlconnection
con=new sqlconnection("server=XXXX;database=Test;uid=sa;pwd=123;Connection Timeout=100;Trusted_Connection=False")

推荐答案

首先,您的登录"表单不应是您的启动表单.使您成为主应用程序表单的启动表单,如果主表单确定用户未登录,则将调用Login表单.

其次,在没有看到您的登录代码(除了已经发布的内容)的情况下,几乎不可能告诉您您在做什么错.

第三,您正在使用"sa"帐户连接到服务器?这是非常糟糕的做法.我意识到这可能只是一个测试服务器,只是不习惯这样做.
First, your Login form should NOT be your start up form. Make you main application form your startup form and the Login form gets called if the main form determines that the user is not logged in.

Second, without seeing your login code (besides what you already posted), it''s pretty much impossible to tell you what you''re doing wrong.

Third, you''re using the "sa" account to connect to the server?? That''s a VERY BAD practice. I realize that this may just be a test server, just don''t get into the habbit of doing that.


这篇关于在Vb.NET exe(Windows应用程序)中花费更多时间进行登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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