Questions tagged as 'ado.net'

1
answer

Making the insert in SQL Server in a float field?

I have the following problem in my code, I have a textbox that receives the value 0.900 , but when I am writing this value to the bank, it is only recording 900, and I need to record the 0.900 and I can not write this way, the field...
asked by 08.08.2017 / 15:00
1
answer

DataReader in using blocks executes the "Close ()" of the DataReader?

I have a little doubt regarding DataReader's within using blocks. If the my DataReader object is inside a using block, will it be closed at the end of that block? Or do I have to insert the Close () method? Here is a sample DataReader with th...
asked by 04.08.2014 / 21:02
1
answer

Add row in a dataTable

I need to add a row in a table in a given position. I have the following methods: public void criarTabela(DateTime dia) { tabela = new DataTable(); switch (dia.DayOfWeek) { //case...
asked by 30.11.2015 / 03:03
1
answer

What are the differences in performance issues when using querys with EF vs ADO

What is the difference in performance when using the query methods the base SqlQuery<TElement> and ExecuteSqlCommand of EntityFramework in relation to directly using ADO.NET ? If there is a significant difference in perf...
asked by 06.04.2016 / 13:54
1
answer

Error: Registering? in place of special character only using the browser

I'm having a problem saving data in my ORACLE database. When using my application to fill in fields and register a string, special characters such as accents are replaced by a ? in the database The detail is that if I get the same query a...
asked by 18.03.2014 / 21:33
3
answers

What is the best way to check the existence of a record in the database via the application?

Today I use a method that sends a COUNT with the record Id as a parameter to the database. Is there a better, perhaps more performative way to do this?     
asked by 27.02.2015 / 14:38
1
answer

Connecting to the database with App.config

How to establish a connection to the Northwind database using App.config and ADO.Net?     
asked by 27.06.2014 / 02:48
4
answers

How to get the number of records in a query in SQLite?

I'm listing the records of a table with the code below: SQLiteCommand comando = new SQLiteCommand("SELECT * FROM Cadastro " +filtro, conn); SQLiteDataReader receber = comando.ExecuteReader(); But before listing, I need to check if there is...
asked by 19.08.2015 / 21:13
2
answers

Saving file path in MySQL

I'm having difficulty saving file address to the database. When saving the address to the bank it is adding the amount of times I used OpenFileDialog to save a file. Save the address always so C:\Users\phili\Desktop\PDF_SGIM_QUALIDA...
asked by 21.06.2016 / 17:34
1
answer

What is the best validation strategy before the data persist? [closed]

I'm used to .NET using C # and EntityFramework. And there in Entity we have dataanotations . When I create the entity in C #, for example of person, just put the datanotaations and the Entity is valid for me: public partial cla...
asked by 23.10.2017 / 20:08