Questions tagged as 'c#'

1
answer

Error when using SqlCommand and foreach

I'm trying to navigate a list of objects and persist their data in SqlServer: foreach (var item in pedidos) { cmd.CommandText = "INSERT INTO MinhaTabela (Coluna_A, Coluna_B, Coluna_C) " + "VALUES (@Val_A, @Val_B, @Val_C)"; c...
asked by 20.11.2017 / 13:54
1
answer

Field validation via jQuery correctly

I have the following validation for the TextBox of justification. But even returning the message and clicking the OK button the system validates the deletion. That's right, you should return the message and focus on the justification f...
asked by 18.08.2017 / 16:02
1
answer

Conversion error when trying to insert into bank with entity and C #

This is the method to insert: public virtual void Inserir(T item) { contexto.Set<T>().Add(item); contexto.SaveChanges(); } I created a method by passing the parameters to my object and then cal...
asked by 17.08.2017 / 01:36
2
answers

Json with C # with numbered node

Does anyone know how I can read objects with this file template? It looks like the creator did not use [] to Arrays and also the second node is numbered (not key: value as json base). { "1":{ "id":1,...
asked by 27.07.2017 / 22:47
1
answer

Relationship in table with Include does not work

I can not make my parent table include the dependent: var medicos = TabelaMedico.Include(m => m.Especialidade).ToList(); It displays the following error message:    CS1660: Can not convert lambda expression to type 'string' because it...
asked by 27.07.2017 / 18:54
2
answers

Passing parameter through URL

How do you pass a parameter to another view screen without the user seeing it in the URL? For example: I have a query screen that the user clicks on the table and is redirected to another screen, which is the screen that opens the information...
asked by 28.07.2017 / 20:27
1
answer

How to use POST in a json for an Http server

I was wondering how can I do a POST from a json to an http server. The code I am using to do json is as follows: Person person= new Person(); product.FirtsName = "Ola"; product.ID = 1;...
asked by 24.08.2017 / 12:10
1
answer

Do not reload page when giving submit in modal

I have a modal to search for clients: Whatiscalledaregistrationformasfollows:$('#linkSearchShipperCustomer').on("click", function (e) { showDialogList("@Url.Action("IndexShadow", "ShipperCustomer")", "IdShipperCustomerDiv", "IdShipp...
asked by 08.06.2017 / 21:30
1
answer

update tabcontrol tab

I am creating a program in Windows Forms and on my page I put a Tab Control with one tab to register and insert the data in MySQL and the other to see the data registered in a ComboBox. p> But when I insert one data from the registration tab...
asked by 08.06.2017 / 16:40
1
answer

Send data from a GridView on a Form to ComboBox on another Form

I'm trying to send the data from a gridview in a second Form to a combobox in form master but I have not been successful. I would like to know if there is a way to do this without being sent as a parameter, since I wi...
asked by 07.06.2017 / 00:40