DataSource Controls :: An Entry With The Same Key Already Exists?
Feb 21, 2011
i'm working on a SqlDataSource object, it has a deletecommand which is ( DeleteCommand="delete albums where albumid=@albumid") but whenever i try to delete a record, where albumid is an identity primary key column, i receive the following error message , An entry with the same key already exists. but there are no duplicate records, i wonder why i receive this msg, may i pls mention again AlbumId is a Primary Key Column with Identity(1,1)
View 1 Replies
Similar Messages:
Oct 15, 2010
I have 2 tables:
- Salesmen with Pk.SalesmenID
- Appointments with Fk.SalesmenID and busy(bit)
How can I check if every salesmen has at least one appointment
Am I on the right way with statement below, though I got syntax problems
[Code]....
View 5 Replies
Apr 8, 2010
how can i insert 'null' value in numeric column if no record is there.when i pass record to BLL like
MyCollegeAddmissionMst.GraduationYear = IIf(txtGrdyear.Text = String.Empty,
"", txtGrdyear.Text.Trim())
datatype is numeric(4,0) then error is Conversion from string "" to type 'Integer' is not valid. no record is in this textbox and i need to entry null value.so how can i do the same.
View 27 Replies
Jul 21, 2010
how can i show only the last INSERTED data entry made in SQLSERVER? And show that entry in a gridview but not all of the entries at once only the last one made.
View 1 Replies
Jun 4, 2010
I want to be able to display the entries in this table based on the date and time of recorded in the entry.
So as an example:
Entry A only appears on Mondays at time X.
Entry B appears on Tuesdays at time X and Sundays at time X.
Entry C appears every day of the week at time X.
Entry D appears every day of the week but twice on each day at time X and y respectively.
View 2 Replies
Jan 31, 2011
I have to create a simple application which scans, displays and stores the info from a barcode. I have been able to sort the scanning and display part of this application but I need to know how to store the infromation entered into a textbox to a database and then be able to display the stored data as a list at a later stage.E.G. Once the "STORE" button is clicked, the information/text within the textbox is stored to a database. Once the "VIEW STORED DATA" button is clicked, the stored information in the database is displayed as a list.I am a complete beginner when it comes to creating web applications using asp.net. Also, the type of database to use (i.e. sql, wamp.etc) and how to link it to my application is also puzzling.
View 1 Replies
May 14, 2010
best Way to find out if record exists?
[Code]....
View 2 Replies
Nov 4, 2010
I am still in the same project. Its been so hard to complete it. Always one or other problem.
I am using sqlserver 2005 and vb.net and vs2008- not that any of this matter for this question.
My problem is that I couldnt' check if the record exisist in the db. How do I do it.
I have fileupload control but I want to check my db if the filename already exisit.
Thi sis my code.
[Code]....
View 1 Replies
Jan 6, 2010
Just have a problem, I want people to join a mailing list, I just have a textbox and button. When a user enter's their email address, the address and time are inserted into a database. However, if the same email is added again I would like for a message to appear saying the record already exists.
Can someone show me how to do this, here is my current code:
[Code]....
View 3 Replies
Jul 12, 2010
I am using Microsoft SQL database, C# and stored procedures. How would I check if record exists on the form or in SQL. I will design a from that has employee name, id and 3 other fields.
If record exists (I could for example test if EmployeeId exists, and then display a message saying that "record already exists". Should I do it in Stored procedure or in code?
View 4 Replies
Jun 9, 2010
I need to somehow test if a table exists in a database. If it does not then I need to create the table. How can I test for existence of a table using SQL? It seems like some type of SQL logic is needed?
View 2 Replies
Apr 17, 2010
I want to check if an sqlparameter exists before adding a new one so I don't get the error - @param was supplied multiple times. IS this possible?
View 7 Replies
Jan 5, 2010
how to check if the particular values in a table exists?
if it is not existing i need to insert that values in the table?
View 4 Replies
Mar 29, 2010
Consider I am using 3 fields staff id, staff name and phone no. Staff id is a primary key. I want to get a error "the record already exists" if there is already a record in the same id when i am clicking add record button. (Plz give the full coding including stored procedure for insert).
View 4 Replies
Jan 5, 2010
I have a "simple" method that takes a Linq entity containing the information I want to update. The method then creates a list of counties the information is to be updated for, and tries to update the information for each county.
So user goes in fills form out selects update All counties, and the information in the form should be updated for all the counties for the member. Here is the code.
[Code]....
The first pass through the foreach runs perfectly, the second time through I get an error: Cannot attach an entity that already exists.
What is best way to work around this?
I have though about putting the foreach loop in my business_logic layer, and have it pass both the newRecord and OldRecord, but figured I would ask, before making the code change.
View 1 Replies
Dec 13, 2010
I would like to check whether a folder exists or not if not create. I'm sure this folder exists, but for some reason I get "false" when I check with "Exists" method.
The only reason I think could be because of the W: drive? I moved this application to production site and even there it returns false.
while I'm type in Windows explorer on my localhost and on the server "W:/Webs/ASPPages/cropper/uploads" it opens this folder. So my localhost and IIS server has W: mapping.
for test I tried to create the folder then it says can't find the path...
userFolderName = @"W:/Webs/ASPPages/cropper/uploads"
//I also tried @"W:WebsASPPagescropperuploads"
//I also tried @"W:WebsASPPagescropperuploads"
//I also tried "W:\Webs\ASPPages\cropper\uploads"
DirectoryInfo dirInfo = new DirectoryInfo(userFolderName);........
View 3 Replies
Sep 9, 2010
I have designed a page where user can write messages and send within a group but i want that if they enter any special character like <>?#@ etc a msg should be displayed irrespective of the crashing of the page.
View 3 Replies
Mar 15, 2011
I have a simple web form with controls such as test boxes, radio buttons, etc. I also have an empty SQL database created from within Visual Studio Express 2010, in the same project. I want to be able to open the web form, enter text, for example, in a text box, and have it saved in the corresponding field in the database. Ditto with the choice I make from a Radio List box, etc. Is there a simple way of connecting a control on a form with a field in the SQL database? I've tried a number of ways but can't seem to do it, though I realise it must be simple. I also think the control need to be in data entry mode, if there is such a thing, rather than automatically looking for data within the database to display (there is none). I'm new to SQL server and ASP.NET in general, though I've been through a lot of the excellent video tutorials etc.
View 8 Replies
Dec 7, 2010
my C# web application contain accessing of database on the basis of datas selected from a dropdown list.. and my pblm is i cant access the first entry from the dropdown, dropdown list contains different dates,when user select one date from dropdown it will redirect to another page.. the page shows details from database on the basis of this particular date.....my C# dropdown's selected index changed code is shown below:-
[Code]....
and HTML code corresponding to this is:-
[Code]....
i cant access the first data from dropdwn,even it cant redirect to target page.. other entries (the 2nd 3rd entrie etc) was accessible and it shows the details from database on the basis of that corresponding value(usually some date).
View 4 Replies
Apr 30, 2010
I have a web page with a Form a Button, a TextBox and a DataGridView in it. The DataGridView uses a SqlDataSource as its data source. SqlDataSource has one parameter which gets it's value from a
form parameter (TextBox1). When the page is opened for the first time I set the TextBox1 default value in code behind:
protected void Page_Load(object sender, EventArgs e)
View 4 Replies
Feb 24, 2010
i have upgraded the requirement entry screen with some new values. I can able to insert and update the values for new entry. But if i'm trying to update the old entries the datareader does not fetching the values from database. please provide me some tips regarding the datareader
View 2 Replies
Feb 28, 2011
How to validate user entry to cell in GridView and replace the cell value on the other column?
Ex :
i have a gridview with 2 columns (A & B), on both columns i change it to TemplateField (TextBox).
Now on whatever row on column A, i want to validate the user entry when user leave the cell, how to achieve that ?
Based on user entry on column A, i will do some data lookup and get a value returned from the server, how to tell the gridview to replace the value on column B (on the same row) based on the value returned from the server.
View 16 Replies
Mar 26, 2010
I have a detailsview form which passes data to a sql database. What I'd like to do is present a message when the number of rows in the destination table exceeds a specified number (40) or redirect the user to another page.
View 1 Replies
Nov 11, 2010
I working on a ASP.net project, database is MS SQL
for a reason that cannot find why, when I insert an entry to the data base, the entry is duplicated.
The controll runs this:
Protected Sub grdCustomer_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdCustomer.SelectedIndexChanged
Dim Quote As New QuoteBLL
Dim Customer As New BeeSafeShutterSystemTableAdapters.CustomerTableAdapter
[Code]....
View 3 Replies
Mar 11, 2010
I have Gridview that is populated from a data table, there are two additional template columns which are not bound (one checkbox and one textbox). I intend for the users to fill data in the unbound textbox and check the checkbox as needed. (there really is a good reason why the data is constructed in this way)
here is the problem, when the user enteres data into the textbox and hits enter, the gridview appears to postback, which wipes out the checkbox and the data in the textbox.
I tried setting the enable view state of the grid to false, that was supposed to stop postback but no luck. I have the enable view state of the textbox and checkbox set to true and autopostback set to false. but still no luck
so I need to either stop the postback or intercept the enter key in the text box and cancel the action, but that is a bit beyond me at this point
View 8 Replies