Questions tagged as 'c#'

1
answer

Can I do Global Query Filters in Entity Framework 6? in the OnModelCreating?

I'm trying to do this in EF6. It can? I wanted to make a blobal filter protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<Cotizacion>().HasQueryFilt...
asked by 15.12.2018 / 02:13
1
answer

How to add rows by code to a DataGridView that is filled with a query to a BD

I have read several open cases of this type but I do not really see one that fits my case. Well I raise my case; I have a DataGridview which, by consulting the BD, I filled it and I want to add rows through TextBox that are in the same form....
asked by 16.12.2018 / 02:17
1
answer

Pass Selection of a DataGridView to another form

I am working on the CellContentDoubleClick of my DataGridView Entradademercancia frm = new Entradademercancia(); frm.txtrnc.Text = dtgv.CurrentRow.Cells[0].Value.ToString(); frm.btnbuscar.Select(); this.Hide();...
asked by 11.12.2018 / 18:33
1
answer

Accept only 0,1,2 in an array c #

How to accept entering only numbers 0,1,2 in an array of c # int elements; int[] values; Console.Write("Número de elementos: "); elements = Convert.ToInt32(Console.ReadLine()); //Pide el número de elementos...
asked by 04.12.2018 / 23:48
1
answer

my project is not executed in html

my problem is that when I run my project in visual studio 2017, it appears in the hello word browser and not the calculator that I programmed, I'm sure the code is right, just in case I show it, I tried to start a new project and paste it to the...
asked by 06.12.2018 / 19:35
2
answers

How to display data in a DropDownList?

I'm with a project that consists in creating a content manager for an information portal, so far I made the insert to add new articles to the information forums, now I continue with the part of the queries to be able to perform the update an...
asked by 04.01.2019 / 15:50
1
answer

Does not contain a definition for 'BinDataGridView' And delete button

I'm wanting to pass data to a gridview that I have in the interface called dataGridView1 But in the add button I get an error in the BindDataGridView event, you can give me an orientation on the solution private void btnAgregr_Click(object...
asked by 04.01.2019 / 20:15
1
answer

Extract words from a pattern in c #

I was wondering how I could extract the words out there, having a pattern. For example, given the following string, extract the word from inside: Palabra 1: "Raqueta" end: Palabra 2: "Motocicleta" end: It's just a simple example, the rea...
asked by 17.12.2018 / 01:52
1
answer

Data is lost in the Controller - View - Controller process

I told you that I have 2 controllers, one for the GET and another for the POST that I am going to edit so that it is easier to understand: // GET: Compras/Create public ActionResult Create(int id) { ComprasCreateModel compra = new...
asked by 25.11.2018 / 07:20
1
answer

show last record of a table in c # with sql server

What I try to do is capture the last code that was entered from my table in sql and show it in my txt that is in c # try with this code but it did not work for me I hope your help SqlConnection con = new SqlConnection(ConfigurationManager.Co...
asked by 26.11.2018 / 06:43