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.
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.
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
First block all line of code then press the button on bar. See the pic
you can add reputation on Dnx, just click on Add to Dnx's Reputation and fill the message.
>> 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
Dim temp, quantity As Double
Console.Write("How many liters (only whole liters please ) ? ")
temp = Console.ReadLine()
quantity = Double.Parse(temp)
>> "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.
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.
>> 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.
See this site....
There are all about connection string to databases..
Just looking what you needed there.
post your own code? so we can help.
ithelp was give the best answer...
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
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
number variable not increase.
alternative, you use WindowsMediaPlayer to play media file.
See this tutorial :
- http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html
- http://www.vb-helper.com/howto_make_standard_dll.html
- http://www.boondog.com/tutorials/dlltutor/dlltutor.htm
Just do some googling.
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
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
>> i am succesfull in fetching the data and displaying it in the list in following way,
- post your code
you want to create toolbar on windows explorer bar or you want to create toolbar on your project?
>> 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.
VB.Net Step By Step
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
>> 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.
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
Hi...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb Friend :)
This some files to import :
Imports System.Data
Imports System.Data.SqlClient
what kind of error ??
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
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()
Hi...Welcome to Daniweb Friend :)
Hi ...Welcome to Daniweb Friend :)
Hi Jim...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb friend :)
Hope you will find what u need...
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 ;)
Hi...Welcome to Daniweb Friend :)
Hi...Welcome to Daniweb friend :)
Hi...Welcome to Daniweb friend :)
Hi...Welcome to Daniweb friend :)
Hi...Welcome to Daniweb Friend :)