Questions tagged as 'c#'

1
answer

Read a txt file index outside the matrix

I'm trying to read a txt file but I get the error "index out of the matrix" if (nFile.Length > 0) { StreamReader rd = new StreamReader(directorio + "\log.txt"); while (rd.Peek() != -1) { string s = rd.ReadLine();...
asked by 25.04.2018 / 17:18
1
answer

How to add values every time when entering data to the SQL database with C # and win forms

How to add values every time I insert the database and remember the Total values of previous inserts. I want to add field Name in Total field. And when I restart the application I want you to remember the last Total. This is my class clans co...
asked by 05.05.2018 / 16:57
1
answer

Unity does not change the scenes

In my Unity project I have these two scenes: And I had this code to change the scene with a trigger: void OnTriggerEnter2D(Collider2D other) { //DETECTA TRIGGER PARA ENTRAR A CASA if(other.gameObject.name.Equals("casa")){...
asked by 31.10.2018 / 11:04
1
answer

C # how to create an attribute for roles?

I'm working on an application (windows forms) this works with a sql server database connection and has a table of users who have roles. The application has modules or functionalities that are accessible according to the user's role: [invent...
asked by 08.05.2018 / 13:12
1
answer

Export WinForm project

I am trying to export my project winForm to an installer, or a portable one. I have tried in several ways, and what I sense is that some kind of error happens when loading the custom cursors; Cursor = GestionCursores.Create(Path.Com...
asked by 04.04.2018 / 15:23
1
answer

Is it better to use the using within the namespace?

At work they suggested using the usings within the namespace. namespace Functions.ProcessBatches.Transfers.Business { using AutoMapper; using Microsoft.AspNet.Identity; using System.Security.Principal; public class Ejemplo{...
asked by 06.04.2018 / 23:53
1
answer

List data in ASP.NET view c #

I have the following method where I bring the data from the database //Traer categoria public List<categoria> listar() { var cate = new List<categoria>(); using (var ctx = new ACME())...
asked by 17.04.2018 / 05:43
1
answer

Avoid duplicate records in C # in modify

I have a function that does not allow me to enter the same data in the same row. at the time of entering a new product if it works I can not enter a product that is already in the database, the problem if I want to change and I only want to chan...
asked by 31.03.2018 / 02:08
1
answer

How to capture a selected item from a combobox filled from a BD

I need help with a bit of code. It turns out that I have a combobox that I fill using a database: private void frmMain_Load(object sender, EventArgs e) { //TEXT BOX DISABLED txtDv.Enabled = false; txtNombre.Enabled...
asked by 12.03.2018 / 22:03
1
answer

PROBLEM WITH SQL QUERY IN C # ASP.NET

I have a webform project in asp .net with c # and in my query sql I need data that the user will provide. The week field is entered in a textbox in the webform1 and the query is in the webform2. According to that data, it will show me certain...
asked by 08.03.2018 / 20:06