Wrox Programmer Forums
|
BOOK: Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services
This is the forum to discuss the Wrox book Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services by Brian Knight, Devin Knight, Mike Davis ISBN: 978-0-470-49692-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 9th, 2010, 01:47 PM
Registered User
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default C# Instead of VB.NET

I'd like to use C# in place of VB.NET for the examples in the book and not sure how to reference the User variables that are set up in the examples. Below is the code from Lesson 9. What would be the C# equivalent of Dts.Variables("strInt").Value, for example? Thanks much in advance.


If Dts.Variables("strInt").Value > 10 Then
Dts.Variables("strVar").Value = "Big"
Else
Dts.Variables("strVar").Value = "Small"
End If
MsgBox(Dts.Variables("strVar").Value)

Dts.TaskResult = ScriptResults.Success
 
Old September 15th, 2010, 02:41 AM
Registered User
 
Join Date: May 2008
Posts: 8
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to samdoss Send a message via Yahoo to samdoss
Default

What is mean by Dts?
 
Old September 22nd, 2010, 06:50 PM
GHF GHF is offline
Registered User
 
Join Date: Sep 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Bump...

I'd like this information as well...

Quote:
Originally Posted by Arthur casale View Post
I'd like to use C# in place of VB.NET for the examples in the book and not sure how to reference the User variables that are set up in the examples. Below is the code from Lesson 9. What would be the C# equivalent of Dts.Variables("strInt").Value, for example? Thanks much in advance.


If Dts.Variables("strInt").Value > 10 Then
Dts.Variables("strVar").Value = "Big"
Else
Dts.Variables("strVar").Value = "Small"
End If
MsgBox(Dts.Variables("strVar").Value)

Dts.TaskResult = ScriptResults.Success
 
Old September 23rd, 2010, 02:36 AM
Registered User
 
Join Date: May 2008
Posts: 8
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to samdoss Send a message via Yahoo to samdoss
Default Place of C#

Hi,
use instead of () - []
("strInt") --- ["strInt"]

MessageBox.Show(Dts.Variables["strVar"].Value)

By

Samdoss. J
The Following User Says Thank You to samdoss For This Useful Post:
GHF (September 23rd, 2010)
 
Old September 23rd, 2010, 09:23 AM
GHF GHF is offline
Registered User
 
Join Date: Sep 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Thanks

Hi Samdoss,

I appreciate the response. I did figure that out last night, but I also had to convert Dts.Variables["intVar"].Value to an integer in the 1st "if statement" to get it to work. If I didn't convert intVar to an int then I was getting the error that you can't compare an object and an int.

Does that sound right or am I missing something?

Thanks
Glenn
 
Old January 5th, 2011, 10:07 PM
Registered User
 
Join Date: Jan 2011
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can anyone post a working for this project in C sharp? Reading all your posts on this I tried the same code in c sharp with my limited knowledge and I just could not get it working. If anyone has figured it out, please share your knowledge
 
Old January 6th, 2011, 06:01 AM
Registered User
 
Join Date: May 2008
Posts: 8
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to samdoss Send a message via Yahoo to samdoss
Default Hi domino,

I like to know about your problem. Please explain clearly.

Regards,

Samdoss J
 
Old January 6th, 2011, 03:27 PM
Registered User
 
Join Date: Jan 2011
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default

public void Main()
{

if(Convert.ToString(Dts.Variables["intVar"].Value) > 10)


{

(Dts.Variables["strVar"].Value) = "Big";
}

else
{
(Dts.Variables["strVar"].Value) = "Small";




}
MessageBox.Show(Dts.Variables["strVar"].Value);




Dts.TaskResult = ScriptResults.Success;
}

}

This is what I was trying my best to change to C sharp from my limited knowledge but I was unsucessful
 
Old March 18th, 2011, 06:30 AM
Registered User
 
Join Date: Mar 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the top using System.Windows.Forms;

In the public void main()
if (Convert.ToInt32(Dts.Variables["intVar"].Value) > 10)
{
Dts.Variables["strVar"].Value = "Big";
}
else
{
Dts.Variables["strVar"].Value = "Small";
}

MessageBox.Show(Dts.Variables["strVar"].Value.ToString());

Dts.TaskResult = (int)ScriptResults.Success;





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.NET 2003 Appendix B convert to VB 2008 Express Edition brucechess BOOK: Beginning VB.NET Databases 10 February 5th, 2009 12:52 PM
vb.net 2008 re: VB.NET databases book bigbearjeff VB.NET 0 June 2nd, 2008 01:22 PM
VB.Net question on Windows VB.Net datagrids dmsousa VS.NET 2002/2003 1 January 19th, 2005 02:45 PM
vb.net 2002 OR vb.net 2003 metalaaron VB.NET 2002/2003 Basics 0 August 5th, 2003 10:00 AM
vb.net 2002 - vb.net 2003 book metalaaron Wrox Book Feedback 0 August 2nd, 2003 10:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.