Questions tagged as 'ado.net'

2
answers

How to get the number of records in a DataReader?

I'm doing a query in a database, however I need to know how many records I'll get from this query, before I even start the loop.    Note: I do not want to put a counter inside the mesh, I need the value   before * cmd = New OleDbCommand(sq...
asked by 09.03.2016 / 15:43
1
answer

Insert current date into a field [closed]

I am using% co.de% of .Net to create a project as a learning base for BD with C #. I chose an easier way that would be to work most of the time in design mode through dataAdapters . The battle I face is to insert the current date into a DB...
asked by 13.12.2015 / 02:51
1
answer

Create a method to get records by id

In my CRUD I want to create a method obterPorId(Cliente cli) I want to get the records by code, or by name, or another field. How would you get the DataReader? a correct way, using a method that returns a client, eg: public Client...
asked by 01.02.2015 / 05:54
1
answer

Retrieving malformed string when containing accented words

In my application I'm having trouble fetching the data in the PostgreSQL database, accented words being retrieved from the database and dealing with DataReader are coming poorly formatted as in the image below. In the correct formatte...
asked by 03.11.2014 / 22:01
2
answers

Use lambda with Ado.Net

Using sqldatareader and ado.net, can you use lambda with linq or just lambda or just linq? This is not a multiple question, but linq and lambda are always together, so the various "?", Ok?     
asked by 05.06.2014 / 20:36
2
answers

Pass connection string to dataset via code

How to pass the string connection to the dataset via code? because the application I'm developing can not contain app.config .     
asked by 09.01.2015 / 17:20
1
answer

How to get value from a field in SQL using C #?

The idea is that I insert data about the same person within SQL, but in different Entities, contextualizing: I have the table Pessoa : create table Pessoa( ID_Pessoa int primary key identity (1,1), Nome_Pessoa varchar(50), CPF_Pessoa...
asked by 29.11.2017 / 18:52
1
answer

TRANSACTION - How to correct a transport error?

I think you can understand what I'm trying to do there: This method will make a foreach for each item in my list of moves, and send each one as a parameter to the method that will save them in the DB. I need to use a Transaction to ens...
asked by 27.09.2017 / 07:18
1
answer

Capture error when button is pressed

I want to make a button that when clicked is shown the SQL Server information and say that it is connected (have to configure the file in the XML Configuration File) See below the code: public class Functions { public static void conn()...
asked by 15.11.2016 / 20:34
1
answer

The multi-part identifier "System.Data.DataRowView" can not be associated

try                 { if (cmbFavorecido.SelectedValue != null ) { txtID.Text = cmbFavorecido.SelectedValue.ToString(); cn = conexao.ConectarSqlServer();...
asked by 25.02.2016 / 12:29