hello my firends
i write a select method named slc in myclass. slc method return result from select of contact table. this method result is IorderdQueryable and i call this in my code-behind and i assign this result to a ListBox, i want to know how can i close my connection in my method ?does Iqueryable type close connetion automatically?
i use this code in slc method but it hase error
pubic cLass myclass
{
public IorderdQueryable<contactTbl> slc()
{
using(DataContext DataConextVar = new DataContext(cnclass.GetConnectionString("ConnectionString")))
{
var t=from b in DataConextVar.contactTbl select b;
return t;
}
please help me
}