Monday, October 26, 2009

Data Audit With SSIS(VS 2005/2008)


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


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!

.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.


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("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>();


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

Software Developer,ISV

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 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;

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

Talley Ouro
.Net Developer(Web&Smart Client Development)

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

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

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
alert("Document Unavailable");

Thank you for visiting my blog.

Web & Windows Developer

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

Talley Ouro
Web & Windows Application Developer

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 :

[UserID] [int] IDENTITY(1,1) NOT NULL,
[UserName] [nvarchar](50) NOT NULL,
[Password] [nvarchar](50) NOT NULL,
[Email] [nvarchar](50) NOT NULL,
[UserID] ASC

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



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



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





D-Delete Task:

'Tricky too

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



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

Friday, August 28, 2009

Do you know the Best developers IDE?

Hi readers,
Thank you for your emails.I received 80 emails yesterday.
I appreciate it.

Here is the top 4 IDE for both .Net and Java Developers:

No1 Visual Studio 2008(Pro and Team Editions) from
Why No1? Because all is visual (windows& web apps) and it has robust
framework behind it.

No2 Netbeans IDE from,C++,Ruby,PHP,Python..)
It has all except the visual part is missing except Swing(Java)

No3 Eclipse IDE(Java) from

No4 Aptana Studio (Java,PHP,Ruby,Perl) from

There are still good IDE out there but these are the top one.

Thank you for reading.

Talley Ouro

Do you know which version of AJAX Toolkit to use for VS2005?

Hi readers,
Thank you for your emails.I appreciate it.

If you have Visual Studio 2005 and wonder which version of Ajax ToolKit
to use then i have the answer.
The version to use is 20229

You can download it directly on my downlaod page HERE
If you are having problem clik HERE

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

Thank you for visiting my blog!

Talley Ouro

Sunday, August 23, 2009

XScheduler will be release end September 2009 easten time.

XScheduler is an Advanced Document Management System,

Business Process System,Employee Task Management,Active

Directory Manager,Government Ressource Planning(GRP)

and more to come.

I published some screenshots from the program but these

screenshots are 1/200 of the screeshots and will be update

every friday.Thank you for reading and see you soon!

Talley Ouro,

Project Manager and Administrator


How to get the current Primary Key from GridView(ASP.NET 2.0/3.5)?

Hi Readers,

Thank you for your emails .I am very grateful to your emails.They help me
post more blogs even i am very busy debug codes.

Take a good look at this grid:

What if i want to update Documents table with this statement:

Update Documents SET Status='Active' WHERE DocumentID=Current selected row on gridview!!!!(Remember Document is a SQL Keyword)

Here are the easy way to do it(VB.NET):

Step1: fire RowCommand event from Gridview( ex GridView1_RowCommand ...Handles GridView1.RowCommand)

Step2: Use CommandName and CommandArgument properties

Ex commandname are :Edit,Update,Delete,Insert....
commandargument is used to find the primary key of currently select item on gridview

Here is the code within GridView1_RowCommand :

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand

Dim itm As Integer
If e.CommandName.Equals("Edit") Then

itm = Convert.ToInt32(e.CommandArgument) REM get primary key of selected row on gridview
REM your code goes here.Update() is a function with parameter named itm.
It goals is to update Documents table based on selected row on the grid.

End If

End Sub

