DataSource Controls :: Update Statement Using Linq To SQL?

Jun 22, 2010

I have a method to execute two "Update" sql statements.

The first one works fine and the second one I can't get to work for nothing.

Here is the entire method:

[Code]....

The error I am getting is "Incorrect syntax near '05'."

It is occuring on the next to the last line which is:

dc.ExecuteCommand(sql);

I update the variable "sql" first so I can debug. At the time it crashes the value of sql is:

"Update Blogs set Status = 'Archived', ArchiveDate = 06/22/2010 05:14:46 PM Where (BlogID != 1) and (Status = 'Published') and (AuthorID = 9e37e028-c205-4903-920e-e8643b30a724)"

It appears to be the ArchiveDate that is causing the problem here. The "05" is the hour of the time portion. Both ArcgiveDate and PublishDate are defined exactly the same in the database. If you look at the first dc.ExecuteCommand it does exactly the same
thing with PublishDate (DateTime column) in the same table and it works just fine.

Then I modifed the code and remove the ArchiveDate from the sql statement then I get the error:

"Incorrect syntax near 'e028'."

which as you can see is part of the AuthorIDs value in the where clause. So I am assuming both the date and the Guid / Author ID is causing problems. I have tried enclosing the values in quotes but I just cant make this work even though it seems to be working fine in other places.

I even remove the code for the author ID and left in the code for the ArchiveDate and it still does not work so I have proved that both are causing a problem.

View 1 Replies


Similar Messages:

DataSource Controls :: Linq - Update Statement Where Clause?

May 25, 2010

I am using Linq to SQL. Tables have timestamp columns and I am using regular Linq methodology in ASP.NET MVC.I do use detached entities and always try to do updates without first querying the database for the original entity. To update an entity I use context.Attach(entity, true) followed by context.SubmitChanges() and all is fine. The sql statement that gets executed looks like:

[Code]...

View 7 Replies

DataSource Controls :: LINQ Statement Can ShowTime In The DB

Apr 5, 2010

[Code]....

I must have a LINQ Statement does i can show if my Time in the DB <= as the Time where i become from my Session +60 Minutes ??

View 3 Replies

DataSource Controls :: Runtime Compilation Error CS1026 When Use Linq Statement?

May 5, 2010

We have an application developed on VS2008 [Asp.Net & C#], in this application we provide the facility to the user to write his/her business logic code. For that purposes we maintained a Businesslogic.cs file where user can write his/her code and our application build it as a BusinessLogic.dll file at runtime.

But the problem is when we introducing Linq statement/code into the BusinessLogic.cs file then it generated compilation error [CS1026 ].

Note that, when we build the dll from VS2008 environment then it working fine with the same code which we write into the BusinessLogic.cs & don't generated any compilation error.

View 8 Replies

DataSource Controls :: SQL UPDATE Statement Not Updating DB?

Feb 24, 2010

I am writing a simple form that will take in data and insert it into a db if it's a new record and update the existing record if it already exists. The insert works fine, but the update isn't working at all, yet the code looks solid to me and everything I've compared it to in my google searches.

[Code]....

View 7 Replies

DataSource Controls :: Update Statement With Inner Join?

May 5, 2010

I am trying to update a Single Record in a table. I also trying to join columns of that single record with another table to update prices the prices of that record.

Here is my current query.

[Code]....

View 2 Replies

DataSource Controls :: Syntax Error In Update Statement

May 31, 2010

myCommand.CommandText = "update Stutable set password as '" & TextBox2.Text & "' where rollno = '" & TextBox3.Text & "'"

View 21 Replies

DataSource Controls :: Create A Multi Column Listbox By Combining Fields In Linq Select Statement

Jan 11, 2010

I am trying to create a multi column listbox by combining fields in Linq select statement, as Let Name = Last + First. The problem is how to pad the Last column with spaces as you would in SQL using REPLICATE so when I bind the listbox to the data, it looks like two columns.

View 5 Replies

DataSource Controls :: (0x80040e14) Syntax Error In Update Statement

Jan 29, 2010

i built an oledb update stmt using the syntax from a 4 guys tutorial, http://www.4guysfromrolla.com/articles/071002-1.3.aspx , but am getting the above error

this is the update stmt

Dim strSQL As String = "UPDATE [orientationData] SET " & _
"[orientationTime] = @orientationTime, [targetAttendeeCount] = @targetAttendeeCount, " & _
"[locationRoom] = @locationRoom, [locationStreet] = @locationStreet, " & _
"WHERE [orientationDate] = @orientationDate"

sample how i build an update field into the update string

Dim targetAttendeeCount As Integer = _
CType(e.Item.Cells(0).FindControl("targetAttendeeCountTextBox"), TextBox).Text
Dim parmTarAttCnt As OleDbParameter = _
New OleDbParameter("@targetAttendeeCount", OleDbType.Integer)
parmTarAttCnt.Value = targetAttendeeCount
myCommand.Parameters.Add(parmTarAttCnt)

printing out the strSQL gives

sql string = UPDATE [orientationData] SET [orientationTime] = @orientationTime, [targetAttendeeCount] = @targetAttendeeCount, [locationRoom] = @locationRoom, [locationStreet] = @locationStreet, WHERE [orientationDate] = @orientationDate

so none of the variables are being resolved, i know they are being returned from, in this case a datagrid, because i have printed them separately, so am not sure at this point how to get the vars to resolve, i was hoping to not have to use all the quotes + apostrohes and thought the @syntax was simplifying that but not so. is there some way to code this with the @'s?

View 4 Replies

DataSource Controls :: Tableadapter Configuration Wizard Cannot Generate The Delete&update Statement

May 4, 2010

in generate the Stored Procedures when using Create TableAdapter configuration Wizard in VS.it can not generate the Stored Procedures for Delete and Update Commands, but it generated for Select and Insert. i tried many times, but still get the same problem.

View 2 Replies

C# - SQL Statement Transformed TO LINQ - How To Translate This Statement To A Working Linq

Mar 5, 2010

I am having trouble with this I have 3 Data tables i use over and over again which are cached I would like to write a LINQ statement which would do the following is this possible?

T-SQL VERSION:

SELECT P.[CID],P.[AID]
,B.[AID], B.[Data], B.[Status], B.[Language]
FROM MY_TABLE_1 P
JOIN
(
SELECT A.[AID], A.[Data], A.[Status], A.[Language] FROM MY_TABLE_2 A
UNION ALL
SELECT B.[AID], B.[Data], B.[Status], B.[Language] FROM MY_TABLE_3 B
) B on P.[AID] = B.[AID]
WHERE B.[Language] = 'EN' OR B.[Language] = 'ANY' AND B.STATUS = 1 AND B.[Language] = 'EN' OR B.[Language] = 'ANY' AND B.STATUS = 1

Then i would like it to create a result set of the following

Results:
|CID|AID|DATA|STATUS|LANGUAGE

View 3 Replies

Binding Different LINQ Datasource Using Same Variable With If Statement?

Nov 27, 2010

OK So I know WHY I am having the error I am getting. I don't know HOW to fix it. Basically, if the user doesn't have a certain permission, I need to join another table. But .NET is so picky I can't just make two different queries in an IF statement and then use it outside of the if statement. I can think of some ugly work arounds for this, but I would rather not. I am fairly new to .NET I know just enough to be dangerous.

[code]....

I get the error: Unable to cast object of type

'System.Data.Linq.DataQuery1[VB$AnonymousType_111[System.Guid,System.String,System.String,System.String,System.String,System.Nullable1[System.DateTime],System.Nullable1[System.DateTime],System.Nullable1[System.Guid],System.Nullable1[System.DateTime],System.Nullable1[System.Guid],System.Nullable1[System.DateTime]]]' to type 'System.Collections.Generic.IEnumerable`1[Ten11CRMLib.Company]'.

because of this: Dim l As IEnumerable(Of Company) its not just IEnumerable of a Company, its got the source in it. I have to explicitly select source to use it in my datagrid. Can I make Dim l something that will make it stop complaining?

View 2 Replies

DataSource Controls :: SQL LINQ Will Not Update Table

Apr 3, 2010

I am running the folowing simple test code:

[Code]....

But the UpdateUser field does not update - it remains at NULL. No errors occur. I can use similar code to update table fields in other dbmls successfully.

View 2 Replies

DataSource Controls :: Update A Database Row Using LINQ?

Apr 23, 2010

I have a table with Id, Name,...IsActive, etc. If user wants to delete a record from the user, he/she should update the field IsActive to false. I am able to acheive this functionality using the below steps,

1. Query the database for the row which is to be updated.

2. Update the property IsActive to false.

3. Submit the changes to the database.

This way i am successful. But i have a query here is that, when we execute steps 1 and 3, there will be two trips to the database for getting the required object and again updating the same object to the database.

Is this not a performance hit having multiple calls to DB for a simple operation.?

Do we have any other go, where in within a single call to database, can i update a field of row?

View 3 Replies

DataSource Controls :: Linq Update 2 Datacontext?

Mar 30, 2010

I'm studing Linq on TheBeerHouse Project,I would create a my Linq Version.I have a big problem with Updating, this i a part of source :

protected static ArticlesDataContext GetContext()
{
return new ArticlesDataContext(Settings.ConnectionString);

[code]...

View 2 Replies

DataSource Controls :: Good Way To Use Linq With Update Stored Procedures?

Jun 9, 2010

I like to use my own stored procs as much as possible.

That way I know exactly what's happening and I can explain and control things.

I'm using stored procs with LINQ to SQL for CRUD operations.

For select, insert and delete - using stored procs with LINQ to SQL is pretty straightforward.

However, if I want to use my own custom stored procs with L2S for updates what's the best way to accomplish this?

Can you provide some code that shows the best approach that you would personally choose for this?

View 1 Replies

DataSource Controls :: Update Query Via LINQ Not Working As Expected?

Jan 6, 2010

I have a form that gets populated by LINQ and I want to be able to update the database using that same form. The form is populated by grabbing a querystring (for example, "edit=10") and searching the primary key for that record. So far so good. I have a button attached to the function below which is supposed to use LINQ to update the database with data from the form. I get no errors, but for some reason, it is only updating one field (Last_Updated) instead of all of them.

[Code]....

View 7 Replies

DataSource Controls :: LINQ - Update Many Rows With Difference Values?

Apr 8, 2010

i want to update many rows with difference values inside table. i'm coding a timetable.

View 3 Replies

DataSource Controls :: Update Table Field With LINQ To SQL And Query String

Jul 11, 2010

I am trying to update my table ARTICLES and it has a field COUNTER, Everytime a user enter this ARTICLES, the page_load event runs a LINQ to SQL query taking the QueryString as parameter, increasing the COUNTER field in 1.

[Code]....

View 2 Replies

DataSource Controls :: Make A LINQ Databound Record Update Page?

Mar 15, 2010

I am creating a database frontend in aspx/C# using LINQ to MSSQL. It has two pages: a main page which lists all of the records, and a page that appears when the user click the "Edit" button next to one of the list items for the user to edit a record.The database table has about 70 user-editable fields. I need to make the edit page, allowing the user to update/insert records. There are a couple ways I can think of make an edit page:Using a LinqDataSource and FormViewUsing a LinqDataSource and DetailsViewManually retrieve the value for each field and set the value for each field directly from Linq (e.g. "projectIDLabel.Text = Convert.ToString(thisRecord.Project_ID)"What would be the best way to design this?

View 4 Replies

DataSource Controls :: Linq Update Via .attach() Giving Entity Exists Error?

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

DataSource Controls :: Linq To SQL Set Linq Object Propertychanged?

Mar 12, 2010

I am writing a plugin to help with a current ERP system we have that I am not allowed to modify the data structure at all. The table I am dealing with has over 100 columns and I am wanting to set my linq object propertychanged event and submitchanges or do I really have list out each property and set it equal to the new one?Below is an example of what I am trying to do:

[Code]....

View 4 Replies

DataSource Controls :: LINQ To DataSet And LINQ To Object

Mar 9, 2010

txtLastName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Last_Name.ToString();

Like that I have large number of controls on my form. I have dought, if I assigned like this, db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Last_Name.ToString(); to every control, then I have set of controls like,

ddlSalutation.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Salutation.ToString();
txtLastName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Last_Name.ToString();
txtFirstName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).First_Name.ToString();
txtMI.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Middle_Initial.ToString();
txtAddress.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Home_Address.ToString();
txtCity.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).City.ToString();
ddlState.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).State.ToString();
txtZip.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Zip_Code.ToString();
txtSSNo.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ssn.ToString();
txtMRNo.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Mr_No.ToString();
txtDOB.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Birth_Date.ToString();
RBGender.SelectedItem.Value = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Gender.ToString();
RBMaritalStatus.SelectedItem.Value = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Marital_Status.ToString();
txtHomePhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Home_Phone.ToString();
txtWorkPhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).WorkPhone.ToString();
txtCellPhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).CellPhone.ToString();
ddlSuffix.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Suffix.ToString();
txtReligion.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Religion.ToString();
txtEmail.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Email.ToString();
txtSSOName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ssn.ToString();
txtPatientKin.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Patient_Kin.ToString();
txtRelationWithPatient.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Kin_Relation.ToString();
txtPhoneNo.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Kin_Phone.ToString();
ddlPreferredPharmacy.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Id_Pharmacy.ToString();
txtEmergencyContactName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Emergency_Contact_Name.ToString();
txtEmergencyContactNumber.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Emergency_Contact_Phone.ToString();
txtRelation.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Kin_Relation.ToString();
txtRace.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Race.ToString();
ddlHowDidPatientFindUs.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).How_Found.ToString();
txtEmployerName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Employer_Name.ToString();
txtEmployerOccupation.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Employer_Occupation.ToString();
txtEmployerPhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Employer_Cell_Phone.ToString();
txtEmployerAddress.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Employer_Address.ToString();
txtEmployerCity.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Employer_City.ToString();
ddlEmployerState.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Employer_State.ToString();
txtEmployerZip.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Employer_Zip.ToString();
txtRecordsReleasedTo.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Records_Released_To.ToString();
txtOtherInfo.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Other_Info.ToString();
txtPopupNote.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Popup_e.ToString();
ddlPPlanName.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Insurance_Name.ToString();
txtPGroupNo.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Group_No.ToString();
txtPIDNo.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Id_No.ToString();
txtPPhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Plan_Phone.ToString();
txtPVerifiedWith.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Verified_With.ToString();
txtPVerifiedPhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Verified_Phone.ToString();
txtPEffectiveDate.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Effective_Date.ToString();
txtPExtDate.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Ext_Date.ToString();
if (db.usp_ATI_FetchPatientDetails(iPatientID).Count() > 0)
{
txtPGLastName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_Name.ToString();
txtPGFirstName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_Name.ToString();
txtPGMI.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_MI.ToString();
txtPGBirthGDate.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_Dob.ToString();
txtPGAddress.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_Address.ToString();
txtPGCity.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_City.ToString();
ddlPGState.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_State.ToString();
txtPGZip.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_Zip.ToString();
txtPGEmployerFirstName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_Fname.ToString();
txtPGEmployerLastName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_Lname.ToString();
txtPGEmployerPhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_Phone.ToString();
txtPGEmployerOccupation.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_Occupation.ToString();
txtPGEmployerAddress.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_Address.ToString();
txtPGEmployerCity.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_City.ToString();
ddlPGState.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_State.ToString();
txtPGEmployerZip.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Grn_Emp_Zip.ToString();
ddlPGPatientRelationshipToGuarantor.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Grn_Rel_With_Pat.ToString();
txtPGOtherInsuranceNotes.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Other_Notes.ToString();
txtPGAuthorization.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_Authorization.ToString();
txtPGAob.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(0).Ins_AOB.ToString();
}
if (db.usp_ATI_FetchPatientDetails(iPatientID).Count() > 1)
{
txtSGLastName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_Name.ToString();
txtSGFirstName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_Name.ToString();
txtSGMI.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_MI.ToString();
txtSGBirthGDate.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_Dob.ToString();
txtSGAddress.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_Address.ToString();
txtSGCity.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_City.ToString();
ddlSGState.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_State.ToString();
txtSGZip.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_Zip.ToString();
txtSGEmployerFirstName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_Fname.ToString();
txtSGEmployerLastName.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_Lname.ToString();
txtSGEmployerPhone.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_Phone.ToString();
txtSGEmployerOccupation.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_Occupation.ToString();
txtSGEmployerAddress.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_Address.ToString();
txtSGEmployerCity.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_City.ToString();
ddlSGState.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_State.ToString();
txtSGEmployerZip.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Grn_Emp_Zip.ToString();
ddlSGPatientRelationshipToGuarantor.SelectedItem.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Grn_Rel_With_Pat.ToString();
txtSGOtherInsuranceNotes.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Other_Notes.ToString();
txtSGAuthorization.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_Authorization.ToString();
txtSGAob.Text = db.usp_ATI_FetchPatientDetails(iPatientID).ElementAt(1).Ins_AOB.ToString();
}

