Friday, 21 September 2012

DLL in VB 6.0,VB.Net,C#

Hi......
DLL statds for Dynamic Link Library which comprise Business logic .At A huge level of 
Software development it is suitable to implement business login separately. 
DLL provides facility of reversibility means  ones you have been created a DLL 
for a task then many project can use your DLL, Like if you have a DLL of
Calculator logic then many Application can use it after importing DLL ij their project...

DLL in VB 6.0
  • Open VB 6.0 and select ActiveXdll
  • Change your final project name as you're going to make otherwise you may be face problem of name contradiction because default name of dll project is Project 1 and VB Standard exe has also same so change name of dll project or standard exe project
  • On Project explorer window change of class1 as your requirement
  • now make some procedure and function of your logic as showing in following picture
  • Save DLL project
  • For make DLL select File > Make Project1 DLL...
  • Now your DLL is ready to use
Develop by Raj Kumar

How to use This DLL
  • Open VB 6.0
  • Select Standard EXE
  • For add a DLL in your project ..
  • Go to Project > Refereneces.
  • Browse Your DLL File and click open
  • Now you can use DLL class
  • Make an object of class which you have made in your DLL project
  • Call function of your DLL class using . operator
After import DLL you can use it at anywhere here is code which you can use on a button click event

Private Sub Command1_Click()
    Dim ob As New Class1
    ob.Show
    
End Sub

Private Sub Command2_Click()
    Dim ob As New Class1
    MsgBox (ob.Sum(10, 20))
End Sub
DLL in C# and VB.Net

  • Open Visual studio 2008 File > Project > Select class library form template
  • Implement your function and logic inside class body
  • After implementing logic press f6 for build your DLL Project
  • For use a DLL in windows Application right click of root folder from solution explorer
  • Add References..
  • Browse your project DLL
  • Now make an object of class which you have named in DLL file
Code of DLL my DLL file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
    public class Class1
    {
        public int sum(int a,int b)
        {
            return a + b;
        }
    }
}

Thursday, 20 September 2012

Zig Zag Effect on text and image using MARQUEE


Marquee is a  HTML tag which is use scroll object inseide it.
You can scroll any thing in body of marquee. Marquee tag has property direction which moves
and object(left,right,up,down) , Behavior property change behavior of scrolling.....
You can put image instead of <h1> or any thing which you want to move in a zigzag way... Enjoy marquee.

Girfa : Student Help

<marquee behavior=alternate>
        <marquee direction=down behavior=alternate>
            <marquee direction=up behavior=alternate>
                <h1>Girfa : Student Help</h1>
            </marquee>
        </marquee>       
   </marquee>

Database connectivity with MS Access in VB 6.0


Database connection with VB 6.0
VB provides a rich set of of database connectivety.Most of work which is needed done by aotomatically.There’re some control which provides database connectivety.Here i’m going to implement it using ADODB.
ADODB provides connection class.which handle insert ADODB,update,delete operation efficiently.
Ø       Make an objet of ADODB,Connection
Ø       Then call open function which takes connection string as argument
Ø       Connection string comprise database enzine name and your database path.I have supply relative path my database is in current folder.


Maked by Raj kumar

Controls :
    ( Three label,,Three Moniter,Three  textbox )

Coding

Dim con As New ADODB.Connection

Private Sub btnDelete_Click()
    If txtRoll.Text = "" Then
        MsgBox "Please enter roll no."
        txtRoll.SetFocus
    Else
        If MsgBox("Are you sure to delete this record", vbYesNo, "Girfa") = vbYes Then
            con.BeginTrans
            con.Execute "delete from stu where roll=" & txtRoll.Text
            con.CommitTrans
            txtRoll.Text = ""
            MsgBox "Record deleted"
        End If
        
    End If
End Sub

Private Sub btnSave_Click()
    If txtRoll.Text = "" Or txtName.Text = "" Or txtCity.Text = "" Then
        MsgBox "Please Fill alll field"
    Else
        con.BeginTrans
        con.Execute "insert into stu values(" & txtRoll.Text & ",'" & txtName.Text & "','" & txtCity.Text & "')"
        con.CommitTrans
        MsgBox "Saved", , "Girfa"
        
    End If
End Sub

Private Sub btnUpdate_Click()
    If txtRoll.Text = "" Or txtName.Text = "" Or txtCity.Text = "" Then
        MsgBox "Please enter all field value"
    Else
        con.BeginTrans
        con.Execute "update stu set name='" & txtName.Text & "',city='" & txtCity.Text & "' where roll=" & txtRoll.Text
        con.CommitTrans
        MsgBox "Record has been updated", , "Girfa"
    End If
End Sub

Private Sub Form_Load()
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=bsw.mdb;Persist Security Info=False"
End Sub



Wednesday, 19 September 2012

How to Print New Line in VB 6.0 Message Box


Message box is form which is use to print a message
by default its print text in same line
but you print your text in new line...... howz????
take a look..........
Private Sub Command1_Click()
    MsgBox "    Girfa " & vbCrLf & "Student Help", , "Girfa"
End Sub