2007-07-15

Will Microsoft Kill Free Email on the Net?

Spam has been such a problem that email filters are now widespread on the Net. These filters are a necessary response to the menace of spam. However, will the excuse of spam be used by companies such as Hotmail to charge for email?

Disturbing news that Hotmail (owned by Microsoft) is blocking perfectly legitimate emails because they have been caught by their anti-spam filters is increasing these fears.

Allan Gardyne of Associateprograms.com has been commenting recently about the difficulties SiteSell (owner of the website building package SiteBuildIt) has had with Hotmail.

http://associateprograms.com/discus/viewtopic.php?t=2847

When SiteSell complained to Hotmail they did not get a helpful response. Microsoft suggested that they use the services of a company called Bonded Sender which would ensure that SiteSell’s legitimate non-spam emails would reach their customers. It just happens that one of the owners of Bonded Sender is a former employee of Microsoft!

Many other companies have had similar problems with Hotmail. Bill Gates is on record as wishing to charge for email as a method of preventing spam. Unfortunately, when the big companies on the Net gang up like this, a sort of inevitability about charging for email creeps in. Nearly 60% of email is handled by Hotmail, AOL, and Yahoo combined. These three companies could have the power to force customers to pay for their email.

However, customers still have bargaining power. They may decide to stop using Hotmail and opt for a genuine free service. The founding fathers of the Internet had a public service attitude to the free dissemination of information. If the big companies charge for email, this egalitarian ideal will be lost.

The most appealing aspect of the Internet for many people was precisely this level-playing field that it created. The hobbyist in any part of the world could communicate and pass information (through email!) to other enthusiasts. The small entrepreneur could set up a website and make money without reference to the multinationals. However, this freedom will be lost if customers are not vigilant. The big companies like Microsoft are businesses concerned with profit. The freedom of access that the Internet gives to the small person in any part of the world is not a priority of the multinationals.


© John Lynch
==================================================
For Free Internet marketing E-books on Net Writing, Web Mastering, Net Auctions, Affiliate help go to: http://www.merchant-account-service.com/free_courses_online.html
==================================================


Read more articles by: John Lynch
.
Article Source: www.iSnare.com

2007-07-13

Change All Column's Collation By Sql Script

Change All Column's Collation By Sql Script

You can change your database collation from enterprise manager. But your columns in table did not change accordingly.
Here is show how to change all collation columns in database. (You can change Thai_CI_AS to your collation.)


Sample Script
DECLARE @@TableName Nvarchar(100)
DECLARE @@ColumnName Nvarchar(100)
DECLARE @@ColumnType NvarChar(100)
DECLARE @@ColumnLengh FLOAT
DECLARE
@@SQL NvarChar(1000)
DECLARE
@@IsNullAble NvarChar(50)

DECLARE
my_cursor CURSOR FOR
Select sysobjects.name From sysobjects Where xtype='u' OPEN my_cursor

FETCH NEXT FROM my_cursor INTO @@TableName
WHILE
@@FETCH_STATUS = 0
BEGIN

DECLARE my_column CURSOR FOR

select syscolumns.name,systypes.name as Type, syscolumns.length ,syscolumns.isnullable

From syscolumns
inner join sysobjects on sysobjects.id=syscolumns.id

left outer join sysproperties on
sysproperties.smallid=syscolumns.colid and sysproperties.id = syscolumns.id

inner join systypes on
syscolumns.xtype = systypes.xtype

where sysobjects.xtype='u' And sysobjects.name=@@TableName And (systypes.name='nvarchar' or systypes.name='varchar')


OPEN my_column

FETCH NEXT FROM my_column INTO @@ColumnName,@@ColumnType,@@ColumnLengh,@@IsNullAble


WHILE @@FETCH_STATUS = 0

BEGIN

IF (@@IsNullAble=1)

BEGIN

Select @@SQL =( 'ALTER TABLE ' + @@TableName + ' ALTER COLUMN ' + @@ColumnName + ' ' + @@ColumnType +
'(' + CAST(@@ColumnLengh as
NVARCHAR) + ') COLLATE ' + ' Thai_CI_AS NULL')

END

ELSE

BEGIN

Select @@SQL =( 'ALTER TABLE ' + @@TableName + ' ALTER COLUMN ' + @@ColumnName + ' ' +
@@ColumnType +
'(' + CAST(@@ColumnLengh as NVARCHAR) + ') COLLATE ' + ' Thai_CI_AS NOT NULL')
END


PRIN(@@SQL)
--EXEC
(@@SQL)


FETCH NEXT FROM my_column INTO @@ColumnName,@@ColumnType,@@ColumnLengh,@@IsNullAble

END

CLOSE my_column

DEALLOCATE my_column


FETCH NEXT FROM my_cursor INTO @@TableName

END
CLOSE my_cursor
DEALLOCATE my_cursor
GO
.

Clear all text on one method

There are two parameters that send to this method.

1. Parent control such as panel , group box etc.
2. Control that you want to ignore.

Sample Code


Private Sub ClearData(ByVal parentCtr As Control, _

Optional ByVal ignoreControl As Control = Nothing)
Dim
ctr As Control

For Each ctr In parentCtr.Controls

If Not (ctr Is ignoreControl) Then

If TypeOf ctr Is TextBox Then

ctr.Text = ""

ElseIf TypeOf ctr Is ComboBox Then

