Hello everyone,

I am using

ExecuteNonQuery()

to execute a SQL command that inserts data into a SQL Server 2005 Database. I want to return the number of rows affected. I've read that this method returns the value, but I can't figure out how to access it. Help is very much appreciated.

Thanks

int rowsCount = cmd.ExecuteNonQuery();

Thank you much, that was super simple.

:) just something that is simple, right?

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.