Questions tagged as 'ado.net'

2
answers

Syntax error in SELECT WHERE using ADO.Net parameters [closed]

Does anyone understand this error and get a solution? Code:OleDbConnectionConSelect=newOleDbConnection();ConSelect.ConnectionString=Properties.Settings.Default.dbInvoice;ConSelect.Open();OleDbCommandCmmSelect=newOleDbCommand();CmmSelect.Comm...
asked by 29.08.2016 / 18:09
3
answers

SQL use variable in column name

I need to use variables to define the column name in my sql query. Gender: SELECT IDLayout, Nome, @collum, TipoProduto FROM ProdutoLayout WHERE (TipoProduto = @tipo) AND (@collum = 1) Since @collum is the...
asked by 27.03.2014 / 14:15
2
answers

Any ASP.NET MVC solution for SQL injection?

I have in the application a code that validates the data entry, adjusting according to what is needed, would this be considered a good or a bad option? public static string ValidaDados(string str) { //Função simples para evitar at...
asked by 14.02.2017 / 13:10
2
answers

Populate DataSet with DataTable

In C #, how do I declare and populate a DataSet with a DataTable? My idea is to pass the resulting data from a query in the Database to the DataSet, then fill a Report with that DataSet. Is it possible?     
asked by 10.10.2014 / 15:02
2
answers

How to simplify code using a loop?

How can I simplify the code below using a loop, I am in doubt because of the names of the labels that are sequential, as I put something variable in FieldName1, NomeCampo2 , ..., NomeCampoX . lblNomeCampo1.Text = dt.Rows[1][0].To...
asked by 30.10.2017 / 12:18
1
answer

Error while trying to set the MissingSchemaAction property of NpgsqlDataAdapter [closed]

I'm trying to set the MissingSchemaAction property of a NpgsqlDataAdapter object, but Visual Studio is complaining that the property does not exist. I looked at the github project and saw that NpgsqlDataAdapter inherits...
asked by 03.06.2016 / 00:32
2
answers

How to convert a DataSet to Int32?

I'm having a problem converting an information that is 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 straight to a Dataset which I call...
asked by 18.06.2016 / 07:07
2
answers

The type initiator of 'Oracle.DataAccess.Client.OracleConnection' raised an exception with C #

My wpf program worked very well. They moved, to make some changes. Well, I was asked to change some folders in the application. Before I make any changes I ran the application and it is giving me this error:    The type initializer for 'Oracl...
asked by 18.05.2016 / 15:12
3
answers

Difficulty in popularizing GridView

I have a screen that I query clients and fills in a grid with the information that comes from the database, my project is layered up to where I'm working, but I can not fill in > grid with some information, I have the following situation insid...
asked by 09.02.2015 / 23:34
1
answer

Registering the value of a variable in a table

I'm trying to save data from 2 variables in a table, but when I look at the table in the database the values are recorded as 0. public void inserir(List<Conta>list) { List<Conta> lista = new List<Conta>();...
asked by 24.02.2018 / 21:26