I feel executenonquery will return -1 only if it is a procedure if it is a inline query then it will return the affected rows. Just check in DB and let me know whether it is updating in tables or not.
Satish Mahapatra
Posts
-
procedure returning no data even though data is present in database -
clearing a asp:listbox takes too much of timeHw abt setting the datasource=null provided u are using the datasource property for binding the listbox.
-
Data spread over multiple columns instead of one in gridviewI think You should use Datalist for this case where you can set the RepeatColumns property and display the data.
-
Gridview total number of rowsCan you try with the paging to false and then check the recordcount after that u can make the paging as true.
-
how to display data in grid without sending the data in the databaseI tried your case,deleting the rows by clicking the delete button in each row.then i saved the PK of each row and finally during saving delete those rows by using the IDs. I just put a column for ID which has the commandargument set to id,on delete event i was getting the IDs by this int rowIndex = e.RowIndex; LinkButton lnk = (LinkButton)GridView1.Rows[rowIndex].FindControl("lnkID"); Is it the case that u are searching or anything else.
-
how to display data in grid without sending the data in the databaseWhy dont u store the IDs of the deleted records and during saving the grid to DB delete the records from DB using thoseIDs.
-
Help with Crystal Reports [modified]Try with button click event instead of pageload to bind the dataset to report and see
-
GridView and SelectedIndexChangedfor what purpose ur using the selectionchange event.may be it cant get the template inside the gridview.try it in rowcommand event i think it will work
-
populate GridView with stored procedurei told u to put that executenonquery statement before putting into adaptare.now u just debug the code and see in the binddata method what it returns in the dataset and tell me.
-
populate GridView with stored procedurecan u send me whole code and where exactly ur getting the error with error description.
-
to display checkboxes on the right side using template fieldmake the autogeneratecolumns="false" and add whatever columns u need in the columns section as boundfield or temp field watever u like.
-
populate GridView with stored procedureexecute the executenonquery before putting into adapter.
-
to display checkboxes on the right side using template fieldcan i see the code
-
to display checkboxes on the right side using template field<Columns> <asp:BoundField DataField="Country_ID" HeaderText="Country_ID" InsertVisible="False" ReadOnly="True" SortExpression="Country_ID" /> <asp:BoundField DataField="Country_Name" HeaderText="Country_Name" SortExpression="Country_Name" /> <asp:BoundField DataField="Continent_ID" HeaderText="Continent_ID" SortExpression="Continent_ID" /> <asp:BoundField DataField="Continent_Name" HeaderText="Continent_Name" SortExpression="Continent_Name" /> asp:TemplateField <ItemTemplate> <asp:CheckBox ID ="df" runat ="server" /> </ItemTemplate> </asp:TemplateField> </Columns> just replace < and > with< and > resp and try.
-
to display checkboxes on the right side using template fieldwhat man u have to just move the checkbox column to the last order in aspx code. say: Like that order only u have to keep.
-
deleting rows in gridview..Then i think put the data in an xml format or any dataset.whichever rows you select for delete, delete them from the dataset.Then bind it to Grid.
-
to display checkboxes on the right side using template fieldGo to .aspx page.In the gridview inside columns the column names alongwith it's properties are there.You just move that checkbox row to the last order.
-
deleting rows in gridview..Have you written the deletecommand in the property like deletecommand="delete from table where rowid=2 ";
-
how to filter distinct row from DataViewwrite like select distinct(auto)
-
Configure IIS7 in Vista to Run .aspx filesJust go thru the below link http://geekswithblogs.net/ranganh/archive/2005/05/13/39582.aspx