Generating Strong Typed DataSet From An SP That Returns Two Tables.

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


ADVERTISEMENT

How To Use Aliases In Typed Dataset

Jun 27, 2007

I have a SELECT query with an alias in it.
The intellisense shows all field except the alias one.
What goes wrong?

View 2 Replies View Related

Parameter For Where In (@Par1) In Typed Dataset

Aug 21, 2007

Hi,
 Is there any work around to passing a set of strings to a parameter in a Typed Dataset for example I am pasing '4226222172004','4212012182004' which I build on my code the number of items will vary passed on the user selection but since the Typed Dataset uses sp_executesql and the parameters are change to '''4226222172004'',''4212012182004'''
 Any ideas how I can format the Parameter I am passing.so that it will end like where in ( '4226222172004','4212012182004') instead of where in ('''4226222172004'',''4212012182004''') I again the number of parameters will very.
Thanks
Julio D

View 1 Replies View Related

Strongly Typed Dataset To SQL File

Nov 23, 2004

I have a strongly-typed that I fill w/in my app, then use the dataset to insert rows into a SQL table.

3 fields look like this:
RegHrs - decimal
OTHrs - decimal
TotHrs - decimal

When I insert the fields using parameters, the params look like this:
paramValues(10) = New SqlParameter("@RegHrs", SqlDbType.Decimal)
paramValues(11) = New SqlParameter("@OTHrs", SqlDbType.Decimal)
paramValues(12) = New SqlParameter("@TotHrs", SqlDbType.Decimal)

The fields in the SQL table are defined as:
RegHrs - decimal (9,2)
OTHrs - decimal (9,2)
TotHrs - decimal (9,2)

Before I insert the row (from w/in the VB code), I stop the code and verify that the values being placed into the params are:
5.85
0
5.85

After the SQL insertion, the values w/in the SQL Table contain:
6
0
6

What am I missing?????

Thanx
JerryK

View 3 Replies View Related

Typed Dataset Failed To Enable Constraints

Sep 11, 2006

Hi, I am  trying to use a typed dataset created using the Query builder which returns the data correctly when I use 'Execute Query' in query builder but as soon as I attempt to return a dataset using the GetData method created I get the following error:         Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Which is not very helpful, any ideas where the problem may be? I have tried switching off enforce constraints and setting the NullValue property of all strings to 'Emtpy' bu that has no effect. Thanks in advance 

View 2 Replies View Related

Typed Dataset Schema Throwing Error

Apr 8, 2006

Hello,I'm using a typed dataset to access my database (SQL Express); I have a table that returns data, which two fields are null; I'm getting this error:{"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."}There are no foreign-key or unique key constraints, so it has to be a non-null issue; I changed the two fields in the table to have a null value of Empty instead of Throw Exception, but I don't understand what the problem is coming from...  I'm at a loss.Thanks.

View 2 Replies View Related

User-defined Types (UDT) In Typed Dataset

Dec 24, 2006

Hi!

I'm need to use typed Dataset with CLR UDT, but when I'm trying to create TableAdapter in Dataset designer, I'm gettng error message: User-defined data types are not supported in DataSet designer

Is any way to get it working?

My UDT defined in separate assembly as:

[Serializable]
[XmlRoot(Namespace = NS)]
[StructLayout(LayoutKind.Sequential)]
[SqlUserDefinedType(Format.Native, Name = DataType, IsByteOrdered = true, ValidationMethodName = "Validate")]
public struct Coordinate
: INullable,
IXmlSerializable
{
.....
}

Working environment: Visual Studio 2005 SP1, MS SQL 2005 SP1 + Hotfix.

View 2 Replies View Related

Insert Unicode Data Into The Database With Typed DataSet

Dec 11, 2006

Hi all,I am using a Strongly Typed DataSet (ASP.NET 2.0) to insert new data into a SQL Server 2000 database, types of some fields in db are nvarchar. All thing work fine except I can not insert unicode data(Vietnamese language) into db.I can't find where to put prefix N. Please help me!!!   

View 1 Replies View Related

CE 3.5, VS 2008, Typed Dataset: Get The Updated Identity Of Inserted Row

Sep 15, 2007



Hello,

Using VS 2008 Beta 2, SQL CE 3.5, on desktop, and Typed Datasets: The INSERT command of dataset table adapter does not return the updated identity of inserted row. Why?

also every time I want to modify the insert command to return the updated identity of inserted row, i get the error: "Unable to parse query text."


(Should I post this in Orcas forum?!)

Regards,
Parham.

View 5 Replies View Related

SQL Server CE 3.5, Typed Dataset, Retrieving @@IDENTITY Of Inserts?

Mar 19, 2008

