السبت، 22 أكتوبر 2011

Combo Box Data Binding With VB .Net

Introduction

Combo box data binding allows a combo box on a form to display a list that is external to the source of data of its form. For example, you can have a combo box that displays a fixed list of values that you create from the Items property of the combo box. For a relational database, you may want the combo box to display a list of values from a column of another table. To make this possible, you must link the combo box to the items of the other table.
To follow this example, you should have Microsoft SQL Sever 2005 and Microsoft Visual Studio 2005.
Practical Learning: Binding a Combo Box 


  1. To get the database used in this exercise start the Microsoft SQL Server Management Studio and log in to the server
  2. On the main Menu click File -> New -> Query With Current Connection
  3. To create the database, type the following:
     
    CREATE DATABASE StudentBinding;
    GO
    
    USE StudentBinding;
    GO
    CREATE TABLE Genders
    (
        GenderID int identity(1,1) PRIMARY KEY,
        Gender varchar(20)
    );
    GO
    INSERT INTO Genders(Gender) VALUES('Female');
    GO
    INSERT INTO Genders(Gender) VALUES('Male');
    GO
    INSERT INTO Genders(Gender) VALUES('Unknown');
    GO
    
    CREATE TABLE Students
    (
        StudentID int identity(1,1) PRIMARY KEY,
        FirstName varchar(20),
        LastName varchar(20) NOT NULL,
        GenderID int
    );
    GO
    INSERT INTO Students(FirstName, LastName, GenderID)
    VALUES('Helene', 'Mukoko', 1);
    GO
    INSERT INTO Students(FirstName, LastName, GenderID)
    VALUES('Gertrude', 'Wachs', 3);
    GO
    INSERT INTO Students(FirstName, LastName, GenderID)
    VALUES('Peter', 'Lansome', 2);
    GO
    INSERT INTO Students(FirstName, LastName, GenderID)
    VALUES('Paul', 'Motto', 2);
    GO
    INSERT INTO Students(FirstName, LastName, GenderID)
    VALUES('Hermine', 'Ngaleu', 1);
    GO
  4. Press F5 to execute
  5. Start Microsoft Visual Studio 2005
  6. To create a new application, on the main menu, click File -> New -> Project ...
  7. In the Projects list, select Visual C++ and, in the Templates list, click Windows Forms Application
  8. Set the Name to StudentBinder1 and click OK
  9. On the main menu, click Data -> Add New Data Source
  10. In the first page of the wizard, make sure Database is selected and click Next
  11. In the second page of the wizard, click New Connection
  12. For the server name, type (local)
  13. For the Database Name, select StudentBinding

  14. Click OK
  15. In the second page of the wizard, make sure ServerName.StudentBing.dbo is selected in the combo box and click Next
  16. In the third page of the wizard, click the Tables check (that will select both tables of our database)
  17. Set the DatasetName to dsStudents

  18. Click Finish
  19. From the Data Source window, click Students and click the arrow of its combo box to select Details
  20. Drag Students and drop it on the form
  21. Delete the GenderID textBox and customize the design of the form as you see fit
  22. On the Toolbox, in the Data section, click BindingSource and drop it on the form
  23. Change its properties as follows:
    Name: bsGenders
    DataSource: dsStudents
    DataMember: Genders
  24. Add a combo box to the form and specify its properties as follows:
     
    NameDataSourceDisplayMemberValueMemberDataBindings -> SelectedValue
    cboGendersbsGendersGenderGenderIDStudentsBindingSource - GenderID
  25. Execute the application to see the result

الأربعاء، 19 أكتوبر 2011

VB.NET Tips and Tricks-Combo/Listbox and Multiple column keys on hashtables



Combo/Listbox: ItemData and NewIndex

