Questions tagged as 'ado.net'

2
answers

Which object performs best? SqlDataSource or DataTable?

In terms of performance, speed, or security, what is the best object to use as a DataSource ? Example, I am creating a DataSource , to popular a GridView : By SqlDataSource : this.sqlDataSource1.ConnectionName = "...
asked by 27.07.2016 / 15:35
1
answer

Variable with unassigned value within a FOR Loop

int i; string cpf; cpf = "11111111111"; DbConnection cnx = ADO_Utils.GetConnection(); DbCommand cmd = ADO_Utils.GetComando(cnx); cmd.CommandType = CommandType.Text; for (i = 1; i < Convert.ToInt32(txbQtde.Text); i++...
asked by 21.04.2016 / 03:59
1
answer

NullReferenceException when calling function

I'm creating some unit tests for a class library that does manipulations in a database. The method being tested is this: public object ExecuteNoQueryOperation ( string spOrSqlInstructions, CommandType commandType = CommandType.StoredProcedu...
asked by 04.06.2016 / 20:01
1
answer

How to filter a DataView.RowFilter

I have a DataView and I'm trying to make a filter, where the 'photo' field is different from NULL I tried: dv.RowFilter = "foto <> ''"; But it did not filter. I searched here on StackOver and recommended: dv.RowFilter = "Isnull(...
asked by 07.01.2016 / 17:54
1
answer

Is the query generated by the Entity Framework valid for use in ADO?

I want to have a higher performance in a query that I perform in the system Consequently using ADO is much faster than Entity Framework What% of the% it generates when querying could be used to create a query or use wi...
asked by 05.11.2015 / 17:19
1
answer

How to write bit information to SQL Server database?

I am developing a registry system in VB and need help writing the CheckBox information to the SQL Server database. The column is in bit in the database, I do not know how to pass the parameter so that the user's choice is saved...
asked by 25.09.2015 / 16:52
2
answers

Object reference not set to an instance of an object

I know the question is a little subjective, but maybe someone has already gone through it and can help me. I have an application developed in C # / Windows Forms / ADO.NET with firebird database. The "Object reference not set to an instanc...
asked by 16.03.2016 / 15:24
1
answer

Create second column in DataTable

I have DataTable where with the code: DT.Column.Add("1ª", gettype(int32)) For I = 1 To 30 DT.Rows.Add(I) Next(I) This For enumerates column 1 from 1 to 30. 'DT is declared with a new DataTable , in...
asked by 11.11.2015 / 02:16
1
answer

Does ODBC not support reading DBF file?

I'm trying to read a .dbf file by following a tutorial I saw on Macoratti's website (obs guess everyone knows). And when you run the method just below, a OdbcException is thrown with the following message: ERROR [IM001] [Microso...
asked by 26.06.2014 / 17:22
1
answer

C # MySQL transaction in different classes and methods

How do I interact with a transaction between two methods that are in different classes? In my method where I open the transaction it is as follows: public string InserirFuncionarioM(FuncionariosDTO Funcionario) { MySqlTransacti...
asked by 19.04.2015 / 14:54