Most voted "ado.net" questions
It’s a set of software components that programmers can use to access data and data services. Created by Microsoft for use with the . Net Framework, it is now used on a smaller scale giving way to more complex technologies.
Learn more…122 questions
Sort by count of
-
3
votes1
answer459
viewsExecute 2 querys or more
I wanted to execute 2 darlings in C# when the button is clicked, but I can only execute one. public static void excluireventos() { string connectionString = Conn.tank(); using (SqlConnection…
-
3
votes0
answers62
viewsuse Sqldependency with [ORM]
I am developing a service that must perform a procedure whenever a record as a certain condition is entered in the database. However, despite using the SqlDependency, I’m not using the SqlCommand,…
-
2
votes1
answer2236
viewsDynamically Create Datatable
I need to create a DataTable Dynamic; of the kind: List<p> =... List<l>=.... DataTable dt = new DataTable(); foreach (Prod pr in p) { dt.Columns.Add(prod.Nome.Trim()); for (int i = 0; i…
-
2
votes1
answer424
viewsRedeem a Datatable ID inside a Gridview
I’m trying to rescue the ID of my client who is in a GridView, but I’m using a DataTable to fill the GridView. Datatable public DataTable SelecionarDT() { objDAO = new ClienteDAO(); DataRow dr;…
-
2
votes2
answers2389
viewsStored Procedure with output parameter being the Id of the last insertion. C#
Hello, I’m performing an insert in a table, but I need it to return the ID you just entered. I searched on the command OUTPUT but I couldn’t solve my problem. I need to do all this using procedures,…
-
2
votes2
answers513
viewsHow to put between within a code query?
I have the following consultation and I would like to put in the clause Where the condition of being within a certain period. public static DataTable stCloseCaseAll(int schoolId, string dataInicial,…
-
2
votes1
answer240
viewsGeneric Locate Method, using ADO.NET and Procedures
I am looking for a solution from a generic repository to a DAL with a generic Find method, so there is no redundancy in my code. Using ADO.NET and Procedures. I found something in this link: What…
-
2
votes3
answers337
viewsRecover MAX value from an SQL column
string var = ""; SqlConnection con = new SqlConnection(Banco._strCon); string sql = "select max(end_id) from endereco"; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); SqlDataReader dr =…
-
2
votes2
answers239
viewsDataset with cloister Where like '%' @parametro Visual Basic 2012
Hello, I am creating a form to generate reports using the Reportviwer control and I came across a problem, I have a Dataset created with Dsclient name, I created a clausa to filter the search…
-
2
votes2
answers1730
viewsHow to update dataGridView by clicking a button?
I’m using an interface where I have the menustrip left and other form to the right, from there on menustrip has the options to novo(form charges nvCli) and busca(form charges nvConsCli), I need when…
-
2
votes2
answers1705
viewsWhy does unreachable code Detected error occur in C#?
public Boolean LogarUsuario(string Pnome, string Psenha) { using (OleDbConnection conexao = new OleDbConnection(Conexao.stringConn)) { conexao.Open(); cmd.CommandText =…
-
2
votes1
answer68
viewsQuery with Parameter causing timeout
I have a query that when running with ADO.NET it takes less than a second to return your data. When adding Parameters to this query, the return remains the same. However, when adding a type…
-
2
votes1
answer580
viewsDatetime attribute error in C# saving to Mysql
I am trying to enter in the Mysql database the date of birth of the user, in C# the attribute data_birth is of type DateTime and in Mysql the attribute data_nascimento is of type Date, to insert C#…
-
2
votes1
answer289
viewsSql Reader returning null value
I’m running a datareader, however does not return any value, already checked in the table and conditions (where) of select exist in the table. The code goes below: public void consulta() { string…
-
2
votes1
answer831
viewsHow to select a select using the ado.net Entity Framework
I’m developing a system in ASP.NET MVC which uses as standard the Entity Framework for data access, but I am in need of a select on another select, and I don’t know how to do this with Entity. The…
-
2
votes2
answers306
viewsAny ASP.NET MVC solution for SQL injection?
I have in the application a code that validates the data entry, adjusting according to what is necessary, this would be considered a good or a bad option? public static string ValidaDados(string…
-
2
votes1
answer473
viewsFiltering in Bogotá
Hello, I’m having a problem to perform filters on a DataGridView I am using Windows Forms and pulling information from a Mysql database to the DataGridView called dgvDados the information is being…
-
1
votes2
answers808
viewsScaffolding ASP.NET giving error
The error is generated using VS 2012. When I try to create the Controller for my News using the Entity framework, I have tried several ways. o My database you can see in the server explorer on the…
-
1
votes3
answers4590
viewsSQL use variable in column name
I need to use variables to set the column name in my sql query. Gender: SELECT IDLayout, Nome, @collum, TipoProduto FROM ProdutoLayout WHERE (TipoProduto = @tipo) AND (@collum = 1) Whereas the…
-
1
votes1
answer364
viewsHow to get a Mysql output Parameter via C#
I researched and applied what I saw, but is giving error: MySqlConnection con = new MySqlConnection(banco.Conexao); MySqlCommand comando = new MySqlCommand("sp_venda", con); comando.CommandType =…
-
1
votes2
answers147
viewsUse 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 Lynx and Lambda are always together, so the various "?" okay?
-
1
votes2
answers2679
viewsFill Dataset with Datatable
In C#, how can I declare and fill a Dataset with a Datatable? My idea is to pass the data resulting from a query in the Database to the Dataset, then fill a Report with this Dataset. It is possible?…
-
1
votes2
answers665
viewsDatagridview with columns of different tables of a Dataset
I imported 16 tables from mine MSSQL in a DataSet and made all the necessary relationships. I need to generate a report on a DataGridView (or other tool) with columns specific to several tables. How…
-
1
votes2
answers908
viewsPass connection string to dataset via code
How to pass the string connecting to the dataset via code? because the application I am developing cannot contain the app.config.
-
1
votes2
answers1122
viewsSqldataadapter Query with Parameters
I’m having difficulties in returning a query in the database using SqlDataAdapter with parameters. Well, I have a layered application in my View when I first access a GridView with a query (this…
-
1
votes1
answer412
viewsCreate 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 other field. How would you look with Datareader? a correct way, using a method that…
-
1
votes0
answers32
viewsDbdatareader to read after a while
When the database is at the beginning, it works perfectly, after some time of use, the object does not return anything and the query does not work. This is the source: using (DbCommand cmd =…
-
1
votes1
answer144
viewsRecovering badly formatted string when it contains accented words
In my application I am having trouble fetching the data in the Postgresql database, the words with accentuations when retrieved from the database and dealing in DataReader are coming badly formatted…
-
1
votes1
answer133
viewsAdd parameters to Idbcommand
I used the method below to add parameters using the interface IDbCommand using System; using System.Collections.Generic; using System.Linq; using System.Text; using EstudoDotNet.Comum.Dominio; using…
-
1
votes1
answer33
viewsSearch for data not committed
I was doing some tests with respect to transactions and I saw that if I perform a search of the data registered and not committed they are returned. In Entity Framework this doesn’t happen, and so I…
-
1
votes1
answer370
viewsSqlcommand and Executereader parameters
I can’t get bank values and direct a form according to what "profile" is in the users table, if I take the part of ExecuteReader, works the login, however, I need to check the user profile, my code…
-
1
votes3
answers228
viewsDifficulty to popular the Gridview
I have a screen that I consult clients and fill a grid with the information coming from the bank, my project is separated by layers until where I am works, but I can not fill the grid with some…
-
1
votes4
answers1276
viewsHow to get the amount of records from a Datareader?
I am doing a query in a database, but need to know how many records I will get from this query, before I even start crocheting. Note: I don’t want to put a counter inside the mesh, I need the value…
-
1
votes1
answer241
viewsConvert Datatable to List Entity
I’m trying to use the code below to convert but it gives error everywhere that has the T and where. What could be? // function that set the given object from the given data row public static void…
-
1
votes1
answer749
viewsThe various part identifier "System.Data.Datarowview" cannot be associated
Try { if (cmbFavorecido.SelectedValue != null ) { txtID.Text = cmbFavorecido.SelectedValue.ToString(); cn = conexao.ConectarSqlServer(); cn.Open(); SqlCommand cmd = new SqlCommand("select…
-
1
votes2
answers3651
viewsThe 'Oracle.DataAccess.Client.Oracleconnection' type initializer triggered an exception with c#
My wpf program worked very well. They moved it to make some changes. Well, they asked me to change some folders in the application. Before I make any changes I went to run the application and is…
-
1
votes1
answer40
viewsError trying to set Npgsqldataadapter Missingschemaaction property
I’m trying to set the property MissingSchemaAction of an object NpgsqlDataAdapter, but Visual Studio is complaining that the property does not exist. I looked at the github of the project and saw…
-
1
votes2
answers397
viewsHow to convert a Dataset to Int32?
I’m having an information conversion problem that’s coming from my database to a variable of type Int32. When I do the select max(cur_id) from tbl_curriculo; I send the id information directly to a…
-
1
votes1
answer1369
viewsHow to browse a Dataset based on the data contained in a Datagridview?
I need to fill out a datagridview which already contains the list of all items. This is based on the records of material movements in a DataSet. The datagridview already has all items, for example:…
-
1
votes2
answers323
viewsSyntax error in SELECT WHERE using ADO.Net parameters
Someone understands this mistake and gets a solution? Code: OleDbConnection ConSelect = new OleDbConnection(); ConSelect.ConnectionString = Properties.Settings.Default.dbInvoice; ConSelect.Open();…
-
1
votes1
answer82
viewsCapture error when click button
I want to make a button that when it is clicked is shown the information of SQL Server and say that it is connected (have to configure the file in XML Configuration File) See below the code: public…
-
1
votes1
answer1942
viewsTRANSACTION - How to correct a shipping error?
I think you can understand what I’m trying to do there: This method will make a foreach for each item in my movement list, and send each as a parameter to the method that will save them in the BD. I…
-
1
votes2
answers96
views -
1
votes1
answer130
viewsHow to get value from a field in SQL using C#?
The idea is that I insert data referring to 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
votes1
answer42
viewsRecording value of a variable in a table
I’m trying to save the data of 2 variables in a table, but when I look at the table in the database is recorded the values as 0. public void inserir(List<Conta>list) { List<Conta> lista…
-
1
votes1
answer430
viewsType conversion error when saving to database
My project has a form frmAdicionarProduto to add products to the database containing TextBox and ComboBox: txtProduto txtQuantidade cmbTipo txtValorFornecedor txtValorFinal txtLucro I’m having…
-
1
votes3
answers132
viewsError concatenating component value in query
As darlings in my C# Winforms project are being carried out through StringBuilder. It was suggested here in the O.R. query of Consulta.Append("Select * from...") for @"select * from..." for being…
-
1
votes1
answer111
viewsPopular a Combobox from the selection of another Combobox
I really have no idea how to do this, but if this is really possible it would be very helpful to me, I tried in some ways but none of it worked I have a ComboBox cboBusca where I select what I want…
-
1
votes2
answers113
viewsDoubt C# ADO.NET class - Accessing data from a Datatable
Hello, good evening, I’m new here and a beginner in C programming#. I am developing a CRUD vinyl record system (a particular hahaha addiction), using ADO.NET classes, similar to the article below.…
-
1
votes1
answer32
viewsRecover Milliseconds of a date recorded in an MSSQL Server 2019 BD with VB.Net + ADO.Net
I would like to know how to recover a date as given from the recorded Milliseconds in a MS SQL Server 2019 database using VB.Net + ADO.Net. Whenever I try to rescue the date, comes in the fomrmato…