Questions tagged as 'c#'

1
answer

How do I set Title in an 'img'?

Is there any way to set the title (Text) of component img to code behind ? <tr> <td colspan="7"> <img id="ProximoMes" src="../Images/Icons/dright.gif" /> </td> </tr>     
asked by 10.03.2016 / 14:14
2
answers

How to get the number of records in a DataReader?

I'm doing a query in a database, however I need to know how many records I'll get from this query, before I even start the loop.    Note: I do not want to put a counter inside the mesh, I need the value   before * cmd = New OleDbCommand(sq...
asked by 09.03.2016 / 15:43
1
answer

Attempting to update with NHibernate?

I'm trying to make an update with NHibernate but it always returns me an error saying that there are two open sessions: illegally attempted to associate a proxy with two open session How to solve this? GenericDAO public class Ge...
asked by 10.03.2016 / 23:17
1
answer

Add days to date increasing via For

In the code below I add 1 to each step in the variable i , to add 30 days in the dt field, do I need another for or what to do in it? DbConnection cnx = ADO_Utils.GetConnection(); DbCommand cmd = ADO_Utils.GetComando(cnx);...
asked by 23.04.2016 / 01:45
1
answer

URL pattern in RESTful service

I'm developing a service that will provide some functions for external access, using REST architecture. It is the beginning of a RestAPI for the company. But let's get into the problem. I need to update some punctual data for a particular produc...
asked by 19.04.2016 / 15:05
1
answer

Async method with Await on his return [duplicate]

public async Task<IHttpActionResult> NomeMetodo([FromUri] Filtro filtro) { return await Task.Factory.StartNew(() =>Ok(_aplicacao.RetornarDados(filtro))); } I would like to know why the above method makes sense, since it is as...
asked by 18.04.2016 / 15:42
1
answer

How to convert multiple .jpgs images to a single pdf file in C #

What I have is a directory with eg 10 scanned images. I would like to read these images in this directory and convert it to a single .PDF file. I know there are Dlls in the market that do this but I would like to do the same myself routine. Woul...
asked by 20.01.2016 / 18:51
1
answer

TEnum not identified in html

I created the following helper: public static HtmlString DropDownListEnum<TEnum>(this HtmlHelper htmlHelper, string name, int? valorSelecionado = null) { List<SelectListItem> lstEnum = AttributesHelper.ToSelectList<T...
asked by 28.06.2016 / 20:10
1
answer

Question with formatted time return asp.net mvc

In the application I have a query that compares the current time of the server with a pre-set timetable recorded in a table: select CAST(HORA_FECHAMENTO AS datetime) as HORA_FECHAMENTO, CAST(CONVERT(VARCHAR(11),GETDATE(),8) as datetime) as...
asked by 11.01.2016 / 04:54
1
answer

When choosing a company to connect to the Database

Aguem could help me I'm doing a project to deliver this year in college in 4 layers I have a login screen and when I type user and password I choose the company that I should work example Company A, Company B, Company c, in sql server I have 3 ba...
asked by 08.01.2016 / 00:13