Исключение типа "system.invalidoperationexception" произошло в system.data.dll
An exception of type 'System.InvalidOperationException' occurred in System.Data.dll
Что я уже пробовал:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Data; using System.Data.SqlClient; using WebApplication3.Models; namespace WebApplication3.Controllers { public class ProductController : Controller { String cs = @"Data Source = DESIGNER\\SQLEXPRESS; Initial Catalog = MvcCrudDB; Integrated Security = True"; [HttpGet] public ActionResult Index() { DataTable dtblProduct = new DataTable(); using (SqlConnection con = new SqlConnection(cs)) { con.Open(); SqlDataAdapter da = new SqlDataAdapter("SELECT*FROM Product",con); da.Fill(dtblProduct); con.Close(); } return View(dtblProduct); }