Jx_Man 987 Nearly a Senior Poster Featured Poster

Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)
You can post your question on Linux Section

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Carol...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Bob...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Pyro...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Zach...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Declare x as Shared instead of Private

agree

Jx_Man 987 Nearly a Senior Poster Featured Poster

Thanks I've already corrected the error

Great...
So please share with others so other member can learn from u if the facing the same problem.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Use Join in sql statement
E.g :

SELECT a.Id_User as 'User Id', a.Password, b.Id_Role, b.Status FROM USERS a join ROLE b on (a.Id_Role=b.Id_Role)

So you can remove strSql1 and just use strSql as sql statement.

Jx_Man 987 Nearly a Senior Poster Featured Poster

use JOIN with AND operator in your sql statement.
what the name tables?what the relation between each other? i mean relation between that two tables?
Join will get data from two table and AND operator will get data from your two conditions.

Jx_Man 987 Nearly a Senior Poster Featured Poster

what database in used?sqlserver or access?

Jx_Man 987 Nearly a Senior Poster Featured Poster

use join in your select statment

Jx_Man 987 Nearly a Senior Poster Featured Poster

use join in your select statment

Jx_Man 987 Nearly a Senior Poster Featured Poster

Nice converting friend...
>>thanks for direction
Any time :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :
First Textboxt to input words = textbox2
Second to input certain char = textbox1
Button to execute and label to show result.

Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
        Dim jmlText, jmlChar, i As Integer
        jmlChar = 0 
        jmlText = Len(TextBox2.Text) 
        For i = 0 To jmlText 
            TextBox2.Focus()
            TextBox2.SelectionStart = i
            TextBox2.SelectionLength = 1
            If TextBox2.SelectedText = TextBox1.Text Then  
                jmlChar = jmlChar + 1 '
            End If
        Next
        Label1.Text = "You have " & jmlChar & " Character " & TextBox1.Text
End Sub
november_pooh commented: wow.... +1
Sawamura commented: really a nice code. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome :)
Happy coding.

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome :)
Happy coding.

Jx_Man 987 Nearly a Senior Poster Featured Poster
' Return True if a file exists

Function FileExists(FileName As String) As Boolean
    On Error GoTo ErrorHandler
    ' get the attributes and ensure that it isn't a directory
    FileExists = (GetAttr(FileName) And vbDirectory) = 0
ErrorHandler:
    ' if an error occurs, this function returns False
End Function

Private Sub Form_Load()
If FileExists("H:\settings.txt") = True Then
    MsgBox "Your Code If File exists"
Else
    MsgBox "Your Code if File not found"
End If
End Sub
Sawamura commented: really nice +1
Neji commented: Great code +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this following code :

Dim con As New OleDb.OleDbConnection
    Dim cmdOle As New OleDb.OleDbCommand
    Dim dsOle As New DataSet
    Dim da As New OleDb.OleDbDataAdapter
    Dim dtOle As New DataTable
    Dim sql As String

    Private Sub LoadData()
        con.ConnectionString = ("Provider = Microsoft.JET.OLEDB.4.0;Data Source= D:\Only Me\Authors.mdb")
        Try
            cmdOle = con.CreateCommand
            cmdOle.CommandText = "SELECT * FROM Authors "
            da.SelectCommand = cmdOle
            da.Fill(dsOle, "Authors")
            dgAuthor.DataSource = dsOle
            dgAuthor.DataMember = "Authors"
            dgAuthor.ReadOnly = True
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try

    End Sub

    Private Sub Search_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadData ' Call Load Data Procedure in form load to fill datagrid
    End Sub

    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

        con.ConnectionString = ("Provider = Microsoft.JET.OLEDB.4.0;Data Source= D:\Only Me\Authors.mdb")
        Try
            dsOle.Clear()
            dtOle.Clear()
            cmdOle = con.CreateCommand
            cmdOle.CommandText = "SELECT * FROM Authors where YearBorn LIKE '%" & Trim(txtSearchKey.Text) & "%'"
            da.SelectCommand = cmdOle
            da.Fill(dsOle, "Authors")
            dgAuthor.DataSource = dsOle
            dgAuthor.DataMember = "Authors"
            dgAuthor.ReadOnly = True

        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Connection Error !!")
        End Try
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

see this code :

Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\MyDB.mdb;")
cn.Open()
cmd = New OleDbCommand("SELECT * FROM Breakdown WHERE BFrom = '" & txtFrom.Text & "'", cn)
dr = cmd.ExecuteReader
If dr.Read()
  MsgBox "Matching Records Found"
  'write whatevr code u want here
