Posts by Julio Borges • 3,178 points
91 posts
-
0
votes1
answer32
viewsA: Pass an array to a webapi controller
The request you are trying to perform is a GET and requisitions GET semantically do not have body, ie do not receive complex objects in the body of the request. What you can do is change the method…
-
1
votes1
answer898
viewsA: Server cannot attach a header after HTTP headers have been sent
The problem happens because when redirecting the page via window.location.hrefredirect is carried out on the page plus the request headers are maintained, what you should do is try before…
-
3
votes1
answer197
viewsA: Structuring a Saas Database
This is an issue that generates a lot of discussion, since many factors should be evaluated. My intention with this answer is not to tell you "do this and this way" but to indicate possible ways for…
-
3
votes1
answer371
viewsA: How to fix Blinking Panel (Flickering Control) when drawing something?
This is an old problem of Windows Forms applications, what happens is that the graphical processing of the screen can not properly load the screen update, because the action taken is faster than the…
-
5
votes1
answer687
viewsA: How to use the Foreign Key annotation in C#?
Basically the DataAnnotations [ForeignKey] is only to clarify the foreign key field in relationships between two entities, for example: public class Livro { public int Id { get; set; } public string…
-
2
votes1
answer469
viewsA: No such Column Android Sqlite
Paul, The mistake happens because you’re trying to make a select with a Boolean comparison. Sqlite does not have the Boolean data type, but maps them as integers (true = 1 and false = 0), see…
-
1
votes1
answer167
viewsA: EF Core error when applying update-database
When creating the entity, the Mysql Provider looks at the property you pass in the mapping Type Constraints, such as DateTimeOffSet is not a guy Nullable<T> then the mapping breaks, try to…
-
2
votes2
answers58
viewsA: Doubt about the Context Class
DbSet<T> are the interpretation through objects of the tables of your database, regardless of how was the approach of the implementation of its context, be it Database First or Code First. If…
c#answered Julio Borges 3,178 -
0
votes1
answer54
viewsA: Recyclerview is displaying entire json array instead of object
Use the method getJSONObject("notifier"); to take the internal object and then use the getString("name"); to get the name of the Notifier object, see code below: JSONObject notifierObject =…
-
1
votes1
answer36
viewsA: Instance error
Check the return of the method _TceRepositorio.buscarTce(pIdTce). It must be returning a null value. Below is an approach that facilitates its verification: var testObject = await…
-
3
votes1
answer104
viewsA: How to create an Object in a Linq.Expressions.Expression and add properties dynamically to it in C#
@Leandroluk, I could not test here, more of a look if it helps you this method I made based on a response from Soen:…
-
0
votes1
answer447
viewsA: Access Combobox Selecteditem Windows Forms C#
Actually your code needs several improvements. First you should use the property DataSource of the component ComboBox to fill in the items so that you can use the component’s resources correctly. To…
-
1
votes1
answer99
viewsA: How to use non-static "getSystemService"
The method getSystemService() is a class method Context, so you should put ctx.getSystemService() private void setAlarm(Context ctx, Calendar targetCall) { Toast.makeText(ctx, "Alarm is set at" +…
-
0
votes1
answer90
viewsA: Notifications repeating every day
Working the way you are working, the easiest way to do it would be to generate the new notification when the notification is triggered, more or less like this: private void salvar() {…
-
0
votes2
answers717
viewsA: Call method with View parameter in another method
Let’s think a little... If the method requires a View as a parameter, it is because the processing performed in this method is inherent to View that will be passed on. How do we know a View is an…
-
0
votes1
answer85
viewsA: Sqlite Visual Studio 2008
That Library SQLite.Interop.066.DLL is a library for Pinvoke, you do not reference it and yes includes it to be distributed in the directory of your application. To include it, place it within your…
-
5
votes2
answers94
viewsA: How to perform a Where using Entity Framework
The problem is that you are running Where, but runs Tolistasync throughout Dbset, change your code to: public async Task<ActionResult> Index() { if(Session["cod_cli"] != null) { return…
-
2
votes3
answers227
viewsA: EF Core - Partitioning Filter
I do not know if I understood your question very well, but it seems you want to generate a generic query with a global filter, since in your application the field FilialId is a global field. An…
-
3
votes1
answer264
viewsA: How to run a c# program on the client machine?
You probably need to install Microsoft Visual Basic Power Packs on the client’s machine. Your machine has no error, because it is the development machine and in it the library has been installed for…
-
4
votes3
answers614
viewsA: How to create a custom list using data from four tables?
You can use Join with Lambda expressions: List<Fornecedor> forecedores = new List<Fornecedor>() { new Fornecedor() { id=1, descricao="forn1" }, new Fornecedor() { id=2, descricao="forn2"…
-
2
votes1
answer84
viewsA: Select does not display data in listview
More details are missing in the question, more I believe that the problem may be in relation to the format of the date that is configured on the system, I have had many problems with it, of being…
-
6
votes3
answers609
viewsA: How to compare 2 Arrays to Assert.Equals?
The command Assert.AreEqual compares as a reference, so that you can compare arrays or lists, you must use the CollectionAssert.AreEqual public void SeparaStringTest() { RecebeComando recebecomando…
-
9
votes2
answers757
viewsA: Create a Stream object from a string
You can convert to bytes and then to MemoryStream which is an object inherited from System.IO.Stream. string conteudo = "Teste"; byte[] array = Encoding.UTF8.GetBytes(conteudo); MemoryStream stream…
-
4
votes1
answer6420
viewsA: Android App icon size
Try to change the parameters that Android Studio presents you on this screen, you can remove Padding from the icon, this Padding is an internal space that is generated between the icon and the image…
androidanswered Julio Borges 3,178 -
2
votes2
answers1130
viewsA: Webservice consumption only runs in debugging under the Visual Studio IDE
You are probably distributing your application without the configuration file (app.config) or the client configuration file does not have the Servicemodel key. The correct thing would be to include…
-
1
votes5
answers1114
viewsA: Save Combobox C# values to database instead of descriptions
The best way to do this is by using the Datasource property of Combobox, this way Combobox is already prepared to use Databinding, not to mention that if the value of the key field is of a different…
-
3
votes1
answer214
viewsA: What is the best and safest way to identify a device in the webservice?
What you are looking for is a method of authentication or authorisation for your Webservice, but this varies according to the technology undertaken in the development of your Webservice. If you are…
-
7
votes1
answer1120
viewsA: Validate input size with Angularjs
You can use the directives ng-minlength and ng-maxlength straight into HTML as below: <div ng-controller="ExampleController"> <form name="meuForm"> <label> User name: <input…
-
1
votes1
answer85
viewsA: Android : I would like to call a facebook profile image for the app user profile
It will depend a lot on the technology used for development, but basically you will have to use the Facebook API: https://developers.facebook.com/docs/graph-api/reference/user/picture/ In the case…
-
2
votes1
answer133
viewsA: Injecting $state (ui-router) into $http Interceptor is causing circular dependency error, how to resolve?
To fix the problem just inject the $state manually using the service $injector, below an example seen in an answer from Soen: var interceptor = ['$location', '$q', '$injector', function($location,…
-
0
votes2
answers925
viewsA: Is it possible to make a synchronous call to Webapi?
It is possible to make the call synchronously, using the async keyword before the method call as shown below: private void btnListaGenerica_Click(object sender, EventArgs e) { List<Empresa>…
-
5
votes1
answer53
viewsA: Cast shapes with interface
You can leave it to the compiler to solve this cast for you. This can be easily accomplished with the use of a parameter restriction. just create the method this way: public class Program { public…
-
0
votes1
answer42
viewsA: Angularjs - Changing view with json return
I think for a more complete answer we would have to see the image’s HTML, because the image code could include. The correct way to work with images is to use the ngSrc directive, as an example of…
-
1
votes4
answers110
viewsA: Why this division in the class instantiation in C#?
In the code shown above, the author chose to instantiate the object Farmer farmer in the builder: public partial class Form1 : Form { Farmer farmer; public Form1 () { InitializeComponent(); farmer =…
-
1
votes1
answer44
viewsA: Undo Editingcontrolshowing
The problem is because you arrow the event to all columns, and you should set the event only in the columns you want to consist of, you can do this by taking the index of the column you want to…
c#answered Julio Borges 3,178 -
0
votes1
answer292
viewsA: Code First Relationship Migration and Insert?
I believe the problem is because city and state entities are detached from their context, try to do the following before calling the UserManager.CreateAsync(model, model.Senha): if…
-
2
votes3
answers707
viewsA: Formatting dates for display and storage
This error happens because you do not put the input format in Simpledateformat, try changing the line below Of: formatFrom = new SimpleDateFormat(); To: formatFrom = new…
-
1
votes1
answer342
viewsA: JSON return with WEBAPI
What is happening is that you have a cyclic reference in your mapping (1 contact has an operator and an operator has a contact number). Basically, you can solve it in two ways: The first and most…
-
9
votes1
answer767
viewsQ: Multi-client Web API Structure
I’m in the following situation: I have a web application that accesses the data through a C#Webapi. I need to apply the concept of multitenancy in order to allow my application to be accessed by…
-
2
votes1
answer90
viewsA: How to call Linq method in View?
The problem is in the type of return you are using, in this approach, you do not specify which return of Iqueryable, consequently in the view, you will not be able to view the desired data. A…
-
4
votes2
answers621
viewsQ: Entityframework . Asenumerable() or . Tolist()?
In one of the projects I picked up I saw the following code, which implements a data listing method of a given entity, but this listing is used only for reading: /// <summary> /// Listar todas…
-
4
votes1
answer96
viewsA: How to disable a window?
I was able to do what you want using the Kiosk Mode, as he had quoted in your other question. In Kiosk mode you disable the input of keys that can close your application, so the only way to maintain…
-
2
votes1
answer400
viewsA: How to block the computer via code?
What you want is to create an application in Kiosk Mode. This is not simple to implement. You should use the library of the system user32.dll to lock all keys and shortcuts that may cause the…
c#answered Julio Borges 3,178 -
0
votes1
answer171
viewsQ: Tortoisesvn - Database locked
I use Tortoisesvn with Windows, when I try to Update my working copy the following message is displayed: Update Working copy '[Working copy directory]' locked. '[Working copy directory]' is already…
-
1
votes1
answer171
viewsA: Tortoisesvn - Database locked
The problem occurs when a given task is completed in the middle of the process which generates a problem in the database of the tortoiseSVN itself. To resolve the issue, use some Sqlite database…
-
3
votes1
answer98
viewsQ: Delegate (similar to C#) in Javascript
A feature I use a lot in C# is delegate which is a reference type used to reference anonymous or named methods. Especially classes already implemented in framework like the Action and the Func, as…
-
4
votes2
answers2237
viewsA: Download all files from a folder on FTP?
Well, I’ve used the code below: public void BaixarTodosArquivosDirFTP(string urlFTP, string usuario, string senha, string dirLocal) { FtpWebRequest ftpRequest =…
-
2
votes3
answers149
viewsA: How to generate new code from DBO
The method you are using to run SQL (ExecuteNonQuery()) is a method used to Inserts and updates and its return is the amount of affected lines as described in documentation. Use the method…
-
0
votes1
answer234
viewsA: Android json utf8
I already faced this problem once, and solved it by converting the string to bytes in the ISO-8859-1 standard and then creating a new String. I created a method that returns String in UTF-8: public…
-
5
votes2
answers114
viewsA: Return original Textbox formatting
You can also use the system colors for better standardization: public void limparCorBoxes(Control.ControlCollection controles) { //Faz um laço para todos os controles passados no parâmetro foreach…