K
K.N.Ranjit
Here's my coding again:
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\Documents and
Settings\rvish\Desktop\trverse.mdb;Persist Security
Info=False")
rs.Open("select Easting,Northing,UserID from
trverse order by cint(UserID)", cn,
ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal
e As System.Windows.Forms.PaintEventArgs) Handles
MyBase.Paint
For i = 0 To rs.RecordCount
x1 = Val(CStr(rs.Fields("Easting").Value))
y1 = Val(CStr(rs.Fields("Northing").Value))
pt = New Point(x1, y1)
rs.MoveNext()
x2 = Val(CStr(rs.Fields("Easting").Value))
y2 = Val(CStr(rs.Fields("Northing").Value))
pt2 = New Point(x2, y2)
e.Graphics.DrawLine(Pens.Green, Me.myconversion
(pt), Me.myconversion(pt2))
Next
rs.Close()
End Sub
Private Function myconversion(ByVal temp As Point) As Point
Return New Point(temp.X, Me.ClientSize.Height -
temp.Y)
End Function
In this case I really know that there is no such error in
my coding.I dont have any design or runtime error,only
thing is that the lines are not been drawn on the form.
I really don't know why.I would be very thankful to anyone
who could point out my mistake if any.I'm facing this
problem b'coz I'm new to this VB.net.
Kindly request u to provide me the coding.
Database : Access and I have plenty of records inside.
Ranjit
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\Documents and
Settings\rvish\Desktop\trverse.mdb;Persist Security
Info=False")
rs.Open("select Easting,Northing,UserID from
trverse order by cint(UserID)", cn,
ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal
e As System.Windows.Forms.PaintEventArgs) Handles
MyBase.Paint
For i = 0 To rs.RecordCount
x1 = Val(CStr(rs.Fields("Easting").Value))
y1 = Val(CStr(rs.Fields("Northing").Value))
pt = New Point(x1, y1)
rs.MoveNext()
x2 = Val(CStr(rs.Fields("Easting").Value))
y2 = Val(CStr(rs.Fields("Northing").Value))
pt2 = New Point(x2, y2)
e.Graphics.DrawLine(Pens.Green, Me.myconversion
(pt), Me.myconversion(pt2))
Next
rs.Close()
End Sub
Private Function myconversion(ByVal temp As Point) As Point
Return New Point(temp.X, Me.ClientSize.Height -
temp.Y)
End Function
In this case I really know that there is no such error in
my coding.I dont have any design or runtime error,only
thing is that the lines are not been drawn on the form.
I really don't know why.I would be very thankful to anyone
who could point out my mistake if any.I'm facing this
problem b'coz I'm new to this VB.net.
Kindly request u to provide me the coding.
Database : Access and I have plenty of records inside.
Ranjit