What kicks your butt in the beginning is simple little things. I remember when I first tried to insert items into a listbox and was hunting all over for the .AddItem method that would allow me to do so.
When I found out that the VB.NET listbox had an internal Items collection that turned the Listbox.AddItem syntax into Listbox.Items.Add syntax, I was nonplussed at first. However, as you work with more of the classes in the Framework, you begin to see the consistency that was missing in VB 6.0.
The items collection behaves the same as other collections in the framework, because they are derived from a common ancestor. Useful members like .AddRange, or .Contains are always there. And you never have to worry about using .ListCount instead of .Count (in .NET it will always be .Count) or think about whether the collection is zero or one based (always zero.)
At first I was missing two useful properties in the listbox/combobox. ItemData and NewIndex In VB 6.0 the .NewIndex property retrieves the index of the item added last. This can be done by checking the return value of the .Add method which returns the index. ItemData was useful because it could be used to save an integer value corresponding to the list item. This is handy when you have a numeric key to a column. When I realized that you could add ANY object to the Items collection, it became clear that this was a far more flexible approach and there wasn't anything lost at all in the translation ... Rather it was a .NET gain.
In order to add an object to the Listbox or combo box item collection, you must override the ToString method so that you will have a meaningful entry displayed in the list.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For i As Integer = 1 To 10
            'Index will hold the index of the newly added item.
            Dim Index As Integer = ListBox1.Items.Add(New ListItem(i, String.Format("Item {0}", i)))
            Debug.WriteLine(Index)  'will print the zero based index
        Next i

    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        'Cast it back to listitem class
        Dim ListItem As ListItem = DirectCast(ListBox1.SelectedItem, ListItem)
        Label1.Text = String.Format("ID={0}, Name={1}", ListItem.ID, ListItem.Name)
    End Sub
End Class


Public Class ListItem
    Private mID As Integer
    Private mName As String

#Region "Constructor(s)"
    Public Sub New(ByVal ID As Integer, ByVal Name As String)
        mID = ID
        mName = Name
    End Sub

    Public Sub New()
        'Empty default constructor
    End Sub
#End Region
#Region "Properties"

    Public Property ID() As Integer
        Get
            Return mID
        End Get
        Set(ByVal Value As Integer)
            mID = Value
        End Set
    End Property

    Public Property Name() As String
        Get
            Return mName
        End Get
        Set(ByVal Value As String)
            mName = Value
        End Set
    End Property

    Public Overrides Function ToString() As String
        'Required so that the listbox will display the correct
        'label
        Return mName
    End Function


#End Region
End Class


Multiple column keys on hashtables

Roxio Creator  2012
The Hashtable is the class that is most like a VB 6.0 collection. It allows you to retrieve an object with a key. Sometimes you want to key a hashtable on two values rather than one. In VB 6.0 one would combine the two elements into a string and use that as a key, but that is an ugly hack.

In VB.NET, as you can assign an object to the key, it seems easy enough to create an object to store the two values and use that as the key. However, when you do this, you have to override two of the objects methods: GetHashCode and Equals. If you don't override these methods, the hashtable will not recognise your key as a unique object. Although GetHashCode will return consistent results for repeated values of a simple data type, for objects, it does not rely on the state of the member variables. Overriding GetHashCode by "xor"ing the hashcodes of the internal variables will return a consistent result.
Because hash codes can still collide, it is necessary to override the Equals method to ensure that the hashtable can correctly tell when a key is unique to the collection. What we want is value equality rather than instance equality which is the default for object types.
The documentation states also that if you override GetHashCode you must also override Equals for this reason. The documentation also explained that you could implement IComparable which would also work with a hashtable, although I never tried it.
Here is an example:
Public Class Key1
    Public X As String
    Public Y As Int32

    Public Sub New(ByVal s As String, ByVal i As Int32)
        X = s
        Y = i
    End Sub

    Public Overrides Function GetHashCode() As Integer
        'Xor has the advantage of not overflowing the integer.
        Return X.GetHashCode Xor Y.GetHashCode

    End Function
    Public Overloads Overrides Function Equals(ByVal Obj As Object) As Boolean
        Dim oKey As Key1 = CType(Obj, Key1)
        Return (oKey.X = Me.X And oKey.Y = Me.Y)
    End Function

End Class



الاثنين، 3 أكتوبر 2011

Multi-Sites Builder Pro

EgeCMS is the first Multi-Sites Builder, it can manage servial sites with different types. eg, News,Press Release,Software Download, Shareware Affiliate, Blog,Forum etc. Using the Form Maker Online tools, then edit diffrent pages' content online (What You See Is What You Get ) with different property, make it possible to build multi-sites on one server,and publish individual site which the Domain binded with other server to remote server automatically.



The web page path is neat and orderly , all Html pages published, with some tools of SEO, it's the best sites marketing system.


