Home > Net >  Vb.net char controls
Vb.net char controls

Time:09-20



Private Sub Form7_Load (sender As Object, As EventArgs e) Handles MyBase. Load
Dim SQLTXT As String
Cn=New SqlConnection (lj)
SQLTXT="select date, water temperature, turbidity from yssj order by date"
Da=New SqlDataAdapter (SQLTXT, cn)
Dt=New DataTable
Da. The Fill (dt)
Chart1. The DataSource=dt

'Chart1. DataBind ()

Chart1. Series (0). XValueMember="date"
Chart1. Series (0). YValueMembers="water"
Chart1. Series (1). XValueMember="date"
Chart1. Series (1). YValueMembers="turbidity
"End Sub

Consult everybody a great god, and the above code in Private Sub Form7_Load, can realize the function of the above, but the same code in Private Sub Button1_Click, want to use the button no response, this is what reason!!!!!!!!!!

CodePudding user response:

Can't, you see the debugged, click on the button have triggered,
Estimates may before you define multiple Button1_Click, pointed to the another function for the button is,

CodePudding user response:

Did see Chart1 DataSource=dt, dt data

CodePudding user response:

reference 1st floor horizon82 response:
, it's impossible you debugged, see click on the button to have triggered,
Estimates may before you define multiple Button1_Click, pointed to the another function for the button is,


Did not define functions, simple code above

CodePudding user response:

refer to the second floor of guiyang horse Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:
see Chart1. Did the DataSource=dt, dt data


Dt data

CodePudding user response:

reference zja6 reply: 3/f
Quote: refer to 1st floor horizon82 response:

Can't, you see the debugged, click on the button have triggered,
Estimates may before you define multiple Button1_Click, pointed to the another function for the button is,


Did not define functions, it is a simple code above


Can you put the chart with so well, in principle should not be such a mistake! First you double click on the button to enter in the designer for the click event (the default), then copy the code above, do not include private sub... And end sub.