I have created a web project using asp.net and visual web developer 2008. On my local project I created a new column in one of my MS SQL data tables and populated it with data. How would I create a sql script of the new column and data? I want to insert this into my live database on Godaddy?
I'm creating dynamic table which having more than 20 rows and number of columns can be change according to user input. first column is header and other columns need to bind using data returning from web services. And there are few rows which can editable. when user click on submit button need to validate the changed cells and process the data.I have created ASP.net table and added rows and cells one by one. but this is not reusable way of doing, is there any alternative to create editable dynamic table with left column as header?
i'm writing an asp.net C# web application; i have an in-memory datatable named 'table1' having three columns 'country', 'productId' and 'productQuantity'; i want to pivot that table in order to obtain a new table (suppose 'table2') having the first column 'country' as a fixed column and a dynamic number and names of columns 'product_1', 'product_2', ..., 'product_n' according to the total number of products existing in 'table1'; the first column 'country' must contain the country name; the dynamic generated columns 'product_1', 'product_2', ..., 'product_n' must contain the productQuantity that has been selled for each specific product in the specified country
i'm using Linq query expressions to write the code; the problem is that i cannot hard-code the names neither the values of the products; i cannot predict how much products exist in the datatable;
for now, i'm testing the results using the following expression :
i'm giving an example on how 'table1' looks like and how 'table2' must look like :
view example image of the two tables table1 and table2
I am quite new to LINQ, and I am stuck with this probably basic problem, but haven't been able to find a solution, so I thought I could ask here.
So, I have this repository where I put my functions for data accessing, and now I need to write a function to get all the applicants that have applied for this particular advertisement, and their values too. Now, the values are stored in a separate M:N table, where every row consists of the applicantID,advertisementID and value. I just wanna append the value to every applicant that I show, so that it would look like a Ranking List.
However, I do not seem to know how to select just the name column from the Applicant table, and just the Value column from the ApplicantValue table.
And there's this Iqueryable interface that further confuses me...
Here's my function to get the Applicants only:
Now, if I try to add to the definition of the type two columns, it says that it only messes with types, i.e. one type should be passed. So I figured I would do a ViewModel and then pass it, like this
and then in the function I have no idea how to pass the values:
I'm currectly tryin to access a specific value in my database in a specific column. I'm tryin to use the primary key of the table to access the actual value in the row of that ID.
The current code:
Just iterates through the table and looking for any row with the boolean 'checkin' value is True, then it takes the 'id' value of that row and stores it into an array. Is there a way that I can access a another entry, and only that entry, in the table with the 'id' stored in the array?
Like if my data base contained and int, primarykey, `id` value, a boolean, `checkedin` value, and a `time` value, is there a way to access, lets say, the row with `id` equalling 3 and and the checkIn value from that row?
I am creating dynamic view using two tables.one is emp_Tbl and 2nd table emp_salary which is created dynamically .creating view it gives error 'Create View or Function failed because no column name was specified for column 2.
my code is: create view [dbo].[Emp_Salary_pay] as select dbo.Emp_Tbl.Emp_Status, (select column_name + ', ' from information_schema.columns where table_name = 'Emp_salary' ) FROM dbo.Emp_Tbl INNER JOIN dbo.Emp_Salary ON dbo.Emp_Tbl.Emp_Id = dbo.Emp_Salary.Pay_Emp_Id
I am working on a web app for an online photo album. It is the last project in Scott Mitchell's book: "ASP.Net 2.0 in 24 hours".
I am creating a page where users can enter new photo images. The functionality for uploading an image will come later. I am working on just inserting a new row into the Pictures table with an optional category, a required title and a required description.
I am getting an error when I try to insert a new row.
Here is a screenshot of the page with a shot of the dropdown list.
The Categories are user-specific. I am getting the correct values retrieved.
There are two pretty simple database tables involved here.
NOTE: The CategoryID and PIctureID are both autoincrement integer columns.
The page uses a DetailsView that uses a SqlDataSource that uses the Pictures table. (The DetailsView's Default Mode property is set to "Insert". The "Enable Inserting" checkbox is also checked.)
The dropdown list uses a dropdown control that uses a SqlDataSource that uses the Categories table.
When the "Insert" button is clicked the CategoryID value associated with selected (Category) Name on the dropdown list will be used along with the Title and Description values to insert a row in to the Pictures table. (If no Category value is selected, then a null value will be used for the CategoryID. This is OK because the CategoryID column in the Pictures table allows nulls.)
My problem is that I am getting this error:
Cannot insert explicit value for identity column in table 'Pictures' when IDENTITY_INSERT is set to OFF.
(FYI: I have the full version of both Visual Studio and SQL Server.)
I'm assuming I need to use a pivot table from what I've found so far. However, every one that I've seen has not had the date setup like I have.
I have a Gridview on my page which I need to be populated like so
I want to do this for 10 months... bottom record being the current month (or last month). I would also like the Date to format to January 2010 I used the above date format because that is how it is in the table. Basically, I need to know how to create the pivot table to search the table for 1/*/10, 2/*/10, etc
I am dynamically creating a table that contains a textbox in each cell. The table is put in a placeholder control. Everything displays perfectly. The problem is when I go to retrieve the values entered in the cells. I have the code to generate the table in a separate method called CreateTable(). In order for my program to find a table in the placeholder when I go to save, I have to run CreateTable() in a postback event AND in the PageLoad event. If I call CreateTable() in only one of those places and I try to save, it says the placeholder is empty and, therefore, I cannot save the textbox contents. I've tried calling CreateTable() from InitLoad but that doesn't work because it needs to reference values from three static controls: 1 dropdown, 1 listbox, and 1 calendar control, which I don't believe have had their viewstate rendered yet.
I want to set the coulms size of all the columns in the table in the DB based on the maximum width/size of one of those columns of that particular table That is if I have three columns Name(nvarchar 50), Address(nvarchar 70) and Description(nvarchar 100), then I want Name and Address to also be nvarchar 100, can anyone give me the code for the same in VB.
I have a repeater which is populated by a User Control that defines a single row of the repeater. Each row in the repeater represents a row in a SQL table which has an Identity column as the primary key. In the first column of the repeater I have buttons to Update or Delete that row of the repeater. I need a way to store the identity column value in the repeater so that I know which record in the table to Update or Delete when the user so chooses; However, I don't want to show that arbitrary identity value to the user. Is there a way to store the Identity column value in the table but not have it visible to the user?
I'm curious as to whether there is a well known way to add a column to a SQL table as a global change in MVC 3.
"Global change" referring to adding a column from database to UI... can someone please outline the fundamental steps. (i.e., 1. add column in SQL table. 2. update .edmx (replace relative tables) 3. ...)
I'm currently switching over to ASP.NET MVC and have ran into a problem. I have a list of items (e.g. a list of names) that I would like to display in a table. I would like to display it down a column, before starting onto next column.
I have tried a nested for loops for mark up of <tr/> and <td/>, and am getting undesired results.
I´m looking for some advice on how to create an table showing bookings, a table containing mon-sun on the horizontal axis and times at the vertical. The admin is able to edit each days bookable times (first bookable time, last bookable time) - The slottime is constant.
What I want is let the admin click on eacha cell to remove it/add it when removed. And other features as well, like create an booking for a customer.
What would be the easiest way to achive this, at the moment I use dynamic links since I cant get asp:buttons to work and the code to create an dynamic asp:table row by row and this produces some ugly code.
So any advice on how to achive such an "schedule".