I have a number of tables that together make up a "Test" that somebody can take. There are multiple types (scripts) of Test a person can take. I'm working on an Edit function that will allow somebody to edit the Test Questions. I want these edited questions to show up on all new Tests of that type, but still show the old questions when viewing past test scores.
To do this each "Test" has a TestId auto-increment identity (along with its name). When a test is edited I want to make a copy of the test with a new TestId and present the questions for editing.
So what is the best way to make the copy and insert it into my table using LINQ to SQL? This:
DataContext db = new DataContext(ConnectionString); //Copy old test into identical new test but with a different script ID var oldScript = db.TestScripts.Single(ds => ds.TestScriptId == oldScriptID); var newScript = oldScript; db.TestScripts.InsertOnSubmit(newScript); db.SubmitChanges();
of course tells me that I Cannot add an entity that already exists.
Is the only way to do this to go through every column in the TestScript and copy it manually, then insert it, and the database will give it a new Id?
I have GridViewA on page1.aspx and GridViewB on page2.aspx, how can I copy the data from GridViewA to GridViewB ?? and then the data of GridViewB save to database table,
how I can transfer the text from the txtText1 Textbox to the txtText2 one when I press the btnCopy button, but preferably in the codebehind so that I can change the text before actually copying?
i am trying to export gridview into dataset using Datatable but if u used "Microsoft.Office.Interop.Excel" the datatable showing me sum error. is there any other way to export gridview in dataset???
I've got a Gridview which has a datasource to a particular database.
I've got a DetailsView which has a datasource to a table in another database.
when I select a Gridview row, I need to populate a field in the DetailsView with the Primary Key field (showing in the Gridview) from the Gridview.
Can this be done (if so, how?)?
Also (but not as important) :
If there's no field related in the second table, I'd like it to come up in Insert Mode - if there is a field related, I need it to come up in Edit mode
I have an aspx webpage with a databound DropDownList and a databound GridView control. The GridView datasource is using a WHERE clause to return its' data. I.e. The user selects a work area from the DropDownList and members of that area appear in the Gridview. The GridView has 3 columns, WrkArea, LastName and FirstName. The page also has a Button.
What I am trying to accomplish is when the user clicks the Button, the data from the GridView is copied to a separate SQL table. I am working in VB. I have been looking at other posts but have to admit, I am really confused.
I have a gridview and the content of the gridview are EMPLOYEEID, SALARY, DEPARTMENT and I have one textbox and the id of it is txtEmployeeID. Now the question is if I'm going to type in the txtEmployeeID, it will be the same in the textbox inside the gridview.
And the gridview what I'm taking about is: [URL] ....
I have gridview of many records, i want to disable users Ctrl+c, Ctrl+v, Ctrl+x and right click on gridview so that he would not able to copy my data, either tell me method to disable Ctrl+c, Ctrl+v, Ctrl+x and right click in full web page or in gridview...
I am working with GridView/TelerikGrid control. It is having filter option. When I filter the data, I need to copy only filtered rows into Datatable for further processing.
Suppose I am having total 10,000 records. and when I filter on column say Dept="IT", I get 1000 records in grid. So these 1000 records only should get copied into Datatable. So How to achieve this ?
Cwhat can be done over this ? I tried number of properties for grid. But there is no property which will return fileterd data source. Also I am not able to go every page of Datagrid and collect the data. I can get data for first page only. If I need to collect the data by going to every page of gridview, what is the way for this ?
have a page that has a results gridview where I have all rows with a chekbox. when I click on the checkbox I try to create an excel filethis is method content:
DataTable MyData = new DataTable(); //recorrido sobre los elementos seleccionados6 foreach (GridViewRow row in gvwDbf.Rows)
[code]...
The problem is that excel file is totally empty. When I trace on the error I find that (item on bold above) dt datable has current record as I expected but Mydata table has nothing inside. shouldn't I use import statement? How can I get the row copied? I intend to have a full table made by every record coming from parameters of each query which is performed inside a for each sentence
i m binding data to Gridview using LinQ i need to sort the Gridview i have no idea how to sort cs i m using LinQ to Bind data with Gridview at Button Click.
Does anyone have a solution/link for copying contents of a GridView/Datatable (web application aspx)to the clipboard, so that I can paste inside Excel?
I've tried searching around but only found solutions for a Forms application.