0

I have a SharePoint 2013 application where I want to display some of the data from SQL table on my page. I have created a connection string which is:

string cnn = ConfigurationManager.ConnectionStrings["SharePointFBA"].ConnectionString;

Now when I write cnn.open() to open the connection it says "string doesn't contain a definition for 'open' and no extension method for open.

How do I resolve this ?

1 Answer 1

1

You need to use something like below.

string cnn = ConfigurationManager.ConnectionStrings["SharePointFBA"].ConnectionString;
using (SqlConnection conn2 = new SqlConnection(cnn))
{
   conn2.open();
}

Please ask SharePoint related question only in this community.

1
  • Happy to help you... Commented Jul 1, 2016 at 8:00

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.