Not getting ConfigurationManager class in my dal.

Posted by maninaanee-8287 under ASP.NET on 12/12/2011 | Points: 10 | Views : 1827 | Status : [Member] | Replies : 2
Not getting configurationmanager class. Actually im using Sqldatasource. please once chek my dal
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using pnGridml;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;


namespace pnGridDal
{
public class pnGrdDal
{

public static List<Product>GetProducts()
{
return GetProducts(int.MaxValue,0);
}
public static List<Product>GetProducts(int maximumRows,int startRowIndex)
{
//return GetProducts(maximumRows,startRowIndex);

string sql=@"SELECT [ProductName],[UnitPrice],[UnitsInStock],[QuantityPerUnit] FROM [Product]";
Here i want like this. Bt not getting.......................................... (using (SqlConnection myConnection = new
SqlConnection(ConfigurationManager.ConnectionStrings[
"NWConnectionString"].ConnectionString)))


}

}
}




Responses

Posted by: Sksingh on: 12/12/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

Add System.Configuration.dll reference to your project and try it .

Regards,
Sunil

maninaanee-8287, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: maninaanee-8287 on: 12/12/2011 [Member] Starter | Points: 25

Up
0
Down
Hi sunil,
Thanks.

maninaanee-8287, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response