Jx_Man 987 Nearly a Senior Poster Featured Poster

yes, you just do twice inserting.

>>nah...re.....its nt wrkng! ne other solutions ? ne more appropriate solns?
lee was give the answer. Have u tried it?post your code.

Jx_Man 987 Nearly a Senior Poster Featured Poster

To show date in long mode : DateTimePicker1.Value.ToLongDateString() Ex : Saturday, September 13, 2008

To show date in Short mode : DateTimePicker1.Value.ToShortDateString() Ex : 9/13/2008

Jx_Man 987 Nearly a Senior Poster Featured Poster

First block all line of code then press the button on bar. See the pic

Jx_Man 987 Nearly a Senior Poster Featured Poster

you can add reputation on Dnx, just click on Add to Dnx's Reputation and fill the message.

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> Is there is link for giving rate to this message or this message was helpful check?
Click on Mark As Solved link below the post

Jx_Man 987 Nearly a Senior Poster Featured Poster
Dim temp, quantity As Double      
Console.Write("How many liters (only whole liters please ) ? ")
temp = Console.ReadLine()
quantity = Double.Parse(temp)
Jx_Man 987 Nearly a Senior Poster Featured Poster

>> "also you can change the event of controls"
Can you explain this a little further on how I do that?

There are combo filled with events.
you just select the control and select the event. you can find it on the top of code window. See the pic.

Jx_Man 987 Nearly a Senior Poster Featured Poster

so u want the event of controls shown...?
just double click on each control to get click event. also you can change the event of controls.

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> I am doing a calculation and want to put the results of the calculation in lblMortgagePayment
you want to put the result in lblMortgagePayment, but you put wrong assignment in your code.
Mr Brownstone was give the answer.

Jx_Man 987 Nearly a Senior Poster Featured Poster

See this site....
There are all about connection string to databases..
Just looking what you needed there.

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your own code? so we can help.
ithelp was give the best answer...

Jx_Man 987 Nearly a Senior Poster Featured Poster

so...what do you want?
If u want to terminated application just add End statement.

Private Sub Timer1_Timer()
If Label2.Caption = 0 Then
    Timer1.Enabled = False
    MsgBox ("60 secs is up, looks like your out of luck")
    End
Else
    Label2.Caption = Label2.Caption - 1
End If
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

1. Just add your msword file on your setup project.
then you can modified path of msword file :

System.Diagnostics.Process.Start(Application.StartupPath & "\MsWordFileName.doc")

2. On combox properties, set DropDownStyle = DropDownList

Jx_Man 987 Nearly a Senior Poster Featured Poster

number variable not increase.

Jx_Man 987 Nearly a Senior Poster Featured Poster

alternative, you use WindowsMediaPlayer to play media file.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

See this example :

Private Sub checkenq()
        Dim cmdTest As New OleDb.OleDbCommand
        Dim daTest As New OleDb.OleDbDataAdapter
        Dim dsTest As New DataSet
        Dim dtTest As New DataTable
        conn = GetConnect()
        Try
            conn.Open()
            cmdTest = conn.CreateCommand
            cmdTest.CommandText = "SELECT * FROM Customer where IDCustomer = '" & Trim(txtId.Text) & "'"
            daTest.SelectCommand = cmdTest
            daTest.Fill(dsTest, "Customer")
            dtTest = dsTest.Tables(0)
            If (dtTest.Rows.Count) > 0 Then
                MsgBox("Enquiry Exists")
                dgenqrec.DataSource = dsTest
                dgenqrec.DataMember = "Customer"
                dgenqrec.ReadOnly = True
                'cmdfound.Enabled = True
            Else
                MsgBox("Enquiry Not Found, Kindly Fill the Enquiry Form")
            End If
            conn.Close()
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

add this function :

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 btnAccept_Click()

Dim OpenFile As Integer

OpenFile = FreeFile

'Create and write to .ini file
Open App.Path & "\HistoricalPlayback.ini" For Output As OpenFile
    Print #OpenFile, "File Configuration: " & txtFFP
    Print #OpenFile, "Database Configuration: " & txtDBFP
Close OpenFile

[B]If FileExists(txtFFP.text) = True And FileExists(txtDBFP.Text) = True Then
    MsgBox "File Path is Valid"[/B]
Else
    MsgBox "Enter Valid File Path"
End If
   
glbFilePath = txtFFP.Text
glbDBPath = txtDBFP.Text
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

>> i am succesfull in fetching the data and displaying it in the list in following way,
- post your code

