Questions tagged as 'c#'

1
answer

How to pass and traverse an anonymous object in a method

How can I pass an anonymous object to a method, and then traverse it? What I'm trying to do is the following: public static string QueryStringToUrl(string url, Dictionary<string, string> query) { var uriBuilder = new UriBuilder(ur...
asked by 21.01.2018 / 19:30
1
answer

Dictionarystring, string or NameValueCollection?

What's the difference in using Dictionary<string, string> and NameValueCollection ? I searched, but only found in English in the SOpt same, I used the translator, but the translation was strange and I did not understand.     
asked by 22.01.2018 / 02:58
1
answer

Failed to pass ownership of an entity as a parameter in MySqlCommand

I have the following code in my application: public Usuario checkLogin(Usuario entity) { //return Usuario userEntity = new Usuario(); connection = mysql.OpenConnection(); try { MySqlComm...
asked by 21.01.2018 / 23:14
2
answers

Generate PDF in C # without using Microsoft.Office.Interop [closed]

Hello, I'm having trouble generating pdf without using Microsoft.Office.Interop. Other DLLs I've found are not free. Does anyone have a tip?     
asked by 26.12.2017 / 11:48
1
answer

Compact Access Database with C #

I have a method to compress my base Access , however when I run the program I get the following error: Error:    The exception to catch is this message: {"Retrieving the COM class factory for component with CLSID {DE88C160-FF2C-11...
asked by 27.11.2017 / 13:51
1
answer

How to assign a List to a DataTable correctly form windowns?

I'm trying to list the payment methods of the dbo.FormaPgto table in a ComboBox but it's giving this error. Followthecode.Class:publicList<Formas_Pagamento>ListarFormaPgto(stringcampos="*") { try...
asked by 27.11.2017 / 13:38
1
answer

Class not recognized C # WINDOWS FORMS

I'm having a new problem in the same method, instead of bold italic accuses an unrecognized class problem, any hint how to solve? Code below: public static void CompactarMdb(string caminhoaccdb){ JRO.JetEngine jetEngine = (JRO.JetEngin...
asked by 27.11.2017 / 19:22
1
answer

How to instantiate a part of a class with EntityFramework to work with CRUD only on that data

I'm creating a web-based solution in the SinglePageAplication (SPA) type made with AspNetCore and I use the Entity Framework to make my CRUD in the SQL Server database. I am sure that the Entity Framework allows me to do the updates of only what...
asked by 28.11.2017 / 12:17
1
answer

Convert file to Byte Array [duplicate]

I am trying to convert a received file in FileUpload (ASP.NET tool) to an array and then the array to a string . But when trying to use Encoding Visual Studio accuses an error saying that this class only accepts a string...
asked by 27.11.2017 / 15:44
1
answer

Load list from txt in C #

I have the following problem, I get the data of a txt that I need to return in the form of List<List<string>> , however I can only get txt from a string [] linha , so I was adding string per string in my list, this it wor...
asked by 30.11.2017 / 00:04