skip to Main Content

Why do I get the Exception SqlException IDENTITY_INSERT is set to OFF – Asp.net

HeuteDb heute = new HeuteDb(); string filePath = @"C:UsersEliasDesktopASPlearningDATAData.csv"; using (StreamReader reader = new StreamReader(filePath)) { string line; while ((line = reader.ReadLine()) != null) { List<string> items = line.Split(';').ToList(); heute.Uhrzeit = items[0]; heute.Energie = items[1]; _context.HeutesDb.Add(heute); _context.SaveChanges(); } } I…

VIEW QUESTION

the datasource for gridview Gridview1 didn't have any properties or attributes from which to generate columns. Ensure that your datasource has content – Asp.net

This is the error I'm getting. The data is being retrieved through WebAPI, but due to a gridview setting, it is not displaying the retrieved data. protected void Page_Load(object sender, EventArgs e)       {           try           {               var webRequest = (HttpWebRequest)WebRequest.Create("https://localhost:44342/api/author");               var webResponse = (HttpWebResponse)webRequest.GetResponse();               if ((webResponse.StatusCode == HttpStatusCode.OK) && (webResponse.ContentLength > 0))               {                   var reader = new StreamReader(webResponse.GetResponseStream());                   string s = reader.ReadToEnd();                   var arr = JsonConvert.DeserializeObject<JArray>(s);                   //Console.WriteLine(arr);                   GridView1.DataSource = arr;                   GridView1.DataBind();…

VIEW QUESTION
Back To Top
Search