Jx_Man 987 Nearly a Senior Poster Featured Poster

you want to create toolbar on windows explorer bar or you want to create toolbar on your project?

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> Does ne one knw how to create an uneditable text file ?
- Set text file attribute as ReadOnly.
>> check box in datagrid....
- I don't know about checkbox on datagrid, but you can use listview, there are check box option on listview properties.

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> who can give me the code for hangman !
Google will give it to you!

Jx_Man 987 Nearly a Senior Poster Featured Poster

what u mean in Vb.net??
I guess u means in Visual Studio.Net...
If yes then Vb.net and C# is the most popular.

Jx_Man 987 Nearly a Senior Poster Featured Poster

VB.Net Step By Step

Jx_Man 987 Nearly a Senior Poster Featured Poster

There are not difficult to start program with vb.net. If u know vb 6 then its will so easily cause there are not much different about vb.net and vb6.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi,

I would like to start a sub in 5 seconds from now. The sub will need to perform only once. Should I use the timer event or there better way ?

Thank

Dillen

If u didn't want to use timer, u can use sleep...
System.Threading.Thread.Sleep(milliseconds)
Ex :
System.Threading.Thread.Sleep(5000) -> Delay for 5 seconds

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> IS THIS CODE WORKING FOR U ???
Yes...Its working for me.

>> WHEN I INSERT A RECORD , THEN THE NUMBER IS NOT INCREMENTED TO NEXT RECORD
Call that procedure after inserting data

>> EVEN IF I LOAD MY FORM AGAIN I SHOULD GET TO SEE THE NEXT NUMBER BUT IT STARTS AGAIN FROM 1, THAT VIOLATES MY PRIMARY CONSTRAINT
Check your database. If your data was inserted then it should working.

And please don't use capital letters. I am trying to help you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

getconnect() is Function to connect to sqlserver.
put this code in module. my module named Koneksi

'In Module
'Declare outside of class
Imports System.Data
Imports System.Data.SqlClient

Module Koneksi
    Public conn As SqlConnection
    Public Function GetConnect()
        conn = New SqlConnection("server = MyServerName;database = MyDatabaseName;Trusted_Connection = yes")
        Return conn
    End Function
End Module
Jx_Man 987 Nearly a Senior Poster Featured Poster
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 :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

This some files to import :

Imports System.Data
Imports System.Data.SqlClient

what kind of error ??

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :

Public Sub GenerateNotaId()
        Dim myReader As SqlDataReader
        conn = GetConnect()
        conn.Open()
        Dim temp As String
        Try
            Dim sql As String = "SELECT MAX(IDNOTA) AS 'KODE' FROM Nota "
            Dim comm As SqlCommand = New SqlCommand(sql, conn)
            myReader = comm.ExecuteReader
            If myReader.HasRows Then
                While myReader.Read()
                    temp = myReader.Item("KODE") + 1
                End While
            End If
            myReader.Close()
        Catch ex As Exception

        End Try
        conn.Close()
        If temp = 0 Then
            txtNoNota.Text = 1
        Else
            txtNoNota.Text = String.Concat(temp)
        End If
End Sub

Generate will shown in txtNoNota

Estella commented: Siip, this what i looking for :P +1
ITKnight commented: Great Code +1
Naruse commented: not bad +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

This an example :

Dim conn As SqlConnection
    Dim cmdCustomer As New SqlCommand
    Dim daCustomer As New SqlDataAdapter
    Dim dsCustomer As New DataSet
    Dim dtCustomer As New DataTable

    conn = GetConnect()
    conn.Open()
    Try
        dsCustomer.Clear()
        dtCustomer.Clear()
        cmdCustomer = conn.CreateCommand
        cmdCustomer.CommandText = "SELECT * FROM Customer where IDCustomer = '" & Trim(txtIdCustomer) & "'"
        daCustomer.SelectCommand = cmdCustomer
        daCustomer.Fill(dsCustomer, "Customer")
        dtCustomer = dsCustomer.Tables("Customer")

        If (dtCustomer.Rows.Count > 0) Then
            txtNamaCustomer.Text = dtCustomer.Rows(0).Item(1)
	    cmdButton.enable = False
        Else
            MsgBox("Can't Find Id customer!!")
            txtPlatNo.Focus()
        End If

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

Welcome Aboard Stuart...

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 Jim...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb friend :)
Hope you will find what u need...

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)
>> Looking forward to learn
You just on the right place
>> share my learning whenever possible.
Many members need your help ;)

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 :)