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
Gurjeet Singh
NA
90
94.7k
WebConfigurationManager into Class Library
Apr 25 2013 10:19 AM
Dear All,
I am trying to use Web.Configuration into Class Library but i m getting below error even though i already added System.Web dll into class library
Error : Cannot apply indexing with [] to an expression of type 'System.Configuration.ConnectionStringSettingsCollection'
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.Web.UI;
using System.Web;
using System.Web.Configuration;
namespace DawarLibrary
{
class MainClass
{
public static string _ConString="";
static MainClass()
{
_
ConString = WebConfigurationManager.ConnectionStrings["DawarDB_New"].ConnectionString;
}
Reply
Answers (
3
)
Working with URL Routing in ASP.NET Web Forms
Open word doc on web page ( as html) using C# and ASP.NET MV