Else
  MsgBox "Data not found"
End If
dr.Close()
cn.Close()
Estella commented: helping suggestion +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...
You want to add it and run with vb.net.
.Net doesn't have a special Script Control.
Download the Script Control (ActiveX) from Microsoft
See this link

ITKnight commented: thankss....it very helpful +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

I hope that will solved your problem.

Neji commented: yes...it was solved. thank you for great link +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

First add reference Microsoft SQLDMO Object Library.
then add this code :

Dim i As Integer
        Dim oNames As SQLDMO.NameList
        Dim oSQLApp As SQLDMO.Application
        oSQLApp = New SQLDMO.Application
        oNames = oSQLApp.ListAvailableSQLServers()
        AddHandler ComboBoxEdit4.SelectedIndexChanged, AddressOf comboBoxEdit4_SelectedIndexChanged

        For i = 1 To oNames.Count
            Me.ComboBoxEdit4.Properties.Items.Add(oNames.Item(i))

        Next i
Jade_me commented: thanks it was solved my program +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this :

Public Function Factorial(ByVal Number As Integer) As String
        Try
            If Number = 0 Then
                Return 1
            Else
                Return Number * Factorial(Number - 1)
            End If
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function

I called this function in button click event:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
       Dim num As Integer
        num = Val(InputBox("Enter the Factorial Number"))
        MsgBox(Factorial(num))
End Sub
Sawamura commented: Well great +1
Vega_Knight commented: thank you very much for your help +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi,
Welcome to Daniweb. You are new to VB.Net and SQL. but the process of VB.Net with SQL cannot be explained shortly. It is a lengthy process. so please try and tutorial of VB.Net with SQL and Try your own coding. If any problem occurred, post the problem any one can help.

Yeah, you're right.
Just please post your own code friend.

Jx_Man 987 Nearly a Senior Poster Featured Poster

what kind of database?
how far u do this?post your code friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

lstdateandtime.Sorted = True

Jx_Man 987 Nearly a Senior Poster Featured Poster

SaveFileDialog1.FileName

Jx_Man 987 Nearly a Senior Poster Featured Poster

this will detect if mouse button clicked :

Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
        If e.Button = MouseButtons.Left Then
            MsgBox("left button clicked")
        ElseIf e.Button = MouseButtons.Right Then
            MsgBox("Right button clicked")
        End If
    End Sub
Naruse commented: thx..i didn't know how easy it is +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

???
Visit this site, this one too, And this too.

Jx_Man 987 Nearly a Senior Poster Featured Poster

hmm..
when u opened vb 6 project use vb.net it will convert your project in vb.net. so u can convert your project into vb 6 first then u can open current project in vb.net.
Thats what i doing.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Well, try this code :
add this code in datagrid click event.

Dim i As Integer
i = dgAuthor.CurrentRowIndex()
MsgBox(Trim(dgAuthor.Item(i, 0)) & " - " & Trim(dgAuthor.Item(i, 1)) & " - " & Trim(dgAuthor.Item(i, 2)))

Modified as u needed.

Naruse commented: Great +1
Vega_Knight commented: :) +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

you mean get data on each row?

Jx_Man 987 Nearly a Senior Poster Featured Poster

try this :

private string CharHash(string Data)
{
	string Temp = null;
	string Result = null;
	//'
	long i;
	//'
	for (i = 1; i <= Data.Length; i += 2)
	{
		Temp = System.Convert.ToString(Strings.Chr((int) (Conversion.Val("&H" + Data.Substring((int) (i - 1), 2)))));
		Result = Result + Temp;
	}
	//'
	return Result;
}
Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

First i want to say Welcome to Daniweb Friend.

There is some links about module :
- http://www.homeandlearn.co.uk/net/nets9p7.html
- http://www.java2s.com/Tutorial/VB/0120__Class-Module/Catalog0120__Class-Module.htm

Jx_Man 987 Nearly a Senior Poster Featured Poster

hiiii
thanks for ur reply....i tried tht several times....command prompt just appears and goes...i hav to complete d execution of bat file.....thts nt possible......plz help

it means problem happened with your bat file.
Try to open other program, like exe file.

Shell("D:\FCM.exe", vbNormalFocus)

i tried and works fine

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Ken...Welcome to Daniweb Friend :)