TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sumaira manzoor hussain khan
NA
241
251.6k
connection of sql server in c-sharp
Sep 25 2010 3:12 AM
hello every :
i am writing a code to establish connection of sql server 2000 in c-sharp .
private
void
button_connected_with_database_Click(
object
sender,
EventArgs
e)
{
SqlConnection
conn;
string
string_connection=
null
;
string_connection =
"Data Source=. ; Initial Catalog=Northwind; User ID=sa;Password=sumaira"
;
conn =
new
SqlConnection
(string_connection);
try
{
conn.Open();
MessageBox
.Show(
" Connection Open ! "
);
conn.Close();
}
catch
(
Exception
ex)
{
MessageBox
.Show(
"Can not open connection ! "
);
}
}
but this code is not working . the message box show " can not open connection ".
Reply
Answers (
1
)
Efficient ways to reset lost sql sa password
Auto generate id