Questions tagged as 'c#'

3
answers

C # deserializar XML to read and collect data

I have an application in Unity and I have a class where I assign some buttons a text. I want the button texts to be imported from an XML file. I have done this to read the XML but I do not know how to get the data and take it to the other class....
asked by 29.03.2017 / 17:29
2
answers

.NET validate if a column exists in an IDataRecord C #

I have a constructor that I feed through a query to BBDD through a method that, when called from different points of the application, will cause the result obtained from SELECT no have the same columns in all cases. To give yo...
asked by 26.04.2017 / 16:20
3
answers

How to open a sql Server connection in C #?

Well my problem is that I want to open a sql server connection so I can make a query BD and get a possible result either erroneous or successful. Code of my method to authenticate users: public string Autentificar() { string sql = @"SE...
asked by 24.03.2017 / 22:50
1
answer

How to get the page from a row of a table, using page?

Suppose I have a table that shows 5 rows or records, with a fixed total of 12 records, that makes it have three pages so that one can page. But for example if I want to choose row 8, I need to get the page in which it is and save that value, tha...
asked by 25.12.2016 / 18:30
1
answer

how can I detect the delete key in a datagrid c #

   Hello, how can I detect the delete key (delete) in a datagrid in c #     
asked by 06.03.2017 / 00:02
3
answers

How to export to Excel along with the headings?

With the following code I can export without problems a datagridview in specific but without the headers. What do I need to achieve this? public void ExportarDataGridViewExcel(DataGridView dataCWS) { try { S...
asked by 03.01.2017 / 16:51
1
answer

Export two DataGridViews to an Excel file

I have to add the information of two DataGridViews in the same sheet of Excel consecutively. This is the code I have that only serves for a single DataGridView. Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Inter...
asked by 10.03.2017 / 22:10
1
answer

Perform unit test in Eclipse or Visual Studio

Having the following function: public int Suma (int numero1, int numero2){ return numero1+numero2; } Be in Java or C# . Is there a way to test this function without having to invoke it in the MAIN? So if I have several fu...
asked by 07.03.2018 / 19:12
1
answer

How many positions do I have in an array?

I try to do the following ... class Nested { Persona[] Empresa; struct Persona { public string nombre; public string apellido1; public string apellido2; publi...
asked by 11.03.2018 / 16:32
1
answer

How to generate an own event in a user control

What a good day everyone, diculpen I have the following question, is about how to make a custom event in c # something similar to VB if possible or not in C # Visual Basic <System.ComponentModel.DefaultEvent("_Click")> Public Class Bo...
asked by 05.03.2018 / 21:18