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
srujana thallam
NA
76
138.7k
GettingConnection using SQL in CSharp
Dec 5 2013 10:23 AM
I want to generalise the getting connection for that I write a method in C# Class file like this
public SqlConnection GetConnection(SqlConnection objSqlCon)
{
SqlConnection con = new SqlConnection();
try
{
objSqlCon.ConnectionString = con.ConnectionString();
objSqlCon.Open();
return objSqlCon;
}
catch(Exception e)
{
}
}
it shows an error like this
'System.Data.SqlClient.SqlConnection.ConnectionString' is a 'property' but is used like a 'method'
or else can u please tell me the another way to get connection by passing sqlconnection to that method.
Thanks in Advance.
Reply
Answers (
3
)
HOW TO CREATE SIMPLE SPEECH APPLICATION IN WINDOWS FORM ?
nvarchar vaiable