Questions tagged [sqldataadapter]

Represents a set of data commands and a database connection that are used to fill the DataSet and update a SQL Server database.

The SqlDataAdapter, serves as a bridge between a DataSet and SQL Server for retrieving and saving data. The SqlDataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet, using the appropriate Transact-SQL statements against the data source.

438 questions
-1
votes
1 answer

dataGridView not showing data after DataSource

I am new to C# and have simple method to show data from a table DimCustomer. I am calling this method from a button but its not displaying data. Although when i debug my code i can see data, but not displaying it. Any suggestions please private void…
-1
votes
2 answers

How to add a column when using SqlDataAdapter to fill a datagridview

I am using SQL to fill my datagridview. I am doing that this way: string cn = ConfigurationManager.ConnectionStrings["Scratchpad"].ConnectionString; SqlConnection myConnection = new SqlConnection(cn); string sql = "some text here"; SqlDataAdapter…
wouter de jong
  • 547
  • 2
  • 7
  • 20
-1
votes
1 answer

How do I get a Data with a return parameter with c#?

I all I have this common method which I used mainly for inserting and getting data from the database. But now I came across a issue that when There's an output value I need to create a new method which accepts and output the values return by the…
Ashane Alvis
  • 770
  • 2
  • 18
  • 42
-1
votes
1 answer

c# sqldataadapter params in using

is there any option to initialize sqldataadapter with params ? I'm starting it with using so there's no option to use cmd.Parameters.AddWithValue . using (SqlDataAdapter dap = new SqlDataAdapter("select * from smthg where kh_Symbol = '" + khSymbol +…
WujaBob
  • 9
  • 5
-1
votes
1 answer

Parameters to SqlCommand and SqlDataAtapter

Have been working always with SQLDataAdapter and Fill command for data fetching querys and with executenonquery for insert, update, delete ones. I'm having a problem and can{t figure out what am I doing wrong. I have a DataTable bind to a RadGrid.…
TikalDog
  • 1
  • 2
-1
votes
1 answer

Exception | must declare scalar variable @IdAlbum

I am getting an error "must declare scalar variable @IdAlbum". I have already been through similar posts on this topic but it does not help. Can someone have a look at the code below? When i use command paramters it gives me error. If I do not use…
Azfar
  • 33
  • 6
-1
votes
1 answer

How to return default value when value is null or empty

How can I make the below code return zero if the returned value is null or empty. Also how can I return only the first record on the data table private DataTable GetData(SqlCommand cmd) { gridoutofstock.DataBind(); …
jack
  • 75
  • 1
  • 1
  • 4
-1
votes
1 answer

Using sqlcommand to fill reportviewer but only selected fields get filled in from one table how do i add another table?

I am working on an etime history application, the data is brought into sql from adp application. Requirement User wants to see old time sheet information for a particular employee Process User clicks on 1) paygroup from drop down 2) the employees…
-1
votes
2 answers

When does an object get disposed if it holds no reference?

If the method GetResults() is called repeatedly, is it possible to have multiple instances or does it dispose of itself at the end of its scope? public static DataTable GetResults() { DataTable dataTable; new SqlDataAdapter(sqlQuery, new…
Ernest
  • 1,370
  • 13
  • 23
-1
votes
1 answer

refresh data with sqldataadapter.fill - not seeing new data

I have a timer that runs in the background to keep data updated for a datagridview object. My timer is calling sqldatadapter.fill to fill a local scoped dataset. If I go over to sql server and delete a row from my table my call to fill the dataset…
TWood
  • 2,563
  • 8
  • 36
  • 58
-1
votes
1 answer

SQL update command not working

I have created a web page in Asp.net website. The following page load will run as it gets arguments from previous page. The page also has an option for editing the contents and updating in database. But when the button(save) is clicked it doesn't…
Chetan Goenka
  • 1,209
  • 2
  • 11
  • 17
-1
votes
1 answer

Work with multiple values from sql

i have this sql command: SqlCommand cmd = new SqlCommand(); SqlConnection con = new SqlConnection(connectionstring); cmd = new SqlCommand("SELECT PROCEDURA,DAY_SEND,EMAIL FROM FASTREPORT_SEND WHERE.....", con); Output from this is for example…
Kate
  • 372
  • 2
  • 11
  • 24
-1
votes
1 answer

delete procedure not call in sqldataadapter.Deletecommand in mvc3 razor

i creat an accounting application in mvc3. i have journal voucher form in it.in this form master and detail data is on single view.i use html table and text boxes in html table for create my grid.I saved my data into sql server 2008 r2 database in 2…
andrina churia
  • 173
  • 1
  • 13
-2
votes
2 answers

Error Trying To Fill Data Table

This is my syntax, but I get an error of The SelectCommand property has not been initialized before calling 'Fill'. what do I need to do in order to be able to fill the data table? using (SqlConnection conn = new…
-3
votes
3 answers

c# Cannot implicitly convert type System.data.sqlclient.sqldatareader to system.data.sqlclient.sqldatadapter

It Says I Cannot implicitly convert type System.Data.SqlClient.SqlDataReader to System.Data.SqlClient.SqlDataAdapter:
stxy
  • 13
  • 4
1 2 3
29
30