Questions tagged as 'c#'

2
answers

Deletion of related data - Entity Framework and C #

Hello, Using the same structure I've been presenting here for some time now, I've come to you for help now to delete the related data. Follow the entities .. public class Artista { public int ArtistaId { get; set; } public string No...
asked by 13.02.2016 / 16:06
1
answer

Two dependent combobox using linq to sql

How do I populate two combobox's with linq to sql where in a combobox for example I have countries and in another I have cities? How do they automatically change the values? I leave the image below as I filled out one, if there are any errors an...
asked by 06.05.2016 / 02:16
1
answer

Error entering data into bank, EF 6

I'm trying to insert data into the database, but I have an error doing saveChanges(); after doing context.add() several times, it's happened after 500, 2200, and 5500 times. Error: The transaction associated with the current...
asked by 16.10.2015 / 22:00
1
answer

How to simplify the code with ForEach's List?

How to use ForEach() of List in the implementation below using System.Collections.Generic; public class Program { public static void Main() { List<Pessoa> pessoas = new List<Pessoa>(); pess...
asked by 17.10.2015 / 01:01
1
answer

Error in using ViewBag in DropDownListFor ASP NET MVC

I have a DropDown that lists the categories of my system, plus when I submit the form without choosing a category, it gives a server error saying that the value can not be null. I put a validation with the ValidationMessageFor, but anyway it doe...
asked by 26.09.2015 / 03:18
1
answer

Entity Framework 6 error while logging the SQLs

I am trying to see the SQLs executed by the Entity Framework, I use version 6. I'm following this guide . I made a new DBContext using the graphical interface. 5 tables only. The code is inside a Controller Web API2: public class TAG...
asked by 17.06.2015 / 14:52
4
answers

Problems initializing a type inside a query with LINQ

I'm going through the following problem, I am putting an API into a forum application and this API needs an endpoint to return a collection of Forum that have the% property of% null. Then I put the following endpoint : [AllowAnonymou...
asked by 06.01.2016 / 11:43
2
answers

C # - XML return from WebService with coding error (ISO-8859-1)

I have a Windows Forms application that is consuming a WebService that returns an xml (string) with ISO-8859-1 enconding. However, the answer comes with question marks (?) instead of accents. How do I convert or read to ISO-8859-1, so that...
asked by 01.12.2015 / 19:45
3
answers

How to save and load data from a .txt to a gridview?

It's been two days since I've been looking for help with my problem, but everything I think does not help me. I'm doing a simple program, like an agenda, where I put all the records in my store. I do not need anything complicated. I made a...
asked by 27.11.2014 / 18:14
1
answer

Help - C # how to update comboBox? autocomplete type

Firstly I'm developing a system in C # and using Sql Server as a database. I would like to perform the following task: When something is typed in the comboBox I update myself, through a search in the database, example: I type A in the comb...
asked by 17.01.2015 / 10:22