Questions tagged [sqldatadapter]

9 questions
1
vote
1 answer

DataAdapter update not working against an Access DB

I'm trying to create a class to store my connection string and general functions for insert, update and delete. Testing the INSERT function, it seems to complete the process without any errors but the phisical DB doesn't have the new registry. Class…
Marco Sanchez
  • 788
  • 7
  • 22
1
vote
1 answer

CommandTimeout being ignored using DbDataAdapter.Fill

I cannot seem to get the CommandTimeout to work in the code below. I set the timeout value to 1 second just to test to ensure it works but it seems to be ignored. The SELECT statement takes about 15 seconds to run and it runs to completion. I am…
Gene S
  • 2,735
  • 3
  • 25
  • 35
0
votes
0 answers

datagridview and combobox in offline Mode

I want to display in a datagridview informations of books that he's author is selected in combobox, in offline mode. I wrote this code to fill the combobox with ahutor's name private void Liste_des_Livres_Load(object sender, EventArgs e) { …
Sella
  • 51
  • 5
0
votes
2 answers

SQL Data Adapter Insert Command

There seems to be a problem with the following code I would like to insert a value in the database using the following code snippet. DataTable dtUsers = new DataTable("tblUsers"); BindingSource bsUsers = new BindingSource(); SqlDataAdapter daUsers =…
Alison
  • 1
  • 1
  • 1
0
votes
3 answers

I have 10 columns in table, but i want to display only 4 columns in datagrid in c#, how can i do it?

I can't found solution... i have set 4 columns in DataGrid view but when i am using SqlDatAdapter and DataTable it displaying all columns .
Roop
  • 1
0
votes
2 answers

SQLDataAdapter changing value type returned from SQL

In my C# project, I am executing a query against a SQL 2014 database to retrieve Employee data, including a PeriodEnd which is stored in the database as a Decimal (i.e., Nov 17, 2016 is stored as 20161117). The database I am querying is not our…
BrianKE
  • 4,035
  • 13
  • 65
  • 115
0
votes
1 answer

Save DataGridView into SQL Server

I'm trying to save changes from my DataGridview back into the SQL Server 2008. I have the following code but it only updates the DB the first time the button is clicked. Where am I overlooking something? private void btnDone_Click_1(object sender,…
Emile Cloete
  • 143
  • 1
  • 2
  • 10
0
votes
1 answer

vb.net radiobuttonlist containing 3 buttons not firing when selectedindexchanging from index 2 to 0 under one condition

My code fills a DataGrid control (vb.net 3.5 framework) using sqldataadapter and dataset, filtered by selections from a combination of other controls. Everything works fine except RadioButtonList1 with 3 rbtns under one condition: The issue…
Doreen
  • 714
  • 2
  • 14
  • 36
0
votes
4 answers

Why I get Incorrect syntax near '=' error

I tried bind a label from datatable I get this error Incorrect syntax near '='. at this line da.Fill(dt); My code : Page_Load LbLID.Text =this.Page.Request.QueryString["DI"].ToString(); SqlConnection con = new SqlConnection("Data…
Mhmt
  • 759
  • 3
  • 22
  • 45