Posts by Nicola Bogar • 1,149 points
76 posts
-
0
votes1
answer387
viewsQ: Run the Submit of a form in an element click event
What is the best way to perform a POST at the click of a button in an Asp.net MVC form. View Create: @model Projeto.WebERP.EntityFramework.Entities.Pais @{ ViewBag.Title = "Create"; } <div…
-
0
votes1
answer213
viewsQ: Run Modal Open Screen Script in Ajax. C#
Problem: I’m in the Index view, it has a button that opens the Create view on a modal screen, on this modal screen I want to run a javascript code, but for some reason it is not running. I am…
-
9
votes2
answers2136
viewsQ: Web API x Webservices
Web API was created to better replace a Webservice? If not, what is the exact difference between the two and when to use one or the other?
-
1
votes1
answer505
viewsQ: Browse answer tags from a C#site
I’m performing a query on google by C# and I need to get back from the query the Query Title and the Link of the queries returned. I got my return as follows: public class GoogleSearch { private…
-
-1
votes1
answer249
viewsQ: Wait for an event to be triggered to continue the C#
In the method RealizarPesquisa, when executing the line _WebBrowser.Navigate(), the event is triggered DocumentCompleted(), but this event it takes a while to be executed, so the method…
-
1
votes1
answer314
viewsQ: Get Google query Json with Webbrowser C#
I need to perform the following process, perform a google search and get the search information in Json format, how could I do this? I tried to do it this way, I used Webbrowser from C# and I…
-
0
votes1
answer588
viewsA: Entity Framework Relationship Error
Friend, see if this helps you, as this code below as soon as you perform the Migration for the database the tables will be created as follows. Classes public class Pais { public Pais() { Estados =…
-
3
votes1
answer484
viewsQ: To add runtime property to an already created class C#
I need to add properties in the Griddatasourcebase class at runtime, someone can help me how to do this? public class GridDataSourceBase : IGridDataSource { public long Handle { get; set; } }…
c#asked Nicola Bogar 1,149 -
0
votes0
answers75
viewsQ: Pass lambda expression to another class run C#
Can you pass a lambda expression to a class, and then execute it ? Something like code below. Giving error in the expression select new Error: Error 1 Cannot implicitly Convert type…
-
1
votes1
answer103
viewsQ: Input Entityframework C#
I have 3 Entity, where are Countries, States and Cities. I am performing the Crud of the City Entity, and saving is asking for the relationship of States and Countries, but this I do not need,…
-
1
votes1
answer120
viewsA: Error inserting data with Entrityframework C#
The problem I was having was that I created the Acronym field with 3 characters, then switched to 2 characters and forgot to run Update-Database.
-
1
votes1
answer172
viewsQ: Perform database mapping for Dbset<T>. Sqlquery()
Error while running Sqlquery on my Dbset. There is no mapping of the object type System.Data.Entity.Core.Objects.Objectparameter for a native type managed provider. I would like to leave my database…
-
1
votes1
answer36
viewsQ: Error in constructor name parameter Objectparameter C#
When I pass a string variable to the Objetparameter parameter of the following error. string nomeParameter = sql.Substring(startPosition, stopPosition - startPosition); ObjectParameter parameter =…
-
1
votes1
answer120
viewsQ: Error inserting data with Entrityframework C#
I have a very strange problem, I have 3 tables, being them, Countries, States and Cities, all of them are configured certainly equal, but it is giving error only when it is inserted data in the…
-
0
votes1
answer36
viewsQ: Migrations Entityframework C#
Error while performing Migrations. The ADO.NET Provider with invariant name 'Sqlclient' is either not Registered in the machine or application config file, or could not be Loaded. See the Inner…
-
0
votes1
answer392
viewsQ: Class mapping with Fluentapi and Entityframework C#
Table Parents, State, City; A country can have several states and a state can have only one country; State->Parents : 1:N A city can have only one state and one state can have several cities.…
-
1
votes2
answers114
viewsA: Methods with more than one Generic
I solved my question by returning an Object and using Type as parameter to be able to create the instance of my object. public static object ToEntityForType(this DataRow row, Type type) { EntityBase…
-
3
votes2
answers114
viewsQ: Methods with more than one Generic
It is possible to create a method using more than one type of Generic, sort of like this. public static TResult ToEntityForType<TResult>(this DataRow row, TType type) where TType : Type {…
-
6
votes2
answers1833
viewsQ: Create objects without reference C#
My question is, I have two instance of the class Parents, faths1 and fathers2, I created the 3 instance of the class Parents called fathers3 and said that it will be equal to instance fathers2,…
-
0
votes1
answer70
viewsQ: Problem using Bindingsource C#Canceledit()
I am creating a CRUD and I am using the Bindingsource component with Datasource Typed with my Parents class. In the form I placed a textbox linked to my bindingSource in the property Name of my…
-
4
votes1
answer335
viewsQ: Get properties of a class with condition. C#
I would like to get the properties of my Parents object, but I would not like to take the property (States) of my Country class. I tried it the way it is in the "Test" class and I couldn’t because I…
-
0
votes2
answers783
viewsQ: What better way to align columns of Datagridview C#
What is the best way to align the columns of a Datagridview, because if placed to align by the column name size is cut the cells that are larger than the column name size, and when placed to align…
c#asked Nicola Bogar 1,149 -
0
votes1
answer356
viewsQ: Visual Heritage of Windows Form
I am making a base form with all the components I need to perform a CRUD, and for example, when I create the customer registration form, I will inherit the base class and so show up all the basic…
-
1
votes1
answer818
viewsQ: Customize Tabcontrol C#
I need to customize a Tabcontrol, like, change the colors of the tabs when selected, leave the Tabcontrol without border (flat type), etc. I tried using the Tabcontrol component of Windows Forms and…
-
1
votes1
answer78
viewsQ: Error creating Extension for Datagridview C#?
I’ve used Xtensions for other components and did not give this problem, is giving the error only with the DataGridView. The component finds the extension, and not the error, the error shows only…
-
6
votes2
answers368
viewsQ: How to get the properties of a type when using Generics C#
I have the following class: public class Pessoa { public int id { get; set; } public string Nome { get; set; } public DateTime DataNascimento { get; set; } } I’ve developed a method to get her…