Monday, October 26, 2009

Data Audit With SSIS(VS 2005/2008)

Hi,

Here are the steps required to perform sql data tables audit using SSIS
SSIS=SQL Server Integration Services.

Requirements:

1-SQL 2005/2008 Developer or Standard or Enterprise Edition
2-Visual Studio 2005/2008 Pro or Team edition.
3-Microsoft Office Word

Visual Studio Express editions do not work with SSIS.





Here is the link :Download It


Thank you for passing by!

Talley
.NET Developer,Raleigh,NC

New I am learning ROR(Ruby On Rails).Very special Language

Wednesday, September 30, 2009

Let see how to use Dictionary/SortedDictionary classes from System.Collections.Generic(C#)

Hi Readers,

Thank you again for your emails.I`ve been busy lately doing some code for my open source software i will be publishing next month.Again thank you for sending emails.I received 52 yesterday.

Today i will explain to you how to use these 2 classes Dictionary/SortedDictionary.

Dictonary

Step1:we have to import System.Collections.Generic:

using System.Collections.Generic;

Step2: we have to declare Dictionary object with new keyword


Dictionary dic = new Dictionary();


You have to remember that we are dealing with key/pair schema.

Step3:Now let`s add some items with Add(key,value) method


dic.Add(2000, "Talley");
dic.Add(10, "John");
dic.Add(200, "Sam");


Step4:Let`s use ContainsKey method to find values


if (dic.ContainsKey(2000))
{
string st = dic[10];
Console.WriteLine(st);
}
else
{
Console.WriteLine("No Match!");
}

You can also use ContainsValue method to query the Dictionay object.There are methods and
properties of Dictionay object you may have to take a look.
SortedDictionay and Dictonary classes have almost the same methods and properties except
SortedDictionay accepts ICompareras parameter like this:

SortedDictionary<string,int> sd=new SortedDictionary<string,int>(IComparer<string>();

SortedDictionary

In a SortedDictionary elements must be sorted when they are added, making insertion times slower.

Remember you could also link table columns to these Dictionay objects.

Thank you for stopping by.See you next time.
If you have any question concerning this post please feel free to send me email at
johnstalley@live.com

Talley
Software Developer,ISV
Raleigh,NC






Sunday, September 27, 2009

How to insert the result set of a store proc or dynamic batch into a new table using SELECT INTO?

Hi Readers,

Thank you for sending emails.I appreciate it.Now let do some coding.

Suppose you want to insert the result set of a store procedure or a dynamic batch into
a new table,but you do not know what the schema is that you need to create.
You can use SELECT INTO statement and OPENQUERY.Here is how it works:

1-SELECT INTO format

SELECT
INTO
FROM

ex:
SELECT CustomerID,CompanyName,Country
INTO US_Customers
FROM Northwind.dbo.Customers

NB Do not create US_Customers in Nort
hwind database before executing the query.This table
US_Customers is created automatically for you after query execution.

2-The main query of concern(see title)

EXEC sp_serveroption,'data access',true;
SELECT *INTO FROM OPENQUERY(,'EXEC {(

That`s all i want to share with you today.
See you!

Talley Ouro
.Net Developer(Web&Smart Client Development)
Email: johnstalley@live.com



Thursday, September 10, 2009

Adding NUnit Tool to any version of Visual Studio

Hi Readers,

Thank you for sending me emails.I appreciated it.
Here is easy way to integrate Unit framework to Visual Studio.

1-First download NUnit at http://www.nunit.org/index.php?p=home

2-Copy nunit.framework.dll to the bin section of your project.

3-Add this reference to you project by right clicking on the project and click add reference



Now the dll is referenced to your project you can start using NUnit framework.

4-Go to Tools/External Tools(this task add NUnit tool to your visual studio-design time)











Thank you for visiting my blog.

Talley Ouro
Application Developer
Raleigh,NC

Monday, September 7, 2009

How to load a document with JavaScript?

Hi Readers,

Thank you for sending me emails.I appreciate it.
Happy holiday to you and your families.

Here is a single function you can use to load a page:

function ViewDocument(strDocument)
{
strDocument = escape(strDocument);
if (strDocument != null) //or strDocument!=undefined
{
//window.open(strDocument,"resizable:yes;scroll:yes;status:no;");
window.open(strDocument);
}
else
{
alert("Document Unavailable");
}
}

Thank you for visiting my blog.

Talley
Web & Windows Developer
Raleigh,NC

Tuesday, September 1, 2009

How to animate images with JavaScript?

Hi Readers,

Here are steps required to animate images using javascript:


Step1:Download AnimateByTalley.js from downlad page of my blog

Step2: create a new web form,add 2 htlm buttons and one image.
Everything should look like this:

Step3: reference AnimateByTalley.js in the head section of your page or
you can just copy the scripts and add it your page




That`s all you need to animate image with JS.

Thank you for visiting.
If you have any question or concern please feel free to email me
at johnstalley@live.com

Talley Ouro
Web & Windows Application Developer
Raleigh,NC

Monday, August 31, 2009

CRUD operations with LINQ To SQL(ASP.NET 3.5)





Hi Readers,

Thank you for you emails.I appreciate it.
Here are some tips if you want to use LINK To SQL to select, insert,
delete and update known by CRUD.
I used ASP.NET AJAX web Template for this demo and VS 2008
Here are steps:

1-Add a new table called Users to Northwind database :

CREATE TABLE
[dbo].[Users](
[UserID] [int] IDENTITY(1,1) NOT NULL,
[UserName] [nvarchar](50) NOT NULL,
[Password] [nvarchar](50) NOT NULL,
[Email] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
(
[UserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]



2-Create ASP.NET AJAX web app and make sure ScriptMaster is in place(without it
ajax functionality=null).Make also sure that Ajax ToolKit controls are in place.
Drop Tab Container on the design surface with 4 tabs:
-Query Task tab: to query and show result on GridView control
-Insert Task tab : to insert new records .
-Update Task tab: to update records
-Delete Task tab: to delete record.



Copy the source code Demo.Zip



Here is how it works:



A-For Query Task:



The goal of this task is to load data into GridView control via a button control:



' This code will query all users where UserName is not null

Dim users=From usr In db.Users _

Where usr.UserName IsNot Nothing _

Select usr

'This code bind users data to GridView control



Me.GridView1.DataSource=users

Me.GridView1.DataBind()



B-For Insert Task:



'I defined a new User class and i used the column names

'you need With which allows you select column names

'after you type .(dot) inside {} column names will appear automatically



Dim u as New User With {.UserName=me.txtUserName,.PassWord=me.txtPassWord,.Email=me.txtEmail}



'Now submit result on Insert and Update table

db.Users.InsertOnSubmit(u)

db.SubmitChanges()



C-For Update Task:



'This section is little loosy

'I select users where UserID=upUserID.txt

'You need these parentheses to make it work

'You need to specifiy single meaning you are

'updating only a single row

'match columns again fields

'finally update user table



Dim u=(From usr In db.Users _

Where usr.UserID=me.upUserID.txt _

Select usr).Single

u.UserName=me.upUserName.text

u.PassWord=me.upPassWord.text

u.Email=me.upEmail.text



db.SubmitOnChanges()



D-Delete Task:



'Tricky too

Dim p1=db.Users.First(Function(p) p.UserID=me.delUserID.text

db.Users.DeleteOnSubmit(p1)

db.SubmitChanges()



Run app and if everything is ok you should see something like this:























About Me

My photo
Raleigh, NC, United States
I am a software developer based in Raleigh,NC,USA.I design softwares and systems ;i also do consulting for companies worldwide.I program with these languages:VB.NET 2003/2005/2008;C#;Java(fun),SQL(200,2005,2008);ASP.NET 2.0/3.5;ASP.NET AJAX;ASP.NET MVC;JavaScript;JQuery;Windows Workflow Foundation;Web Services.I have 4 years + in programming.