My question is that, for each control the Stored Procedure called or not? If it is yes then it is time consuming and I need to use LINQ to DataSet or LINQ to Object rather than to call SP for each control. What is difference between LINQ to DataSet and LINQ to Object?

View 5 Replies

Forms Data Controls :: Update Statement Not Updating?

Jul 11, 2010

I have a simple table. (with PK). I have created a tableadapter that selects all fields and filters with a control parameter. This works fine. The results are displayed within a DetailView control. All okay up to this point. I have then enabled 'Editing'.I can then click on the edit and change the text, but when I click the edit button the page updates but the value has not changed in the database?

View 4 Replies

Forms Data Controls :: Gridview - Update Statement Error?

Apr 29, 2010

I'm quite new to asp.net. I use MS Visual Studio 2008 and MySQL database. When I try to edit a record via gridview and the generated UPDATE syntax I get an error.I inserted a gridview into my asp.net web application and connected it to my database (all is OK). Then I checked for auto generation of update and other syntax:

[Code]....

When I test in a browser I get a pop window form for editing a record. But when I click "update" I get the following error:"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?, strSkrajsanNaziv = ?, strKraj = ?, strDavcnaSt = ?, SkupinaID = ? WHERE Stran' at line 1"what's wrong with the UPDATE syntax? Is this syntax only valid when using MSSQL?

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved