Questions tagged as 'c#'

2
answers

What is the best way to authenticate to the database?

What is the best way to make a connection to the database using C #? Create a USERS table, or create a USER in the database to access?     
asked by 02.11.2017 / 19:47
1
answer

VBA Migration to C # - V10 - Error "System.IndexOutOfRangeException: 'Can not find table 0.'"

Good afternoon, I needed help to help overcome error:    System.IndexOutOfRangeException: 'Can not find table   0. '", when executing PSO.ExecSql.ExecutaXML (" update CabLiq setPag="" + PSO.Utils.FStr (this.DocumentoVenda.CamposUtil ["CDU_SBM...
asked by 10.09.2018 / 19:35
1
answer

Projects with synchronous and asynchronous APIs

I'm developing a small project and I have two entities for now: Product and Customer The product API is asynchronous (with Task and async) and the client API is synchronous. I wonder if there is any problem in using these two approaches...
asked by 07.08.2018 / 13:46
2
answers

C # - Starting an array / list

I would like to know if you can instantiate a vector of size n and already initialize it with a specific value. (Without using a for for this) For example, I would instantiate a vector, which will have size 100 and all indexes with -1. (Th...
asked by 13.08.2018 / 14:59
1
answer

Replace is not working C #

I'm replacing one code with another in each line that the code is found. But the replace simply does not work, it goes through it and the line continues the same way. As you can see in the image below, if used within the immediate, it appears to...
asked by 10.01.2017 / 13:47
1
answer

Instantiate class or use public methods?

When using a method of a class, there are two approaches: instantiating the class and using the method by the object, or making the method public static and calling directly. Is there any problem in using one or the other? Security, perfo...
asked by 13.01.2017 / 13:47
3
answers

Error trying to send email

I'm trying to send emails (using my hotmail account) and I'm encountering the error below:   Aconnectionattemptfailedbecausetheconnectedcomponentdidnot  responded\r\nwithaperiodoftimeortheconnection  establishedfailed\r\nbecausetheconnectedhost...
asked by 04.11.2015 / 12:47
2
answers

Receive variable value in 'where in'

In my procedure I have the following variables: @Codigo VARCHAR(MAX),@cont as int, @DataPago as VARCHAR(10) Via C # application I'm passing the values as follows: y1.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = "2,4"; y1.Pa...
asked by 23.10.2015 / 18:10
1
answer

How to remove the / home / URL of a View specifies ASP.NET MVC5

I need to create a View called BancoDeImagens but I need to have it's URL instead of: www.site.com/home/ImageBank I would like to remove /home/ and separate names by - to look like this: www.site.com/banco-de-imag...
asked by 29.06.2018 / 20:42
1
answer

Mark / Uncheck button check box

In my program there is a button to mark and the same button to uncheck a checkbox. Example: If I click once, it marks the checkbox, if I click the button again it unchecks the check box. However, clicking again no longer marks the checkbox, a...
asked by 12.07.2018 / 20:03