* Builder multi sites with one system..
* Form Maker online, makes you edit pages with different items.
* Pages Version Management, record the history of pages.
* All Html pages published, even Catalog,Tag,Searh,Rss pages.
* Authority of user group expand easily.
* Suck up the pad file data.
* Rss Creator and Sitemap Creator.
* The Greate Search function, and build more html pages with high keywords density
* Asp.net 2.0+MS SQL , supported on any server system environment.
EgeCMS Multi-Sites Builder Pro is the only one Multi sites manager, adapt to the highest Web Marketing technology, with the assistance of User Group management, EgeCMS meet the marketing management of big company's Web Marketing, and make it possible to build a Service System.
Using EgeCMS Multi-Sites Builder Pro:
* Friendly with Google and Yahoo.
* Any template support, and you can copy a sites with no miss.
* The management of editor,manager,admimistrator helps you manage your company.
* The authority management of Page Publish, and record the every edition of pages, helps you back up all datas and optimize easily.
* The public datas shared, it's a individual function , helps you manage important marketing datas.
* Automatically publish the individual sites, manage multi sites on different server.
* Free support and service.

Download now

Difference Between PHP programming and ASP Net Programming


Whenever there is a need for inter-linking hugely databases to generate database driven websites, web programmers or web developers unanimously agree on using PHP programming or ASP.Net programming. ASP ( Active-server-pages) and PHP ( Hyper text preprocessor) are considered as the two most popular and standard web programming languages because of their unique advantages over other web development languages.
Web Easy Professional 8.0Both ASP.Net and PHP are developed to provide support to dynamic database driven websites. ASP.Net works smoothly on Microsoft products and it can be used with only IIS (Internet Information Server); whereas PHP can be run on any kind of platform as well as it can be connected with different types of databases.

ASP.Net is comparatively new programming language which was launched in 2002 by Microsoft. This web development language is best for building web applications, web services and dynamic websites.
On the other hand PHP was launched in 1995 by Rasmus Lerdorf. It is an open source software and it can be downloaded for free under the PHP license. PHP and ASP.Net have some other differences too, which are elaborated below:


  • Database Compatibility

As PHP uses MySQL for the purpose of database connectivity, it is highly flexible in nature. Another important fact is that it will incur extra expenditure because MySQL can be accessed for free. Whereas, ASP.Net uses MS-SQL for connecting database but MS-SQL can not be availed free from Microsoft.


  • Cost

Linux can be used for running PHP programs and Linux is free operating system. Therefore, the cost of developing a website in PHP language is remarkably low. On the other hand, you need to install Internet Information Server (IIS)on a Windows server platform if you want to run ASP.Net program. As Windows server platform is not a free product, the cost of production is bounded to be increased.


  • General Run Time

It has been observed that ASP.Net code runs slower than PHP code. This is because ASP.Net utilizes server space while running whereas inbuilt memory space is used by PHP while running.


Sell online with Volusion

  • Coding Simplicity



ASP.Net codes are somewhat complicated and a web developer needs to work hard to get the hang of it. But PHP codes are very simple and a programmer does not have to make a diligent effort because it is comparatively easier than other types of programming languages.


  • Platform Connectivity Issue

ASP codes are usually run on Windows platforms but if you install ASP-Apache in the server than it can run on Linux platform as well. PHP has a unique advantage in this issue. Its codes can be linked with different types of platforms such as Windows, Linux and UNIX.


  • Cost of Tools

PHP codes are available for free in various forums and blogs as it is a open source software. Furthermore, some useful tools that can be used in PHP are also available for free. However, no such free tools are available for ASP.Net.


  • Background Language Support

The codes that are used in PHP are very much similar to that of C++ language and its syntax resembles the syntax used in C and C++. Therefore, if you have a fair knowledge in C++ or C, you will not face any difficulty while coding PHP language. However, the syntax of ASP is more or less similar to that of Visual basic syntax and this is all but simple.


  • Security

Though PHP can offer enough measures for ensuring data security, ASP. Net is reputed for creating sophisticated techniques to ensure the safety of confidential data. This is the reason why government organizations opt for ASP.Net.

الأحد، 14 أغسطس 2011

The 3 Most Common Types of PC Virus Infections


Web security and the vexing problem of malicious software made headlines again last week when computer antivirus software maker McAfee sent out a botched update that crashed thousands of computers around the world.


Such hiccups in computer security software are rare. What isn't rare is the damage caused by the malicious software known as malware that antivirus software is designed to thwart. Last year hackers stole approximately 130 million credit card numbers, according to an Internet Security Threat Report released this month by security software maker Symantec. And in the third quarter of 2009 alone, there was over $120 million in reported losses due to online banking fraud.