I'm at loss how I'm supposed to work with typed datasets and Sql Server Compact 3.5, when inserting records and I need to update my datatables with the primary key of newly inserted rows.

I've tried adding a RowUpdated handler to all tableadapters that look like this:





Code Snippet
void Adapter_RowUpdated(object sender, System.Data.SqlServerCe.SqlCeRowUpdatedEventArgs e) {

if(e.Status == UpdateStatus.Continue && e.StatementType == StatementType.Insert) {

if(e.Row.Table.PrimaryKey.Length > 0) {
SqlCeCommand selectIdentityCommand = new SqlCeCommand("SELECT @@IDENTITY",e.Command.Connection);
if(e.Command.Connection.State == ConnectionState.Open) {

e.Row[e.Row.Table.PrimaryKey[0].Ordinal] = (int)selectIdentityCommand.ExecuteScalar();

}
}
}






I've previously used this type of approach when working with an OleDbDatabase, which works just fine. But it doesn't work with Sql Server CE 3.5, and since it doesn't support stored procedures I can't fix it that way either. And it doesn't support commands in a batch (i.e appending the Insert command of the adapter with ";SELECT @@IDENTITY") so that doesn't work either...

So how are we supposed to use Sql Server CE 3.5? It's impossible together with datasets? Or am I missing something obvious?

Any hints would be greatly appreciated! Thanks!

Cheers!

View 3 Replies View Related

Uploading A File To A SQL Database Via A Typed Dataset And Using The FileUpload Control.

Oct 2, 2006

I am trying to upload a file in ASP.net 2.0 to a SQL database using the FileUpload control. I am doing this by way of a typed dataset.Here is my code.Dim rta As New ResponseTableAdapterDim rdt As ResponseDataTable = rta.GetResponseByID(1)Dim rr As ResponseRow = rdt(0)Dim fs As New FileStream(fu.PostedFile.FileName, FileMode.Open, FileAccess.Read)Dim br As New BinaryReader(fs)Dim image() As Byte = br.ReadBytes(fs.Length)br.Close()fs.Close()rr.UploadFile = imagerr.NameFile = fs.Namerta.Update(rdt)The code runs without an error but afterwards I find that nothing has been stored in the UploadFile cell in the database but the file name has been stored in the NameFile cell in the database. Any ideas?Your help is much appreciated. James 

View 1 Replies View Related

How To Create An Update Or Delete Method In A Strongly Typed Dataset?

Mar 22, 2007

Like the subject says, I'm using strongly typed datasets.  I'm using to designer to create the datasets and the methods.  I can select and insert, but I can't update or delete.  I right click on the adapter bar and select Add Query.   I sleect 'Use SQL Statements'I select 'Update' (or 'Delete')I get a sql statement pane containing the word 'Update' ('Delete') and asking 'What data should the table load?'I can click on next, but anything else gives me errors.  I'd list them, but I'm clearly doing something wrong and it's probably obvious. Diane 

View 5 Replies View Related

Dataset Returns 0 Records

Feb 6, 2008

I am new to SSRS 2005 but find it to be a wonderful development tool. I discovered that when you run a report where the dataset returns no records the resulting report is blank as opposed to page header, table header, no data, and page footer. Is there a way to force these items to be displayed even when the dataset is empty? Or better yet is there a way to return a (custom) empty dataset message in place of the report body?

Thanks.

View 1 Replies View Related

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 View Related

Reporting Services :: SSRS Report Does Not Display Resultset Through Dataset Returns Resultset

Oct 10, 2012

I am creating a simple SSRS table report through Report Builder. My dataset is looking for the stored procedure . When I execute the Stored procedure through SSMS I get resutset for certain parameters. I execute the dataset  (Store procedure) through query designer in dataset properties and I get results back. But when I try to run the report and see the preview, I do not get any results displayed. I been looking on the same issue form last 3-4 days and have not found any clue.

Following is the stored procedure I am using. Also I am passing multivalued parameter through report as well, and I am using spilt function to seperate the libraryid I am reading from parameter values. This works fine. I have similar kind of four other reports and with different stored procedure which exactly follow the same method , like multivalue parameters and other criteria are also very similar. All other reports works just fine.. This perticular report has issue for displying results, following is the stored procedure I am using 

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

[code]....

View 4 Replies View Related

Generating Tables Programatically

Jun 7, 2008

hi i am trying to gernerate some tables ( first with a script and then with a stored procedure),, in ms server management studio exrress 2005 using the followingcreate table ip(    id int IDENTITY NOT NULL,    ip varchar(15) NOT NULL,    hostname varchar(128) NOT NULL,    primary key(id)) ; i store this in a new query (assume :right click associates the query to the current database ?) and run it and nothing happens  its been a while since i did sql but i think the sql is ok....how or more specifically where is the appropriate place to run this code  thankssimo  stored as a new query     

View 1 Replies View Related

Generating Scripts For All The Tables.

Sep 7, 2007

Hi ,
Can anyone help to generate scripts for all the tables in the db using Transact SQL.

Thank you

Necessity is the mother of all inventions!

View 12 Replies View Related

T-SQL (SS2K8) :: Generating One Table From Two Tables

Jan 14, 2015

There are two tables as below:

Table 1
IDValue
F001A,B,C
F002B,C,D
F003A,C

Table 2
IDValue
D001A
D002B
D003C
D004D

what is best way to generate one table as below:

New table
F001D001
F001D002
F001D003
F002D002
F002D004
F002D003
F003D001
F003D003

View 4 Replies View Related

Generating Scripts To Populate Tables

Jul 20, 2005

I would like to find a utility that can scan through an existing SqlServer 2000 database and create scripts to re-insert/re-populate thedata into another DB with the same table structures. Like a back-uputility.Can anyone recommend one (or tell me which ones to avoid)? Iwould like one that takes dependencies between tables intoconsideration.Thanks

View 1 Replies View Related

Copying Tables And Generating New Keys

May 23, 2007

I have a large table that I need to copy, but I need to generate a new value for my id field using a SPROC and replace my existing ID value. I also have a few mapping tables I need to copy, so I need to store this new ID for later use. I currently have a SPROC that performs all these actions, but it takes about 3 or 4 minutes to complete and completely hogs the CPU time. Thus, I can't perform any actions until it finishes.



I'm looking for a way to run this procedure in the background. Unfortunately, my ID field value is not a GUID nor an IDENTITY column. I've researched Integration Services, but I was unable to find any DataFlow Tranformations to call a SPROC to retreive a new id nor could I find anything that would let me store my new id to update my mapping tables. SQLBulkCopy wasn't a good solution either.



If anyone has any insight to this, it would be greatly appreciated. Thanks,

View 1 Replies View Related

Generating Full Script Tables And Data?

Feb 8, 2006

hi, I'm using sql server 2005 standard, and I want to be able to move my local database to another server, but I can't figure out how to script the database and the data so that I can just run one script to move the whole database. this can be done right? I can't imagine that such an obiviously necessary tool would be intentionally left out, so I'm figuring that I'm just a doofus and don't know where the option is...

can anyone help? thank you!
-SelArom

View 2 Replies View Related

Generating Scripts, Tables, Views, Procedures, Roles...

Aug 2, 2007

Hi...

I'm trying to generate scripts in SQL Server Management Studio 2005.

When I choose 'Script all objects' I get an error when I try to execute it. When I generate the scripts in single files, only tables in one file, only views in one file etc. etc., the execution is succeded.

1) Why do I get an error when I try to execute the script containing tables, views, procedures in one file....?

