登录到SQL Server [英] login to SQL Server

查看:77
本文介绍了登录到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
i在Sql server 2008中创建登录和用户。使用此命令

hi i create a login and user in Sql server 2008.with this command

CREATE LOGIN test0101
    WITH PASSWORD = 'areyou123!';
GO



和用户


and User

CREATE USER test0101 FOR LOGIN test0101;
GO



但我无法连接到数据库引擎。我收到此错误

用户'test0101'登录失败错误18456.

i需要在Sql Server中为c#project(winform)创建登录。

请帮帮我。

谢谢。


but i can not connect to database engine. I get this error
login failed for User 'test0101' error 18456.
i need create a login in Sql Server for c# project(winform).
please help me.
thank you.

推荐答案

引用:

我收到此错误

用户'test0101'登录失败'错误18456.

I get this error
login failed for User 'test0101' error 18456.

您是否在谷歌搜索此错误?我得到了以下一个。

Microsoft sql服务器错误18456用户登录失败 [ ^ ]

Did you search Google for this error? I got the below one.
Microsoft sql server error 18456 login failed for user[^]


DataSet ds = new DataSet();
                        SqlDataAdapter da = new SqlDataAdapter("select * from Admin_Login where username ='" + txtusername.Text + "' and password='" + txtpassword.Text + "'", sconn);
                        da.Fill(ds);
                        int count = ds.Tables[0].Rows.Count;
                        if (count == 0)
                        {
                            MessageBox.Show("Wrong username or password");
                            
                            txtusername.Focus();

                        }
                        else
                        {
                            successpage pg= new successpage ();
                            pg.Show();
                            this.Hide();
                        }
                        sconn.Close();


这篇关于登录到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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