Try
con.Open()
MsgBox(con)
qry = "Select sum(slpri) From sales where slsnum > '" & 10000 & "'"
cmd = New MySqlCommand(qry, con)
dr = cmd.ExecuteReader()
If dr.Read() Then
sum1 = (dr("slpri").ToString)
stotxt.Text = sum1
End If
con.Close()
Catch ex As Exception
MsgBox("ERROR:" + ex.Message, MsgBoxStyle.Exclamation, "ERROR")
con.Close()
End Try
John_92 0 Newbie Poster
Reverend Jim 5,224 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.