Dataset.Tables.Count=0 Where There Are 2 Rows In The Dataset.
May 7, 2008
Hi,
I have a stored procedure attached below. It returns 2 rows in the SQL Management studio when I execute MyStorProc 0,28. But in my program which uses ADOHelper, it returns a dataset with tables.count=0.
if I comment out the line --If @Status = 0 then it returns the rows. Obviously it does not stop in
if @Status=0 even if I pass @status=0. What am I doing wrong?
Any help is appreciated.
ALTER PROCEDURE [dbo].[MyStorProc]
(
@Status smallint,
@RowCount int = NULL,
@FacilityId numeric(10,0) = NULL,
@QueueID numeric (10,0)= NULL,
@VendorId numeric(10, 0) = NULL
)
AS
SET NOCOUNT ON
SET CONCAT_NULL_YIELDS_NULL OFF
If @Status = 0
BEGIN
SELECT ......
END
If @Status = 1
BEGIN
SELECT......
END
View 4 Replies
ADVERTISEMENT
May 26, 2015
I have a report with multiple datasets, the first of which pulls in data based on user entered parameters (sales date range and property use codes). Dataset1 pulls property id's and other sales data from a table (2014_COST) based on the user's parameters. I have set up another table (AUDITS) that I would like to use in dataset6. This table has 3 columns (Property ID's, Sales Price and Sales Date). I would like for dataset6 to pull the Property ID's that are NOT contained in the results from dataset1. In other words, I'd like the results of dataset6 to show me the property id's that are contained in the AUDITS table but which are not being pulled into dataset1. Both tables are in the same database.
View 0 Replies
View Related
Oct 1, 2015
I have a small number of rows in a dataset, Table 1. There is a CLOB on a large dataset, Table 2. They join on a PK. I would like to retrieve this CLOB and add it to the data flow for Table1. In short I want to emulate the following:
Table 1: Small table without CLOB, 10 rows.
Table 2: Large table with CLOB, 10,000,000 rows
select CLOB
from table2
where pk = (select pk from table1)
I want this to return the CLOBs for the small number of rows in Table 1. The PK is indexed obviously so it should be a fast look up.
Table 1 and Table 2 live on different Oracle databases. How do I perform this operation efficiently in SSIS? It seems the Lookup and Merge Join wont do this.
View 2 Replies
View Related
May 27, 2015
I have a report with multiple datasets, the first of which pulls in data based on user entered parameters (sales date range and property use codes). Dataset1 pulls property id's and other sales data from a table (2014_COST) based on the user's parameters.
I have set up another table (AUDITS) that I would like to use in dataset6. This table has 3 columns (Property ID's, Sales Price and Sales Date). I would like for dataset6 to pull the Property ID's that are NOT contained in the results from dataset1. In other words, I'd like the results of dataset6 to show me the property id's that are contained in the AUDITS table but which are not being pulled into dataset1. Both tables are in the same database.
View 3 Replies
View Related
May 21, 2007
I found out the data I need for my SQL Report is already defined in a dynamic dataset on another web service. Is there a way to use web services to call another web service to get the dataset I need to generate a report? Examples would help if you have any, thanks for looking
View 2 Replies
View Related
Feb 15, 2008
I'm using strongly typed datasets. Not I want to get a single number, say the number of males, instead of a table or rows. How can I do that?Diane
View 2 Replies
View Related
Oct 12, 2007
Is there any way to display this information in the report?
Thanks
View 3 Replies
View Related
Oct 31, 2014
Consider following script
create table data_set (id int primary key, col1 varchar(10))
go
insert into data_set values (1,'a'), (2,'b'),(3,'c'),(4,'d'),(5,'a'),(6,'b'),(7,'e'),(8,'f'),(9,'a'),(10,'a')
select * from data_set
I tried this below
Declare @child_ids int
@col_val varchar
@count int
select @child_ids, @col_val, @count, count(col1) as records from data_set
group by col1
order by col1
But I want my output like below .....
View 2 Replies
View Related
Feb 15, 2007
Hello Team
i want to insert more than one row to the dataset before update the sqladapter for ex i want to insert rows for orderlines then i send them all to sql by updating adapter
is it done by javascript ? because when i press the button a postback hapend then it clears the dataset so the new row clears the old one
any idea Thanks lot
View 1 Replies
View Related
Apr 11, 2008
i have two datasets.one dataset have old data from some other database.second dataset have original data from sql server 2005 database.both database have same field having id as a primary key.i want to transfer all the data from first dataset to new dataset retaining the previous data but if old dataset have the same id(primary key) as in the new one then that row will not transfer.
but if the id(primary key) have changed values then the fields updated with that data.how can i do that.
View 4 Replies
View Related
Dec 19, 2006
Hi,
I have two datasets in my report, D1 and D2.
D1 is a list of classes with classid and title
D2 is a list of data. each row in D2 has a classid. D2 may or may not have all the classids in D1. all classids in D2 must be in D1.
I want to show fields in D2 and group the data with classids in D1 and show every group as a seperate table. If no data in D2 is available for a classid, It shows a empty table.
Is there any way to do this in RS2005?
View 2 Replies
View Related
Jan 9, 2006
I am using ASP.NET 2.0 WebForms and I was trying to use a DataSet to add rows programatically without adding the actual records to the MS SQL Server Databases. Is this possible or should I be doing this another way?
DataSet myDS = new DataSet();DataTable myTable = new DataTable("table1");myTable.Columns.Add("col1", typeof(string));myDS.Tables.Add(myTable);myTable.Rows.Add("MyValue");
Thanks.
View 1 Replies
View Related
Aug 16, 2006
Hi,
is there anyway to insert all the rows from a dataset to SQL Server table in a single stretch..
Thanks
Anz
View 1 Replies
View Related
Feb 11, 2004
hI,
I am using visual c# 2003 and sqlserver 2000 and i am trying to query a column in the sql server and store it into a dataset but i got an error msg:
The number of rows for this query will output 90283 rows.
--------------------------------------------------------------------------------
Query :
SELECT L_ExtendedPrice, COUNT (*) AS Count FROM LINEITEM GROUP BY L_ExtendedPrice ORDER BY Count DESC";
---------------------------------------------------------------------------------
Error msg :
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
----------------------------------------------------------------------------------
is there a limit to the number of rows a dataset can store?
View 5 Replies
View Related
Feb 7, 2008
All,
I'm getting a strange error in SSRS when there is no data returned from a OLEDB datasource.
Here are the steps to simulate the error
1. Create 2 shared datasources to the Adventure Database - one using ADO MD provider (Microsoft SQL Server Analysis Services (AdomdClient)) and another using OLEDB (OLEDB 9.0 for Analysis Services)
2. Create a new report and create a dataset with the ADO-MD provider and copy and paste the below query. (This query will not return any data)
SELECT NON EMPTY [Measures].[End of Day Rate] ON 0 ,NON EMPTY {[Date].[Date].&[10000]} ON 1 FROM [Adventure Works]
3. Run report. It will be blank as nothing is defined in the layout. But this shows that the query is executed in the dataset and is succesfull although the query does not return any data.
4. Create another report and create a dataset with the OLE-DB provider and copy paste the above query.
5. Run the report. It will come back with error in the lines of "Object reference not set to an instance of an object". The reporting services log file will show that the query execution has failed although this is not the case when analysed from profiler.
Any ideas on how to solve this? What I'm trying to acheive is to use the NoRows property of table to display a message when there is no data. But I'm not able to pass the above hurdle when no data is returned from the dataset.
Thanks in advance.
Arun.
View 1 Replies
View Related
Jan 12, 2007
I have a dataset that when run returns 270 rows. The table using the dataset in the report only prints the first row. I have the table grouped by a status type, but this is for when I can get multi-select paramenters installed and working. For now I just need the report to print all the returned rows. Help!!
Thanks!
Terry
View 1 Replies
View Related
Jul 6, 2015
I created a data set using SP. in ssms SP gets all records but in ssrs i am not able to get all records, getting only 5 row.
View 4 Replies
View Related
Apr 18, 2007
Ok, I've spent a good amount on time on debugging an unupdating scenario in my application. Finally I knew the reason which is very annoying. Either I'm missing something really obvious (I hope so,) or this is a bug.
to reproduce what I'm talking about:
1- create a new win forms application using VS2005 sp1
2- add some SQL Compact Edition data file that have some records from the data menu, you'll get the designer to generate the dataset and everything..
3- drag a table from the data sources window, you'll get the data grid and the navigator on the form
4- add a button and have this in the click event handler:
datasetname.Clear();
TableAdapterName.Update(datasetname);
launch the program, click the button, you'll see the grid get wiped out as it supposed to do. close the program and relaunch. the data is there again (this has nothing to do with the copy always, copy if newer infamous stupidity)
now:
5- edit the click event handler and change it so something like this:
foreach (datasetname.TableRow row in datasetname.Table)
{
row.Delete();
}
TableAdapterName.Update(datasetname);
Launch the program, hit the button, grid wiped out. exit and relaunch. You'll see no data (i.e. the update on table adapter worked alright)
You can also try the GetChanges method on the dataset rightafter you use the clear method and you'd get no deleted records at all.
So, in 100,000+ records dataset, if i need to wipe the thing out and add some new records do i have to loop over every record and call delete (which will take LOTS of time).
I do hope that I'm missing something obvious.
Any help would be highly appreciated.
Thanks.
View 1 Replies
View Related
Sep 3, 2015
Using this IIF statement:
=CountDistinct(IIF(Fields!Released_DT.Value = Fields!Date2.Value, Fields!Name.Value,
Nothing))
Released_DT = a date - 09/03/2015 or 09/02/2015
Date2 = returns another date value in this case 09/03/2015
What I'm trying to do is: count distinct number of people (Fields!Name.Value) if the Relased_DT = Date2.My IIF statement is returning a zero value.
View 4 Replies
View Related
Mar 13, 2007
When i click upload image button when my database table has no any row, the selected image is saved(one row saved in table). If i continue and select a different image, i get no error sa if the image has been saved but when i view the images i have been saving, its strange even if i saved 10 records they all contain the first image that i saved. In short only the first image is saved the rest of the rows are just duplicates of the first row. so it basically becomes a table of ten rows but with same data rows(same image). Code is below.
Protected Sub btnupload_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim intLength As Integer
Dim arrContent As Byte()
If FileUpload.PostedFile Is Nothing Then
Lblstatus.Text = "No file specified."
Exit Sub
Else
Dim fileName As String = FileUpload.PostedFile.FileName
Dim ext As String = fileName.Substring(fileName.LastIndexOf("."))
ext = ext.ToLower
Dim imgType = FileUpload.PostedFile.ContentType
If ext = ".jpg" Then
ElseIf ext = ".bmp" Then
ElseIf ext = ".gif" Then
ElseIf ext = "jpg" Then
ElseIf ext = "bmp" Then
ElseIf ext = "gif" Then
Else
Lblstatus.Text = "Only gif, bmp, or jpg format files supported."
Exit Sub
End If
intLength = Convert.ToInt32(FileUpload.PostedFile.InputStream.Length)
ReDim arrContent(intLength)
FileUpload.PostedFile.InputStream.Read(arrContent, 0, intLength)
If Doc2SQLServer(txtTitle.Text.Trim, arrContent, intLength, imgType) = True Then
Lblstatus.Text = "Image uploaded successfully."
Else
Lblstatus.Text = "An error occured while uploading Image... Please try again."
End If
End If
End Sub
Protected Function Doc2SQLServer(ByVal title As String, ByVal Content As Byte(), ByVal Length As Integer, ByVal strType As String) As Boolean
Try
Dim cnn As Data.SqlClient.SqlConnection
Dim cmd As Data.SqlClient.SqlCommand
Dim param As Data.SqlClient.SqlParameter
Dim strSQL As String
strSQL = "Insert Into Images(imgData,imgTitle,imgType,imgLength,incident_id) Values(@content,@title,@type,@length,@incident_id)"
Dim connString As String = "Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|safetydata.mdf;Integrated Security=True;User Instance=True"
cnn = New Data.SqlClient.SqlConnection(connString)
cmd = New Data.SqlClient.SqlCommand(strSQL, cnn)
param = New Data.SqlClient.SqlParameter("@content", Data.SqlDbType.Image)
param.Value = Content
'cmd.Parameters.AddWithValue(param)
cmd.Parameters.AddWithValue("@content", Content)
param = New Data.SqlClient.SqlParameter("@title", Data.SqlDbType.VarChar)
param.Value = title
cmd.Parameters.Add(param)
param = New Data.SqlClient.SqlParameter("@type", Data.SqlDbType.VarChar)
param.Value = strType
cmd.Parameters.Add(param)
param = New Data.SqlClient.SqlParameter("@length", Data.SqlDbType.BigInt)
param.Value = Length
cmd.Parameters.Add(param)
cmd.Parameters.AddWithValue("@incident_id", id.Text)
cnn.Open()
cmd.ExecuteNonQuery()
cnn.Close()
Return True
Catch ex As Exception
Return False
End Try
End Function
View 1 Replies
View Related
Aug 23, 2006
Hi,
Is it possible to populate a dataset with tables returned by a stored proc?Consider this:
BEGINSELECT * FROM Table1SELECT * FROM Table2SELECT * FROM Table3END
If that is my stored proc, could I call it from a page and automatically populate a dataset with all 3 tables (if yes, then how?), or would I have to make 3 seperate calls to the db for each table?
Thanks
View 2 Replies
View Related
Dec 25, 2006
Hi,
I have a stored proc which returns multiple result sets. These results sets I am capturing using a strongly typed dataset which in turn I am using to display in the code. My dataset will have 5 tables. However when I run the code only 3 tables get populated and the remaining 2 gets no data.
I have seen the problem earlier and could not resolved it. Please let me know if any one can help.
Thanks in advance
Rohit
View 3 Replies
View Related
Jun 4, 2007
Stepping thru the code with the debugger shows the dataset rows being deleted.
After executing the code, and getting to the page presentation. Then I stop the debug and start the
page creation process again ( Page_Load ). The database still has the original deleted dataset rows.
Adding rows works, then updating works fine, but deleting rows, does not seem to work.
The dataset is configured to send the DataSet updates to the database. Use the standard wizard to create the dataSet.
cDependChildTA.Fill(cDependChildDs._ClientDependentChild, UserId); rowCountDb = cDependChildDs._ClientDependentChild.Count; for (row = 0; row < rowCountDb; row++) { dr_dependentChild = cDependChildDs._ClientDependentChild.Rows[0]; dr_dependentChild.Delete(); //cDependChildDs._ClientDependentChild.Rows.RemoveAt(0); //cDependChildDs._ClientDependentChild.Rows.Remove(0); /* update the Client Process Table Adapter*/ // cDependChildTA.Update(cDependChildDs._ClientDependentChild); // cDependChildTA.Update(cDependChildDs._ClientDependentChild); }
/* zero rows in the DataSet at this point */ /* update the Child Table Adapter */ cDependChildTA.Update(cDependChildDs._ClientDependentChild);
View 1 Replies
View Related
Jul 13, 2007
Hi
I have a dataset with 2 columns, a rownumber and a servername - eg
rownumber servername
1 server1
2 server2
....
15 server15
I want to display the servernames in a report so that you get 3 columns - eg
server1 | server2 | server3
server4 | server5 | server6
...
server13 | server14 | server15
I have tried using multiple tables and lists and filtering the data on each one but this then makes formating very hard - i either end up with a huge gap between columns or the columns overlap
I have also tried using a matrix control but cant find a way to do this.
Does anybody know an easy way to do this? The data comes from sql 2005 so i can use a pivot clause on the dataset if somebody knows a way to do it this way. The reporting service is also RS2005
Thanks
Anthony
View 1 Replies
View Related
Sep 26, 2006
ok. the problem: some tables are empty, so i can't be sure why some are updating at the DB and some arent.
I have manually picked thru every line of the xml that i'm reading into the dataset here, and it is fine, data is all valid and everything.
the tables i'm most worried about are bulletins and surveys, but they all have to be imported from my upload, the code steps thru just fine and I've been thru it a million times. Did I miss something in my dataadapter configuration?. 'daBulletin ' Me.daBulletin.ContinueUpdateOnError = True Me.daBulletin.DeleteCommand = Me.SqlDeleteCommand17 Me.daBulletin.InsertCommand = Me.SqlInsertCommand17 Me.daBulletin.SelectCommand = Me.SqlSelectCommand25 Me.daBulletin.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "tblBulletin", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("BulletinID", "BulletinID"), New System.Data.Common.DataColumnMapping("ContractID", "ContractID"), New System.Data.Common.DataColumnMapping("Msg_Type", "Msg_Type"), New System.Data.Common.DataColumnMapping("DatePosted", "DatePosted"), New System.Data.Common.DataColumnMapping("Subject", "Subject"), New System.Data.Common.DataColumnMapping("B_Body", "B_Body"), New System.Data.Common.DataColumnMapping("I_Read_It", "I_Read_It"), New System.Data.Common.DataColumnMapping("DateRead", "DateRead")})}) Me.daBulletin.UpdateCommand = Me.SqlUpdateCommand16
here is my merge function: Private Function Merge(ByVal sFilename As String, ByVal User As String) As String
Dim connMerge As New SqlConnection(ConnectionString)
Dim dsNew As New dsBeetleTracks
Dim dsExisting As New dsBeetleTracks
Dim strResult As String
SetConnections(connMerge)
Dim idc As New System.Security.Principal.GenericIdentity(User)
Dim currentUser As BeetleUser = bu
dsNew.ReadXml(sFilename)
If currentUser.IsInRole("Admin") Or currentUser.IsInRole("QA") Then
If dsNew.tblBulletin.Count > 0 Then
daBulletin.Fill(dsExisting.tblBulletin)
dsExisting.Merge(dsNew.tblBulletin)
strResult += daHelipads.Update(dsExisting.tblBulletin).ToString + " Bulletins updated<br>"
End If
End If
If dsNew.tblHours.Count > 0 And (currentUser.IsInRole("Survey") Or currentUser.IsInRole("Admin")) Then
daHours.Fill(dsExisting.tblHours)
dsExisting.Merge(dsNew.tblHours)
strResult += daHours.Update(dsExisting.tblHours).ToString + " hours updated<br>"
End If
If dsNew.tblHeliPads.Count > 0 Then
daHelipads.Fill(dsExisting.tblHeliPads)
dsExisting.Merge(dsNew.tblHeliPads)
strResult += daHelipads.Update(dsExisting.tblHeliPads).ToString & " helipads updated "
End If
If dsNew.tblExpenses.Count > 0 Then
daExpenses.Fill(dsExisting.tblExpenses)
dsExisting.Merge(dsNew.tblExpenses)
strResult += daExpenses.Update(dsExisting.tblExpenses).ToString + " expenses updated<br>"
End If
If dsNew.tblPersons.Count > 0 And (currentUser.IsInRole("Survey") Or currentUser.IsInRole("FB") Or currentUser.IsInRole("Heli-burn")) Then
daPersons.Fill(dsExisting.tblPersons)
dsExisting.Merge(dsNew.tblPersons)
strResult += daPersons.Update(dsExisting.tblPersons).ToString + " persons updated<br>"
End If
If currentUser.IsInRole("Field") Then
daSurveys.SelectCommand.CommandText = "exec Surveys_Field_Select"
daSurveys.InsertCommand.CommandText = "exec Surveys_Field_Insert"
daSurveys.UpdateCommand.CommandText = "exec Surveys_Field_Update"
End If
If dsNew.tblSurveys.Count > 0 And (currentUser.IsInRole("Survey") Or currentUser.IsInRole("Field")) Then ' Or CurrentUser.IsInRole("Admin")) Then
daSurveys.Fill(dsExisting.tblSurveys)
dsExisting.Merge(dsNew.tblSurveys)
strResult += daSurveys.Update(dsExisting.tblSurveys).ToString + " surveys updated<br>"
End If
If dsNew.tblSurveyChecks.Count > 0 And (currentUser.IsInRole("QA") Or currentUser.IsInRole("Admin")) Then
daSurveyChecks.Fill(dsExisting.tblSurveyChecks)
dsExisting.Merge(dsNew.tblSurveyChecks)
strResult += daSurveyChecks.Update(dsExisting.tblSurveyChecks).ToString + " survey checks updated<br>"
End If
If dsNew.tblTreatments.Count > 0 And (currentUser.IsInRole("FB") Or currentUser.IsInRole("Heli-burn")) Then ' Or CurrentUser.IsInRole("Admin")) Then
daTreatments.Fill(dsExisting.tblTreatments)
dsExisting.Merge(dsNew.tblTreatments)
strResult += daTreatments.Update(dsExisting.tblTreatments).ToString + " treatments updated<br>"
End If
If dsNew.tblInternalQC.Count > 0 And (currentUser.IsInRole("FB") Or currentUser.IsInRole("Heli-burn") Or currentUser.IsInRole("Survey")) Then ' Or CurrentUser.IsInRole("Admin")) Then
daInternalQC.Fill(dsExisting.tblInternalQC)
dsExisting.Merge(dsNew.tblInternalQC)
strResult += daInternalQC.Update(dsExisting.tblInternalQC).ToString + " internalqc updated<br>"
End If
If dsNew.tblTreatmentChecks.Count > 0 And (currentUser.IsInRole("QA") Or currentUser.IsInRole("Admin")) Then
Try
daTreatmentChecks.Fill(dsExisting.tblTreatmentChecks)
dsExisting.Merge(dsNew.tblTreatmentChecks)
strResult += daTreatmentChecks.Update(dsExisting.tblTreatmentChecks).ToString + " treatment checks updated<br>"
Catch dbex As DBConcurrencyException
strResult += vbCrLf & dbex.Message
For x As Integer = 0 To dbex.Row.Table.Columns.Count - 1
strResult += vbCrLf & dbex.Row.GetColumnError(x)
Next
End Try
End If
If dsNew.tblHeliPiles.Count > 0 And (currentUser.IsInRole("Heli-burn")) Then ' Or CurrentUser.IsInRole("Planner")CurrentUser.IsInRole("QA") Or CurrentUser.IsInRole("Admin") Or
daHeliPiles.Fill(dsExisting.tblHeliPiles)
dsExisting.Merge(dsNew.tblHeliPiles)
strResult += daHeliPiles.Update(dsExisting.tblHeliPiles).ToString + " piles updated<br>"
End If
If dsNew.tblHeliCycles.Count > 0 And (currentUser.IsInRole("Heli-burn")) Then ' CurrentUser.IsInRole("Planner") Or Or CurrentUser.IsInRole("Admin")) Then
daHeliCycles.Fill(dsExisting.tblHeliCycles)
dsExisting.Merge(dsNew.tblHeliCycles)
strResult += daHeliCycles.Update(dsExisting.tblHeliCycles).ToString + " cycles updated<br>"
End If
If dsNew.tblHeliTurns.Count > 0 And (currentUser.IsInRole("Heli-burn")) Then 'CurrentUser.IsInRole("Admin") Or CurrentUser.IsInRole("Planner") Or
daHeliTurns.Fill(dsExisting.tblHeliTurns)
dsExisting.Merge(dsNew.tblHeliTurns)
strResult += daHeliTurns.Update(dsExisting.tblHeliTurns).ToString + " turns updated<br>"
End If
If dsExisting.HasChanges Then
dsExisting.Merge(dsNew)
End If
dsExisting.AcceptChanges()
'duh.
'If dsNew.HasChanges Then
' dsNew.AcceptChanges()
'End If
If dsExisting.HasErrors Then
Dim bolError As Boolean
Dim tempDataTable As DataTable
bolError = True
strResult += "<br>"
For Each tempDataTable In dsExisting.Tables
If (tempDataTable.HasErrors) Then
strResult += PrintRowErrs(tempDataTable)
End If
Next
End If
dsNew.Dispose()
dsExisting.Dispose()
connMerge.Close()
'edebugging will only track strresult
Dim fsError As New FileStream(Server.MapPath("./incoming/error.txt"), FileMode.Create, FileAccess.Write)
Dim swError As New StreamWriter(fsError)
swError.WriteLine("--==ERROR LOG==--")
swError.WriteLine(Now.Date.ToShortDateString)
swError.WriteLine("-----------------")
swError.WriteLine(strResult)
swError.Close()
fsError.Close()
Return strResult
End Function
View 2 Replies
View Related
Dec 2, 2015
I am having difficulties with what seems to be a common issue. I want to produce a trial balance. The first row of the tablix would include fields: AccountNo, Description and startingbalance from a dataset called tb. Below that, I would like to draw from a dataset called Entries with multiple rows having fields: AccountNo, Desc1, Desc2, Debit, Credit and Balance. Balance in the Entries table is already computed from the starting balance and the entries above. There are many AccountNo's with corresponding entries.
How do I do this?
View 4 Replies
View Related
Feb 24, 2006
Hi,
I have an application where I'm filling a dataset with values from a table. This table has no primary key. Then I iterate through each row of the dataset and I compute the value of one of the columns and then update that value in the dataset row. The problem I'm having is that when the database gets updated by the SqlDataAdapter.Update() method, the same value shows up under that column for all rows. I think my Update Command is not correct since I'm not specifying a where clause and hence it is using just the value lastly computed in the dataset to update the entire database. But I do not know how to specify a where clause for an update statement when I'm actually updating every row in the dataset. Basically I do not have an update parameter since all rows are meant to be updated. Any suggestions?
SqlCommand snUpdate = conn.CreateCommand();
snUpdate.CommandType = CommandType.Text;
snUpdate.CommandText = "Update TestTable set shipdate = @shipdate";
snUpdate.Parameters.Add("@shipdate", SqlDbType.Char, 10, "shipdate");
string jdate ="";
for (int i = 0; i < ds.Tables[0].Rows.Count - 1; i++)
{
jdate = ds.Tables[0].Rows[i]["shipdate"].ToString();
ds.Tables[0].Rows[i]["shipdate"] = convertToNormalDate(jdate);
}
da.Update(ds, "Table1");
conn.Close();
-Thanks
View 4 Replies
View Related
Aug 9, 2006
I used a function to create dataset as below:
Public Function GetSQLDataSet(ByVal SQL As String) As DataSet
......
MyConnection = New SqlConnection(MyConnectionString)
MyCommand = New SqlCommand(SQL, MyConnection)
MyDataSet = New DataSet
MySQLDataAdapter = New SqlDataAdapter(MyCommand)
MySQLDataAdapter.Fill(MyDataSet)
......
End function
It works fine.
How to code a function to return a dataset in which there are two tables and relationship?
View 1 Replies
View Related
Jul 13, 2007
string fileName = "d:\shiporder.xml";
DataSet dataSet = new DataSet();
dataSet.ReadXML(fileName);
//connection string
string cmd = "INSERT INTO Orders (OrderID, OrderPerson) VALUES (dataSet.Tables[0].Row[0][0].ToString(),dataSet.Tables[0].Row[0][1].ToString);
SqlConnection con = new SqlConnection(conection string);
SqlCommand mycmd = new SqlCommand(cmd,con);
con.Open();
mycmd.ExecuteNonQuery();
con.Close();
it gives me this error
dataSet.Tables its not permitted in this context. valid expression are constants, constant expression, . Columns name are not permitted
View 2 Replies
View Related
Dec 26, 2007
Hi,
I have a little question. I searched google, and could not find good answer for this one.
I have a stored procedure that returns two tables. Usually I generate a dataset out of a stored procedure by dragging it to the dataset.
When I drag this one it creates a DS with only one table, the first one. How can I make it use both tables?
Thank you.
View 2 Replies
View Related
Jul 27, 2015
Need to change a Excel report to SSRS.
Excel report has around 15 tables all with different columns.
Is there a way , I can show all data in SSRS by avoiding creation of 15 datasets and 15 tables.
Note -- All 15 tables have differnt columns list.
View 3 Replies
View Related
Sep 13, 2007
Hi,
I want to design a report in which it will contain fields derived from 2 different stored procedures. I understand a 'table' can display data from a single dataset. How can i bind these two stored procedures into a single dataset so as when i click on the table and use its property 'DataSetName', to be able to select the dataset which holds all columns from stored proc 1 and stored proc 2. How can i link multible tables ( multible stored procedures with different column names in each one) into a single dataset to feed the report?
Thank you
George
View 1 Replies
View Related
Jul 13, 2015
I have OLE Db data source (SQL Server 2008) with 5 rows. One of the column in claimID. Another data source is IBM DB2 Iseries database. The table in DB2 has 93 million rows. I need to get only rows from DB2 table where ClaimID matces to OLE DB datasource dataset. In fact its just inner join but in two different serves. How do I create new dataset from these two tables in SSIS. I tried using Lookup transformation. I cannot use OLE DB as datasource for DB2.
View 5 Replies
View Related