Questions tagged as 'c#'

2
answers

Access ViewData in a Razor view

I'm making a list of students to show it in a Razor view using ViewData. controller using ViewData.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace ViewBag.Control...
asked by 05.05.2017 / 00:52
2
answers

Pass an element of a Datagrid

Hello good day I have an existential question, I am filling a DataGrid by means of a query in C# windows forms , Which shows me in a column several ID , and by middle of the function CellDoubleClick in the Data...
asked by 09.04.2017 / 19:27
1
answer

failed to perform Convert.ToInt32

public int cantPembarcar(String pCodigoArticulo) { string strCon = ConfigurationManager.ConnectionStrings["Sk_DBRadioFrecuencias"].ConnectionString; SqlConnection conn = new SqlConnection(strCon); SqlCommand comm = new SqlCom...
asked by 02.04.2017 / 00:09
1
answer

Insert data in a date field of a access 2013 database from C #

I have an Access 2013 database with several tables, and in some of them fields of type "Short Date". The issue is that when trying to enter data using a SQL INSERT statement from C #, I get the following error: "The data types do not match in th...
asked by 25.04.2017 / 19:44
1
answer

Create a new element in an array in c #

I would like you to help me how I could generate a new object in the Product list, it's a simple CRUD using ProductsApp.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using S...
asked by 25.02.2017 / 10:29
1
answer

C # dynamic task execution in the background

I have the following doubt. As I do so that the parameter that I am passing to this function, adapts to the delegate that is assigned to DoWork + = ?? Since the parador is a string, I need the delegate to change based on that string. public st...
asked by 13.03.2017 / 16:22
4
answers

How can I get today's date from a string and not the full value of it?

I have an application which I need to export several values. In one of them I have a string that returns a date with time included "2/8/2017 10:26:35 AM". What I need is to extract this string but only validating the day the code is executed....
asked by 08.02.2017 / 18:31
2
answers

Error in web.config in c #

Hello, I would like you to help me. I am running this file but I get an error in the web.config. I am using the visual studio 2013 and I think that earlier I would have done it with the visual studio 2005. The error comes to me like the image I...
asked by 10.02.2017 / 16:46
3
answers

Automated Date

I have the following question: How to put an automatic date in SQL Server or in C #? For example in this query : SELECT id,Registration FROM tbl_CRs WHERE Registration BETWEEN '20170201' AND '20170216' and [Status]='OPEN' In C # it woul...
asked by 16.02.2017 / 19:52
3
answers

Fill an array of Javascript with the result of a SQL Server stored procedure

I have a stored procedure which, when executed, throws me a table dynamically. I would like that table to be stored in an array of Javascript, regardless of the number of fields or rows. Is there any way to fill in from a SQL Server stored pr...
asked by 18.02.2017 / 01:27