That`s all i want to share with you today.
Any question or if you want private training a lower cost please send
me email at

Talley Ouro
.Net Developer(VB.NET,C#,PHP,ASP.NET 2.0/3.5)

Saturday, August 22, 2009

New To LINQ To SQL?Watch this video

Introduction to Windows Live Cloud Services

Hi readers,

All IT compagnies are moving from traditional computer systems into cloud computing.

The good news is Microsoft invested a lot into it.

As a programmer and a member of MSDN network i invested myself into this too.

I am working on a Business Process/Workflow program which will be published soon on and i need a chat control for the chart section of my project.I created a C# class library project which has all the functionality i needed for chat purposes.But i need something quick and fast.I have 1000 lines of code to review .So i checked Windows Live Services and i found a control that fit my need.

Here is a link to live service: link

To get started with Windows Live Controls(work both with VS 2005/2005) i precompile required bin on my download page .Copy Live Chat Bin here

Here are the steps:

Step1: Unzip Live Chat Bin and copy them into the bin section of your web project.

Step2: Open toolbox window from VS ,add a new tab and select choose items.Locate the ddl from step1 and click ok .You should see something like this:

Step 3:Drag any control from the list( i picked MessengerChat in my case).

NB :Remember to set PrivacyStatementUrl in order for MessengerChat to work properly.

The output shoud look like this after you run the browser:

Again thank you for you emails.

Talley Ouro
.Net Web & Windows Developer

Thursday, August 20, 2009

How to bind XML Data to GridView or DataGrid?

Hi Readers,

Thank you for reading my blog.I received 40 emails yesterday.

Here is how to bind xml data to GridView or DataGrid:

Download aspnetbooks.xml source code here

Step 1:

-Add reference to System.Data and System.XML
imports System.Data
imports System.Xml

In C# :
using System.Data;
using System.Xml;

-Drop a GridView or DataGrid on designer surface
-Double click on designer for Page_Load event

Step3:Add this code inside Page_Load


Dim ds As New DataSet
Dim XMLMode As New System.Data.XmlReadMode
Me.GridView1.DataSource = ds

I programmed GetXMLPath function which is:

Protected Function GetXMLPath(ByVal xmlpath As String) As String
Return Request.PhysicalApplicationPath & xmlpath
End Function

In C#:

DataSet ds=new DataSet();
System.Data.XmlReadMode XMLMode=new System.Data.XmlReadMode();
this.GridView1.DataSource = ds

for the function:

protected string GetXMLPath(string xmlpath)
return Request.PhysicalApplicationPath + xmlpath

Note + sign instead of & inside GetXMLPath method(C# uses + while VB.NET uses &)

The code inside VS should look like this:

The output should look like this:

Thank you for reading.

Any question or if you need private online training please email me at

Talley Ouro

Free HTML control for your VS 2005/2008 Projects

Hi all,

Do you want this control in your VS(Visual Studio)2005/2008 projects?
If so please download the DLL and sample project i precompile for you.
Here is the link


1-Copy the DLL to the bin section of your project and refresh the project
2-Go to ToolBox and Rick Click on it and choose Add Tab ang give it a name.
3-Right Click on the newly name you gave on 2 and click on Choose Items.Locate
the HTML Editor dll on project bin(Winthusiasm.HtmlEditor.dll) and clickOK.
It should look like this :

4-Now drag it on designer surface and that is all.You can disable OK and Cancel Buttons on designer surface or from property window.

Pleas leave your comments on my blog.

Thanks you for visiting my blog.Keep coming for more blogs.

Talley Ouro
C#,VB.NET,ASP.NET,PHP,Java(use java for fun) Developer

Monday, August 17, 2009

How to configure Visual Studio 2005/2008 to use Enterprise Library for Data Access?

Here is the quickest way to configure visual studio to use Enterprise Library.

System Requirements:

-Microsoft Visual Studio 2005/ 2008 development system (any of the following editions):
Standard Edition
Professional Edition
Team Edition for Software Developers
Team Edition for Software Testers
Team Edition for Software Architects
Team Suite

-For the Data Access Application Block, the following is also required:

A database server running a database that is supported by a .NET Framework 2.0/3.5 data provider. This includes SQL Server 2000 or later

-To run the Unit Tests, the following is also required:

Visual Studio 2008 Professional or Visual Studio 2008 Team Edition. Enterprise Library includes both unit test binaries and source code.

-For the Logging Application Block, the following is also required:
Stores to maintain log messages. If you are using the MsmqTraceListener trace listener to store log messages, you need a message queue. If you are using the DatabaseTraceListener trace listener to store log messages, you need a database server. If you are using the EmailTraceListener trace listener to store log messages, you need an SMTP server.

After these requirements you need to download Enterprise Library 4.0 - May 2008
(It working fine for both VS2005/2008).
Download it here

After you download it open both Visual Studio 2005/2008 and Enterprise Configuration Libary tool(C:\Program Files\Microsoft Enterprise Library May 2008\bin bleu icon)

-After you open the config tool you need add Data Access Block from it.You will see this image

-Right Click(RC) on Enterprise Library Configuration and choose New Application

-After that RC on Application Configuration and choose New then Data Access Application Block

-Change the connection Name and string that will match the connection string of your applicatio.
Database=Database;//name of your database

Server=(local)\SQLEXPRESS;Integrated Security=SSPI //name of your server

-Save it on the location of your application aroung web.config or app.config

-Open VS 2005/2008 ,RC on web.config and add these 3 configurations between configuration tags(You can get this by openning the saved configuration from the tool)

That`s all you need to get started with Enterprise Library Configuration .
You are ready to start Data Access Block.

