TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
King Umar
NA
103
30.1k
guys..i got a lilttle problem with my code,can anyone help
Jun 23 2015 2:55 AM
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim myconnection As New SqlConnection
myconnection.ConnectionString = "Data Source=USER-PC;Initial Catalog=MiSInventory;Integrated Security=True"
Dim READER As SqlDataReader
Try
myconnection.Open()
Dim Query As String
Query = "SELECT COUNT(DISTINCT Category)AS NumCount FROM ItemAdd GROUP BY Category"
READER = Command.ExecuteReader
Command = New SqlCommand(Query, myconnection)
nDataAdapter = New SqlDataAdapter(Command)
ds = New DataSet()
nDataAdapter.Fill(ds)
TextBox1.Text = "ds.Tables[0].Rows[1][NumCount].ToString()"
MessageBox.Show("Data will be count")
myconnection.Close()
Catch ex As Exception
MessageBox.Show("Could not connect database: " & ex.Message, "Database Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
myconnection.Dispose()
End Try
End Sub
When i click the button count it says "object reference not set to an instance of an object"
Reply
Answers (
6
)
i want the code of sliding images with servlet-ajax calls
Regarding Blog Publishing