I have a webform (parent) with embedded webgrid(child) which uses sqldatasource. What I wanted to accomplish is to save both the form data and the grid data when the Save button is clicked. I tried to save form data(parent) in sqldatasource1_inserting event, does not work. I think there should be a way to do it, just do not know how.
In the above XML file I want to retrive the "NAME" attribute of the SECTION node with the condition MIMIC ID="1". I dont want to modify my existing XML file. I have the server collection of node with simialr elements as the above XML file.
I have a table that needs sorting by its hierarchial structure of parent-child.
An example of my table is below
As you can see above, my table structure follows this pattern
My overall aim is to have the sql order the table for me, and by using this new "depth" column, I will be able to indent by categories in the menu on the front end, you have probably seen this before, but all the tutorials I have read dont really explain it very well, or assume you are sql savvy.
i am trying to delete using Gridview from child first and check if there is no child to delete in parent table i am using sql datasource in the delete tab in sql datasource i put DELETE FROM table1 WHERE (IDtable = @IDtable) IF (SELECT count(*) FROM table1 WHERE parent_dtl_id = 66) =0 BEGIN delete from parent_dtl where order_dtl_id= 66 END
i deleted all items,deleting from 2 tables child and parent was successfully on the last row from gridview but i have this error on my page on the last delete Specified argument was out of the range of valid values. Parameter name: value
I have two tables dept and employees those table have parent and child relation ship link column is deptno i want to delte department even this departmetn contains employees i want to write storedprocedure for first delte employees and after department if i wrtie these two querys in storedprocedure will i get any problems
Begin Delete from tbl_employees where Department_Id=@Department_Id Delete from tbl_Department where Department_Id=@Department_Id RETURN END
Simple and blunt: my cascading dropdownlists clear when a postback occurs. Does anyone know a quick way around that?For more information, read on...
I have 5 dropdown lists that define a training class location and line of business: Site, Parent Client, Client, Program, Project I'm trying to build cascading dropdownlists that can work from any direction (i.e. select a site and all other lists are filtered by site...select a project and all other dropdown lists are filtered by project). I've built the SQL Select statement behind the lists that filters (accurately).
1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like
SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.
Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).
2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query
(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).
If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.
In my website I have two forms: parent form and child form(dialog box). Their expected behaviour is like this: if clicked on 'show' button on parent form, a dialog form opens that displays a gridview. In dialog form, if clicked on 'select' button it closes itself and returns value in selected row back to parent form.
To achieve this I write following code (.cs) : in parent form:
void ShowBtn_Click(object sender, EventArgs e)
StringBuilder jScript = new StringBuilder(); [code]....
Now problem is: the code in parent .cs works fine, it opens the dialog properly. But when clicked on 'select', instead of returning back to parent, it opens the same dialog again in new window. This newly open window says "Done but error on page" at left bottom.
I have a webform which opens a child window, a button on child window closes the present child window and opens a subchild window. Now a button on subchild should close the window and refresh the parent form.
I am new to xml, i want to looping through the below xml and save the records in the database. the below xml is parent child combination, parts as to be saved under respective parents. if the source field is M then there will be child item for that.
In asp.net, I have a parent and a child control. Within the child control I have a dropdown list. Based on dropdown list's selected value I would like to toggle Visibility of Panel in parent control. For instance if I select Show in child control dropdown list, I need to pass true to parent control to make Panel visible and vice versa. How should I do that. I have read that can be done via the event handling and have seen certain scenarios but I am not clear on that.
i am working on POCO entities. i had a requirement to provide Edit feature for parent and respective Child records in single View.
Eg: Parent-Customer, Child-Order tables
when updating the parent entity by using => UpdateModel(CustomerIns);
and updating the child entity by using => TryUpdateModel(CustomerIns.Order, "Orders");
The Child Controls Names are like Orders.OrderID,Oders.OrderDate,etc
The Parent and Child Entities are updating when UpdateModel() is called but when saving Changes by calling Context.SaveChanges() i am getting exception like:
"The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted."
When I open two modalpopups, one over another, there is unexpected order.After click on "Open Parent Panel", and click on "Open Child Panel",Child Panel (newone) is under the Parent. [URL=http://img820.imageshack.us/i/un1f.jpg/][IMG]http://img820.imageshack.us/img820/5836/un1f.jpg[/IMG][/URL]Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]What should I do to get it in "normal order"?The code is: