Questions tagged as 'c#'

1
answer

How to make a Foreach in a SQLite DataReader?

I'm trying to get the data from an SQLite query and then save the fields in a list and show them to the user through a MessageBox. I have two problems: 1) I do not know if what I'm doing is fine. 2) I do not compile the code, and I do not know w...
asked by 26.06.2018 / 02:14
1
answer

How to send 2 lists by JsonResult

What I want to do is send 2 lists in a JsonResult method and receive them in Ajax. Because I have a table from many to many, I need to change the IDs by names. So I need you to return the name of things. public JsonResult GetHerramientas(int I...
asked by 26.06.2018 / 18:36
1
answer

How to validate several empty txt?

Hi, I'm a student and I have the following problem. I am developing a form in C # and I would like to avoid some txt being empty, I have read that this is a way of doing it: if (this.txt.Text.Equals("")) { Response.Write("El campo...
asked by 28.06.2018 / 03:44
1
answer

How to show names of a list in a MessageBox?

I have the following problem: I am trying to show the names stored in a list in a MessageBox but the names come out on top of it and not in the center where I want them to be. I attach a photo. As you can see, the Salmon Salmon names that...
asked by 28.06.2018 / 02:08
2
answers

I try to update a record of my bd with entity framework but it does not update it (It does not mark errors)

What I want to do is a simple update of a record of my table and in this case I want to do it with linq but at the moment when it arrives at that piece of code it does not mark me any mistake and executes all the lines but it does not I update t...
asked by 27.06.2018 / 18:50
1
answer

Confirm with data anottation a checkbox

I have a form that contains 9 input of type checkbox I need to validate that when sending the form at least one of them comes tickeado. I have the following in my view <div class="col-12 col-sm-6 col-md-3 li"> @Html....
asked by 29.06.2018 / 19:25
1
answer

Why does not the [DataType (DataType.Password)] work for me?

I have a model CredencialesViewModel which has a property Pwd type string add the decorator type data, but in the view does not render a input type password if not that one type text. / p> Why will this be?     
asked by 12.06.2018 / 19:43
1
answer

Problem making a DELETE with the LIMIT clause in a SQLite query

The following query erases the data coinciding with the search of my database but I only want to delete a single row in case the query matches more than one row of my table. According to what I understand the query would be well done, with the...
asked by 20.06.2018 / 21:38
1
answer

SHA1 coding in C #

I need to code a password and save it in SQL , for the part of saving it I have no problem, but with the encryption part I do not know what to do. (I've never done anything similar) I have the following code that I found in a forum: p...
asked by 28.07.2018 / 19:53
1
answer

Problems with CheckBoxFor and ListBoxFor [duplicated]

I need to render in my view a series of fields type checkbox (9 in total) where if one of them (the number 8) at the moment of clicking on it should appear a field type select , this last I already have it developed with jquery...
asked by 05.06.2018 / 15:38