Hai,
I don know how to store data from datagrid to SQL database. I also don know how to find the number of records in dataset or datareader.

for an example

myCommand = New SqlCommand("Select * from discounts", myConnection)
dr = myCommand.ExecuteReader()

How can I know whether there is any record in dr.

Help me out.

dr.hasrows

to insert data in the database u can use the insert query or use datatable for it

Hai
I tried out the syntax
dr.hasrows
It worked out well.

I have inserted datas from textboxs,combobox to database.but i don know how to insert data from datagrid to sql server. can u help me out

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.