David Perry, global director of education for security software maker Trend Micro, is a 22-year veteran of fighting malware. He gave TechNewsDaily a guided tour of malware's trinity, the three most likely sources of malware infection.


Trojans


Ground Zero for malware is the Internet itself. The Web is by far the most common vector for malware infection, Perry said. "The most universal thing of all that's involved in cyber bad guy activity is the Web."


Users don't even have to click anything on websites to infect their computers. Just looking is enough. "Look at the web page and Bang!, you're infected without so much as a how-do-you-do," he said.

Forsaking Internet Explorer and replacing it with another browser such as Firefox won't give you much protection either, Perry said. Malware is basically equal opportunity when it comes to browsers and browser plug-ins.


A Trojan downloader is the most common malicious software to get hit with, he said. A Trojan is any program that pretends to be something other than what it really is — a downloader is a program that downloads another program. "It's like Robin Hood," Perry said. "He shot an arrow with a string over a tree branch. He used the string to drag up a rope and the rope to drag up a basket of stuff."


In the past, sites devoted to porn and file sharing were the usual suspects for being sources of infection. "It used to be true," but no longer, Perry said. “We’ve seen government agencies and the Roman Catholic Church get infected; we’ve seen railroads and airlines and the British Museum get infected. There is no safe web page.”


To make matters worse, infected computers are often asymptomatic and appear to be functioning normally. Many Trojan viruses don't slow your computer down or make your cursor go crazy. Like high blood pressure, malware is a silent killer.


"Unfortunately, there's a big cognitive disconnect on the part of users who have seen movies where the virus comes on the screen and announces that it is infecting you," Perry said. "Any malware you see today will be by design as symptom free as they can possibly make it."


Botnets


The web is also where you risk contracting a drive-by bot infection that will enlist your computer as an agent in a fraudster's arsenal.


"A botnet is a collection of infected PCs that the bad guys now own," Perry said. "Botnets are the source of all spam – they're used for ID theft, extortion, industrial espionage and finding other web pages to infect. I would call it the Swiss Army Knife of the malware world. It does a lot of things for a lot of people."
Like the majority of malware software, botnets are asymptomatic. Until you wake up and find your bank account has been drained, that is, or discover that your ID has been appropriated for use by someone else.
Scareware


Fake antivirus programs, which are often referred to as "scareware," is the third and arguably most irritating leg of the malware stool.


With scareware, a warning pops up on your computer screen telling you that your computer is infected and attempts to sell you a program to disinfect the program. This is the ultimate no-win situation.


If you click anywhere on the warning, you get infected. If you ignore the warning, it will never go away. And if you fall for the ruse and buy the fake antivirus program, your computer will then become another warrior in the scammer's botnet army.


"This is the one thing in the world of malware that is visible," Perry said. "If you're infected, you'll know it because it's visible and bugs you all the time."


If you think you can simply hit Alt-Control-Delete — the keyboard combination that brings up the Task Manager in Windows — to rid shut down the offending program, think again. Many malware programmers expect panicked users to do this, and create fake Task Manager windows that trigger the infection.


So how big is the problem? Over 100,000 new Trojan downloaders are created every day, Perry said. Most computer users aren't knowledgeable enough to deal with the problems themselves without help, he added. "It's too vast and too pervasive."



The best defense, he said, is to install a suite of Internet security software and religiously update it.


"For right now, count your change and watch your Ps and Qs," he said. "There's no way to easily tell that something wrong is going on on the Internet."


Evaluate Kaspersky Lab products for free! You can try out a free 30-day trial version of one of our products right now. Click Here

الاثنين، 8 أغسطس 2011

Get your Customer Relationship Management System




CRM software is an essential piece of equipment for any company or organization that wants to achieve the maximum return on their marketing, fully capitalize on their sales leads and prospects, and cultivate ongoing, lifetime relationships with their current and established customers. By integrating all data about sales leads, current customers, associated companies, and employees throughout the various departments, CRM software enables enterprises to seamlessly handle marketing, sales, and customer service as a single package. Simply put, it's a way for salespeople to make a plan and then work that plan!

Two fundamental elements of continued growth that many firms overlook are the lifetime value of existing customers, and the importance of retaining them.
For most businesses and other organizations, the costs associated with the acquiring of a new customer or client are very high. In fact, for many companies, getting new customers is the single largest expense they incur. Convincing a skeptical public that your firm can meet their needs, and do it better than competing firms, is a tall order. Doing so requires spending large sums on advertising, branding, marketing, and a sales force. Most salespeople quit after the first contact, not because they don't want to follow-up, its just that they can't remember! So, knowing that it, over average, takes 8-12 contacts to close the sale, how much is a company wasting by having their salespeople do one call on a prospect when they KNOW it will take more. In contrast, your existing customers have already demonstrated a willingness to spend money on your product or service, and they are far more likely to do so in the future than someone who's never done business with you in the past.

Satisfied customers who return again and again to use a company's product or service are the foundation of a long-term future for any business. The key to retaining their loyalty is successfully managing your company's relationship with them, and CRM software is essential to this goal. By making each customer feel valued, and demonstrating respect for their decision to utilize your products or services, a bond of loyalty is forged which draws the customer back again and again. Automated customer relationship management software makes it much easier and simpler to manage contacts, inquiries, customer service requests, new orders, etc., from current customers. Besides customer retention, gains in efficiency from utilizing CRM software can also lower the overall costs of handling these various functions.

CRM software is not only employed for retention and handling of existing customers, but comes into play from the very first contact with the prospect, sales lead, or new order. By automating the process of funneling these contacts through the sales pipeline, the software streamlines the handling of these accounts and ensures that far fewer get lost in the shuffle of day to day business. Callbacks and new mailings can be scheduled and coordinated automatically, with much less risk of human error. Data from phone inquiries can becaptured and stored automatically. Customer order histories and
price points are stored for use in planning future marketing campaigns and for determining proper levels of customer support.

CRM software is not an option, but a necessary and integral part of any modern business that sees to maximize revenue and continue growing as a business. The right CRM tools can be the crucial tool that can enable a business to foster a more professional image.



Igoodsoft CRM System is On-Demand Small Business Customer Relationship Management System(CRM).Collect and organize all CRM data of your organization in order to keep track of your customers and improve your service quality.It can manage your marketing, customers, suppliers, purchase, sales and orders.What you see is what you get.It supports multi-user and access control.



It supports most of major database servers such as SQL Server,Access,Oracle,MySQL and others.It supports secondary development.

Download Igoodsoft CRM System (trial)

Buy Igoodsoft CRM System

Print Barcode at ASP.NET Application

Barcodesoft ASP.Net Server Control enpowers you to print barcode from your own ASP.NET application.

It supports all major linear and two-dimensional barcode formats, like Code39, Code128, UPC-A, EAN13, POSTNET, PDF417 and Data Matrix.

You get full control over barcode symbology, image format, orientation, size and human readable text display option.

The implementation is quite simple. One simple HTML tag like this

will plug in a barcode image into your web page.
Barcodesoft ASP.Net Server Control include a 30-day money back guarantee. If you are dissatisfied with the product for any reason, you will receive a full refund within 30 days.


Barcodesoft .Net Server Control is written in managed code (C#) and can generate all major linear and 2D barcode formats from .Net framework. It supports Code 39, Extended Code 39, Code 128, UPC-A, EAN13, Bookland, POSTNET, Interleaved 2 of 5, code 93, code 25, code 11, MSI / Plessey, Codabar, Telepen, Data Matrix, PDF417, QR Code, and Aztec.

You can customize barcode height, width, human readable text, image format and orientation.



It's quite easy to use Barcodesoft .Net Server Control in ASP.NET environment, 
1. Copy BCSDotNetCtrl.dll to your ASP.Net application \bin folder

2. Copy Barcodesoft.ashx to your ASP.net application root folder

3. If you are writing a HTML page,
you can insert a barcode image into your html page like this

<img src="Barcodesoft.ashx?s=code39&TEXT=1234">


If you are writing an .ASPX page, you can insert a tag
<%@ Register Assembly="BCSDotNetCtrl" Namespace="BCS" TagPrefix="bcs" %>
<bcs:BCSDotNetCtrl ID="BCSBarcodeCtrl1" runat="server" />


Then add the following codes in the CodeBehind C# file:

BCSBarcodeCtrl1.Symbology = 1;
BCSBarcodeCtrl1.Text = "BARCODESOFT";



Download a Trial Version

Buy Now