Talley Ouro,
Developer Cary,NC,USA

Sunday, August 16, 2009

How to Enable Administrator Account on Vista

Here are the steps to enable Administrator Account on VISTA:

1-Right Click on CMD prompt and choose Run As Administrator

2-When command windows pops up type the following command and press ENTER

net user administrator /active:yes

That`s all you need.

NB To disable the account use net user administrator /active:no

You need to restart LogOut your pc in order to take effect.

Talley Ouro

Best VB.NET 2005/2008 Books

If you want to become expert buy these books depending on what version of
.Net Plateform you are using.
You can buy them on

SQL Server 2005 Authentication

How a add SQL Login to SQL Server


1-Login to SSMS with Windows Authentication

2-Click on Security/Login

3-RC Login/Add New Login

4-Enter name/Choose SQL Authentication/Enter strong password(8 characters min with
special key @#...) and click OK.

SECOND STEP: Assign grants

1-Login in again with Windows Auth

2-Click on Databases then choose the db on which you want to assign User

3-Go to security(inside the db) then Users

4-RC Users/Add New User

5-Click on Eclipse after Login name and select login will popup

6-Enter first 2 letters of the user you want to add and click on Check Name Button

7-Choose the name of the user you added on first step and click OK twice.

8-Copy the same name on step 7 and paste on the textbox after Username

9-Under Schemas owned by this user choose appropriate schemas especially db_datareader,
db_datawriter,db_datacessadmin,db_owner).You can add more later.

10-Database role membership choose roles for this user(Usually the same as 9) and click OK.

You done with SQL Authentication.
Start SSMS and login with the user and password you just created. Make sure you choose SQL Server Authentication.

Thursday, August 13, 2009

Solution to this error:Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)

Just turn off recursives triggers,views ,functions and store pro wich
cause the problem.
For trigger for example Go to SSMS,open the table in question,open trigger folder
and right click the trigger that cause the problem and choose disable.
You should be good to go.

Talley Ouro

Saturday, August 8, 2009

Useful JavaScripts for DataGrid control

This codes will help you with your datagrid activities.
You have to add a CheckBox to datagrid.


this html tag adds a checkbox to header 1-add asp:TemplateColumn tag
2-add HeaderTemplate tab
3-add input tag with id=checkAll,type=checbox,onclick=DGSelectOrUnselectAll('DataGrid1',this,'chkDel')

this html tag adds checkbox to datagrid 1-add ItemTemplate tag
2-add asp checkbox control within ItemTemplate tag with id=chkDel,RunAt=server

JavaScript codes:Add these js code in
section of HTML

this is to select or unselect the datagrid check boxes

function DGSelectOrUnselectAll(grdid,obj,objlist){
//this function decides whether to check or uncheck all

function DGSelectAll(grdid,objid){
//.this function is to check all the items
var chkbox;
var i=2;

chkbox=document.getElementById(grdid +
'__ctl' + i + '_' + objid);

chkbox=document.getElementById(grdid +
'__ctl' + i + '_' + objid);


function DGUnselectAll(grdid,objid){
//.this function is to uncheckcheck all the items
var chkbox;
var i=2;

chkbox=document.getElementById(grdid +
'__ctl' + i + '_' + objid);

chkbox=document.getElementById(grdid +
'__ctl' + i + '_' + objid);

If you have question please email me at
My name is Talley Ouro,Developer in Raleigh,NC

Thursday, August 6, 2009

How to hack "Failed to query a list of database names from the SQL Server"

Sometimes ASP.NET Configuration Tool(ASP.NET) is a pain in the ass when trying to add aspnet.db for role management.

By default on Vista the current user on the machine is not a member of SysAdmin on SQL Server 2005/2008.

So here is the trick.

1-Open Sql Server Surface Area Configuration tool from C:\Program Files\Microsoft SQL Server 2005/2008.

2-When the screen pops up click on Add New Administrator.

-on top right make sure that User to provision=Username of the pc
-on your left (Available Privileges) select Member of SQL Server SysAdmin and click on the right arrow (>)
-click ok and you should be ready to go.

My name is Talley Ouro,Developer in Raleigh,NC

Sunday, August 2, 2009

Code to add JavaScript confirmation dialog to a button in a datagrid

Here is the code.It is free like "free beer".If you have question send me email at datagrid index it 0 based.
NB You could add another parameter to the function that will execute when click=ok

public static void AddConfirm(DataGrid theGrid, int columnNumber, string question)
//for each row in the DataGrid
foreach(DataGridItem item in theGrid.Items)
//for each webcontrol in the column
foreach(WebControl control in item.Cells[columnNumber].Controls)
//if it is a LinkButton or Button
if(control is LinkButton || control is Button)
//add the attribute
control.Attributes.Add("OnClick", " javascript:return confirm('" + question + "');");

How to color a row of DataGrid in ASP.NET 2.0/3.5

1-Here is the code in VB.NET 2005/2008
The name i gave empGrid to the datagrid.To do this go the property of datagrid and
click on the events section and double click on ItemDataBound event and add the code.

Protected Sub empGrid_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles empGrid.ItemDataBound

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then

Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim Status As String = Convert.ToString(drv.Row.Item("Status"))

If Status = "Active" Then
e.Item.Cells(4).BackColor = Drawing.Color.Green

ElseIf Status = "Inactive" Then
e.Item.Cells(4).BackColor = Drawing.Color.Red

End If
End If
End Sub
1-Here is the code in C# 2005/2008
The name i gave empGrid to the datagrid.To do this go the property of datagrid and
click on the events section and double click on ItemDataBound event and add the code.

private void empGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
DataRowView Drv = (DataRowView)e.Item.DataItem;
// Get fourth column value.The coloumn needed
String Status = Convert.ToString(rv.Row.ItemArray[4]);
if (Status =="Active")
e.Item.Cells[4].BackColor = Color.Green;
//Just add the remaining steps

This code is free like "Free Coffee"

Talley Ouro

Thursday, July 16, 2009

Try free Live HTML and Javascript

There is a new great tool on website.
It name is Bespin.
With Bespin you can test your HTML and js codes online.

Here is the link to Bespin:

You need to open an account with Mozilla project in order
to use Bespin

Enjoy it!


Sunday, February 1, 2009

free PHP training in 1 month(Part III)

Hi all,

Sorry i was busy.Now let start our first hello world program from PHP.


1- Open your NetBeans IDE from Start Menu.

2-Go to File/New Project/Select PHP from Category/PHP application/Next/Give HelloWorld to application name/Click Finish.

After you finish you will see a page with a bloc of code for index.php.I will will explain to you more about this file later.

// put your code here

Every php application starts with .
The php code goes within


You declare php variable with a dollar sign $ follow by the name of the variable.
For more info about definition go to

Let declare a variable named i and assign it 12;

$i='Hello World';

Note 3:
Single quote is best way to handle string.Do not use "" for strings.Any variable
within "" will be Executed.

Note 4:
Php comment is c# style // or /* */
Let print it to the browser.The best browser for php is FireFox.
Right click on the projoect HelloWorld/Properties/Debug/Deselect Debug Server with php/Seelect Debug client with Javascript/Choose FireFox and click OK.

Now let print $i to the browser.
add code like this:

$i='Hello World;
//to print hello world we use echo keyword or print

echo $i;


Note 5:Every variable declaration end with ; like c#

Run the project :Right click on index.php/Run.

You will see Firefox showing Hello World.

PHP is a loosy type.It mean you don`t have to define a variable type to use it.
Let me be clair.In C# if i want to declare an integer variable named i this is how i
will do it:

int i=12;
In php $i=12;so php is less trouble than c#,vb......

See you Next time.Remember to go to documentation section of and copy
php keyword to a file named keyphp.txt on your desktop.

Talley John
Software Developer

Sunday, January 18, 2009

free PHP training in 1 month(Part II)

PHP IDE download

Download the Netbean IDE for free.
Click here to download it.

Make the IDE that contain PHP only for
Familiarize yourself with that IDE and make
sure you explore it templates and toolbox items.

See you soon!
Talley John Ouro

Monday, January 5, 2009

free PHP training in 1 month(Part I)

Welcome to php world.

PHP is a powerful server-side scripting language for creating dynamic and interactive websites.

PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP is perfectly suited for Web development and can be embedded directly into the HTML code.

The PHP syntax is very similar to Perl and C. PHP is often used together with Apache (web server) on various operating systems. It also supports ISAPI and can be used with Microsoft's IIS on Windows

If your server supports PHP you don't need to do anything. Just create some .php files in your web directory, and the server will parse them for you. Because it is free, most web hosts offer PHP support.

However, if your server does not support PHP, you must install PHP.

Download PHP for free here:

Download MySQL for free here:

Download Apache Server

Download Apache for free here:

See you next time for Part II

Talley J Ouro

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.