2) I get an error in the view-file where one column is 'invalid' but I can see it in the view. A generated script should execute succesfully when it is generated one second ago on the same database and so on... Right?

Thanks....

View 7 Replies View Related

SQL 2012 :: Generating CREATE TABLE Scripts For Large Number Of Tables

Feb 11, 2014

Other than right-clicking on each individual table in SSMS and generating a CREATE script, is there a simple way to generate CREATE TABLE scripts for tables within a given database?

Background: I have a bunch of tables in one database, and I would like to add tables to a second database that have the same names and basic structures of some of the tables from the first database.

I do not need to transfer any data from the tables, this is a seperate project that will use a similar data structure. I just want to generate the CREATE TABLE scripts for 30ish tables within the first database, and then I'll tweak the scripts as appropriate and run them against the new database.

[URL] ....

View 7 Replies View Related

Looking For Strong SQL Developers In Seattle

Sep 14, 1999

Hey,

I am looking for mid to senior level SQL developers for some sweet companies here in Seattle. A chance to work in a dynamic envirnoment with bleeding edge Microsoft technologies. Are you good? then we can help.

shoot me an e-mail.
patc@snowdogs.com

thanks
pat copeland
snowdogs

we are for the people.

View 1 Replies View Related

Generate A Strong Name Key File

May 22, 2006

I am a Newbie to programming and databases and would like to create a simple program for doing full text searching on a SQL database.

I have downloaded and installed Visual Basic 2005 Express, Web Developer 2005 Express, and SQL Server 2005 Express. I have watched several hours of video tutorials and done numerous tutorials. I feel I am making progress and having a lot of fun. My machine is running XP home edition.

I have found the following resource that looks like a good place for me to start with creating a full text search program:

€œSQL Server 2005 Books Online
Item Finder Sample
http://msdn2.microsoft.com/en-us/library/ms160844.aspx