DirectCast(ctr, ComboBox).SelectedIndex = -1

ElseIf TypeOf ctr Is ListBox Then

CType(ctr, ListBox).Items.Clear()

End If

End If

ClearData(ctr, ignoreControl)

Next

End Sub



2007-07-12

Step to Create Dataset

This sample show the basic step to create dataset and there element.


Sample Code

Step 1 you should to Imports System.Data

Step 2 please see sample code below.

Dim ds As New DataSet("DataSetSample")

' Create Table
Dim dt As New DataTable("DataTable")

' Create Column
Dim cl1 As New DataColumn("Column1")
cl1.DataType = GetType(Integer)

Dim cl2 As New DataColumn("Column2")
cl2.DataType = GetType(String)

' Add column to table
dt.Columns.Add(cl1)
dt.Columns.Add(cl2)

' Add DataTable to DataSet
ds.Tables.Add(dt)

' Step to add DataRow
' Create new row
Dim dr As DataRow
dr = ds.Tables("DataTable").NewRow

dr("Column1") = 1
dr("Column2") = "Welcome to vb.net Sample code"

' Add Row1
ds.Tables("DataTable").Rows.Add(dr)


' If you can use array of datarow.
Dim drArray(1) As DataRow

drArray(0) = ds.Tables(0).NewRow
drArray(0)("Column1") = 2
drArray(0)("Column2") = "Show easy sample code"
ds.Tables("DataTable").Rows.Add(drArray(0))

drArray(1) = ds.Tables(0).NewRow
drArray(1)("Column1") = 3
drArray(1)("Column2") = "Easy to understand"
ds.Tables("DataTable").Rows.Add(drArray(1))


' binddata to gridview
Me.DataGridView1.DataSource = ds.Tables("DataTable").Copy()


vb.net sample code

2007-07-11

VB.Net: Dynamic Usage Of Eventhandlers

VB.Net: Dynamic Usage Of Eventhandlers

WithEvents and Handles clause requires form us to declare the object variable and the event handler as we write our code, so linkage is created upon compilation. On the other hand, with AddHandler and RemoveHandler, linkage is created and removed at runtime, which is more flexible.

Let's assume that we want to load several MDI child forms, allowing each of them to be loaded only once, and of course to know when one of the child forms is closed. Since we have several forms to load we would like to use the AddHandler and RemoveHandler keywords so we can be flexible and write the minimal code we can.

Let's get dirty.

1. In each MDI child form we have to declare a public event.
Public Event FormClosed(ByVal f As Form)

2. In each MDI child form we have to use the Form_Closed method which handles the MyBase.Closed class and raise the FormClosed event.

Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles MyBase.Closed
RaiseEvent FormClosed(Me)
End Sub


3. On our MDI form we need to declare two member variables. The first's of type Form and the second's type is ArrayList.
Private m_f(0) as Form
Private m_sLoadedChildForms As New ArrayList


4. We need to implement a method the will search the MDI child forms that are loaded. We'll also use this method when we unload the MDI child forms.

Private Function SearchChildForm(ByVal strSearchForm As String, _Optional ByVal idxEventHandler As Long = -1) As Long
Dim i As Long = 0
For i = 0 To m_sLoadedForms.Count - 1
If m_sLoadedForms.Item(i) = strSearchForm Then
Dim j As Long = 0
For j = m_f.GetLowerBound(0) To m_f.GetUpperBound(0)
If m_f(j).Name = strSearchForm Then idxEventHandler = j
Next j
Return i
End If
Next
Return -1
End Function


5. We need to implement a method to load the mdi child forms and use the SearchChildForm method in order not to load the same mdi child form second time.

Private Sub LoadChildForms(ByVal f As Form)
If m_f.GetUpperBound(0) > 0 Then
ReDim Preserve m_f(m_f.GetUpperBound(0) + 1)
End If
m_f(m_f.GetUpperBound(0)) = f I
f Not SearchChildForm(m_f(m_f.GetUpperBound(0)).Name()) >= 0 Then
m_f(m_f.GetUpperBound(0)).MdiParent = Me
AddHandler m_f(m_f.GetUpperBound(0)).Closed, _
AddressOf UnloadChildForm
m_f(m_f.GetUpperBound(0)).Show()
m_sLoadedChildForms.Add(m_f(m_f.GetUpperBound(0)).Name)
Else
If m_f.GetUpperBound(0) > 0 Then
ReDim Preserve m_f(m_f.GetUpperBound(0) - 1)
End If
End If
End Sub


6. At last we need to implement a method to take out our mdi child form from the array list so we can load it again if we want.

Private Sub UnloadForm(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim i As Long
Dim s As String = sender.GetType().Name
Dim IndexForEventHandler = -1
i = SearchChildForm(s, IndexForEventHandler)
If i >= 0 Then m_sLoadedForms.RemoveAt(i)
If IndexForEventHandler >= 0 Then
RemoveHandler m_f(IndexForEventHandler).Closed, AddressOf UnloadForm
m_f(IndexForEventHandler) = Nothing
End If
End Sub


About the Author:

Thomas is an experienced Visual Basic developer, with expertise of 7+ years developing financial applications. His main IT skills are VB, SQL, Crystal Reports - should you need a VB developer for your projects feel free to contact Thomas through his personal website at http://www.Kaloyani.com or through http://www.VBprofs.com