Questions tagged as 'c#'

1
answer

display data from a mysql database column in label [closed]

How do I give a select in a data from my column a table and show it in a label? EX: id = 10 -> Banana Select * From tabela where id = 10 label.Text = Banana MySqlConnection conexao = new MySqlConnection(); conexao.Connecti...
asked by 04.06.2017 / 11:29
1
answer

Combobox combination to create another

Hello! I am trying to make a combination between two combobox, where a third one shows the list with the products that contains the category and the brand, but when I do not have any product registered with the two attributes, I would like it to...
asked by 03.06.2017 / 19:41
1
answer

I need to convert a string to int inside a hql

I need to change the string to int, but it is located inside a hql, I will probably have to terminate the query, but it from the error to enter the database, my code is a c # with asp.net, mvc, nhibernate. public void soma(Rota post) {...
asked by 13.06.2017 / 18:00
0
answers

EF Core - How to map a field in a table that relates to two fields in another table

I have a Person class (Campo PessoaId) that relates to the PersonContaBancaria class (Fields: PersonAccountBancariaId, PersonAccountBank, PersonId and PersonAccountId). Logic: In the Person table the individuals and legal entities will be sto...
asked by 04.06.2017 / 23:05
3
answers

C # - Object reference not set to an instance of an object [closed]

I have this error in my code: try { localhost.Agendamento a = new localhost.Agendamento(); a.Cliente.Cpf = "1909009921"; a.Servico.Cod_serv = 1; a.Data = Convert.ToDateTime("11/02/2017"...
asked by 01.06.2017 / 00:38
1
answer

Error creating a condition in the Html.Raw of the WebGrid

I'm trying to put a condition on a WebGrid line and the following error occurs: Cannot convert lambda expression to type 'string' because it is not delegate type EventhoughI'mbasingmyselfonthispost# with credits from MeAjudaSilvio I...
asked by 14.06.2017 / 05:51
1
answer

Error executing SQL "Create Trigger ..." within a C #

Goal: Run a create trigger script using a string inside C #. Problem 1: Table not found (because the script does not indicate in which Table to create the trigger). Attempt2: Start the string with "Create Trigger on [dbo]. [Table]". Pro...
asked by 14.06.2017 / 14:23
1
answer

verifying a filled field in a select in the database

Good morning ... I need a help from the forum, and nen I know how I can do this in C #. I'm trying to explain, I have form and in this form I have a button that generates a sequential two-digit code, right up to the beauty generating, ther...
asked by 14.06.2017 / 15:31
2
answers

Make a backup in more than one database. W#

I'm making an application where I need to do automatic backups and restore between databases. But I want to solve this step by step. For now I would like to know how I would make a selection of several databases (Sql Server) and back them up,...
asked by 07.06.2017 / 21:18
1
answer

Edit Excel worksheet with C # in Microsoft Azure

I have a web application that reads an excel spreadsheet and imports the cell values into the database automatically. I am using COM, so it is necessary on the machine Microsoft Excel installed. When compiling locally it works without problems....
asked by 08.06.2017 / 01:46