However I am stuck at the beginning with trying to €œgenerate a strong name key file.€? I don€™t know how to €œopen a command prompt€? (I did confess to being a Newbie!!). I searched the database for this forum and found a relevant thread stating that €œSQLCMD is the command-line utility for SQL Server and is included with SQL Server 2005 Express Edition.€? I found the SQLCMD program on my computer but when I opened it, it does appear to provide the options listed below in the tutorial (i.e., €œclick start,€? €œPoint to all programs,€? etc.).

Initially here is what I need based on the first section of the tutorial:

Building the Sample

If you have not already created a strong name key file, generate the key file using the following instructions.

To generate a strong name key file

Open a Microsoft Visual Studio 2005 command prompt. ClickStart, point toAll Programs, point toMicrosoft .NET Framework SDK 2.0, and then clickSDK Command Prompt.

-- or --

Open a Microsoft .NET Framework command prompt. ClickStart, point toAll Programs, point toMicrosoft .NET Framework SDK 2.0, and then clickSDK Command Prompt.

Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed.
Note:
To determine the folder where samples are located, click theStartbutton, point toAll Programs, point toMicrosoft SQL Server 2005, point toDocumentation and Tutorials, and then clickSamples Directory. If the default installation location was used, the samples are located in <system_drive>:Program FilesMicrosoft SQL Server90Samples.

At the command prompt, run the following command to generate the key file:
sn -k SampleKey.snk

Important:
For more information about the strong-name key pair, see "Security Briefs: Strong Names and Security in the .NET Framework" in the .NET Development Center on MSDN.

How do I complete this initial step of generating a strong name key file for the tutorial? I guess I am missing something simple and once I get past this I will be able to complete the tutorial. Any help will be greatly appreciated.


View 7 Replies View Related

Populate Dataset With Multiple Tables

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

Dataset With Multiple Tables Is Not Getting Populated

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

Strong SA Pwd Needed To Install MSDE

Nov 1, 2006

Hi,My computer crashed and I have had to reinstall all the software.  However, when I try to reinstall MSDE (server), it keeps telling me a strong SA password is required and to use the SAPWD to switch it.  I cannot find SAPWD files or anyway to change this.  After I get this message, the installation process stops.  I didn't have this issue the first time I installed everything back in the beginning of September when the class started and before the computer crashed, I had no problem accessing a database using Web Matrix and the same server setup that I'm trying to install right now.If anyone can help me, I would be more than grateful.Thank youCarolyn (Crowbare) 

View 3 Replies View Related

STRONG SQL Server Blockings OR Deadlocks

Feb 23, 2005

Hello,

Got aprivate webserver with two main sites which generate maximum 800.000 pages vieweved a day...

these are running ASP and SQL Server 2000

FREQUENTLY, SQL Server doesn't respond and seems to be blocked, wich cause all my pages to be unreachable by the fact that my header file open a SQL connection in every page.

I've read a lot of documentation about SQL blocking or deadlocking but shame on me i don't really understand how to easily identify the reason of blocking and far more important, still don't kow the way to STOP these.

Is there a way to set a global parameter to STOP any SQL request wich is longer than 10 seconds let says... ?

I tried SET LOCK_TIMEOUT timeout_period but it seems we have to put it in EVERY transaction... not simple. Further more i tried it and it generated me a lot of errors (example : returning -1 for recordcounts after a request)...

Any help for a newbie SQL user to avoid these blocks ?

View 4 Replies View Related

SP3a And Strong Password Problem

Jul 23, 2005

I urgently need tom use SP3a upgrade the instance of SQLServer200MSDE runing on my local machine but I am having problems in doing so.My first problem is that when I start the set up procedure I get themessage"A strong SA password is required for security reasons. Please useSAPWD switch to supply the same"Currently the sa password isAbc/def/ghk1Which I think is a 'strong password' according to the microsoft rulesathttp://www.microsoft.com/resources/...sword_tips.mspxI would be grateful if someone could confirm that Abc/def/ghk1 is astrong password.If anyone could point me to some published informal help on installingSP3a then that would also be very helpful (I do of course have the MSread me file). If anyone has a sample command line entry for theupdating then I would find that extremely useful. There is oneinstance of MSDE on my machine, named NetSDK.Best wishes, John Morgan

View 6 Replies View Related

How Do I Disable Strong Password Required?..

Aug 12, 2006

how do I disable "strong password required"??? because I want to allow to add a user with the config-tool with no strong password

View 1 Replies View Related

Tables Not Being Written Back To DB From Dataset. I'm Going Nutz!

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

Reporting Services :: 2 Dataset Tables In One Matrix?

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







Copyrights 2005-15 www.BigResource.com, All rights reserved