DataSource Controls :: Using LINQ Datasource Control To SQL Databind

Feb 18, 2010

I have got an issue while using LINQ 2 SQL.

public IEnumerable<Customer> GetCustomers()
{
Table<Customer> custObject = context.Customers;
IEnumerable<Customer> filteredCustList = from customer in custObject
select customer;
filteredCustList;
}
GridView2.DataSource = utilLinqClass.GetCustomers();
GridView2.DataBind();

(no errors at build time or at compile time) Error I am getting is: An attempt to attach an auto-named database for file App_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

View 1 Replies


Similar Messages:

DataSource Controls :: Linq To SQL Concurrency Control With Timestamp

Mar 29, 2010

I added a column of type "timestamp" to a table in SQL Server to use for concurrency control. I deleted all my tables from the Linq surface and then added them back. I see that the "Time Stamp" attribute is set to True for the timestamp column and False for all the other columns. I also see that the "Update Check" attribute is set to Never for all columns, including the timestamp column.

After watching some demo videos and reading some tutorials, I had expected to have to manually set the "Update Check" attribute values on the columns - to Never for all columns but the timestamnp column where it should be set to Always. But, before setting the "Update Check" to Always on the timestamp column, I decided to test it the way it was, and Linq seems to be doing the right thing - it seems to be using the timestamp column for concurrency control correctly even with "Update Check" set to Never on the timestamp column.

So my question is - does the fact that "Time Stamp" is set to True trump the "Update Check"? Or is there any other reason one could or should set "Update Check" to Always on a timestamp column? Is there any change in behavior?

View 2 Replies

DataSource Controls :: Sorting Gridview Control Using LINQ?

Jun 8, 2010

I have Gridview control which bind data from LINQ datacontext object which use store procedure. sort the gridview using LINQ datacontext object which use store procedure.

View 3 Replies

DataSource Controls :: DataBind A SQLDataSource To A Label?

Oct 11, 2010

I'm using MikesDotNettings([URL] code mentioned: Bind Data From a SQLDataSource to a Label, and I'm getting this error:

"An SqlParameter with ParameterName 'ID' is not contained by this SqlParameterCollection."

This is what I have, I'm using my own data to try and populate the labels:

[Code]....

I need to assign the values to a labels (strings) as I need to use them for another caluculation.Can you or anyone looking at this figure this out?

View 1 Replies

DataSource Controls :: Using Stored Procedure And Using Databind For The Gridview?

Oct 29, 2010

am having trouble figuring this one out. Am using stored procedure and using databind for the gridview . i got the codes off other sites. I'm guessing its the code that i've underlined, how or what do i use as the datasource for the sorting event. I used the Session for the paging event and that works but not for sorting.

[Code]....

View 2 Replies

Forms Data Controls :: Repeater DataBind Not Updating Items In Datasource

Jan 28, 2010

Here is the situation I have, I have a repeater inside a Usercontrol. The datasource is a IEnumerable<Investor> Exposed through a UserControl's Property. I have overridden the UserControl's databind event to set the Repeater Datasource before databinding the repeater. When it's not a postback, it databinds find and the events on the repeater item's controls fires up fine. But there is one event on repeater items (Delete Investor) which call back the DataBind of the UserControl after removing the Investor from de datasource. When this Event is called, it does all the work (deleting the investor and so on...) calls back the usercontrol's databind but when (within the usercontrol databind) the repeater is databinded again, the repeater items doesn't update (repeater items for investor not on the DataSource anymore still appears). My ItemDataBind doesn't even fire by then.

[Code]....

and code bedind

[Code]....

I Tried with both the Repeater Item Command and each LinkButton Event to see if it would make any difference, but none worked

View 7 Replies

Forms Data Controls :: GridView - Databind To A Collection Within A Custom Datasource?

Jun 14, 2010

I'm trying to databind my GridView to a custom datasource where one of it's members/fields is a collection.

Custom object Entry

public List<EntryHour> Hours { get; set; }

In practical terms, one row consists of some normal text fields which is easy to handle. However, the Hours field is the nut to crack.

How do I, in the GridView markup bind my textfields in question to the Hours field (which consists of 7 items allways)?

View 7 Replies

DataSource Controls :: Getting Error On Attempted Databind Call To DataList1 With Nested SqlDataSource Tool

Jan 26, 2011

I am getting error on attempted Databind call to DataList1 with nested SqlDataSource tool after attempting to update or delete a record.

The SqlDataSource control 'sqldsfilelist' does not have a naming container. Ensure that the control is added to the page before calling DataBind.

Here is the aspx page code.

[Code]....

And the code behind....

[Code]....

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

DataSource Controls :: Pull A SubString From A Linq Datasource But Can't Use INTs Per .SubString(int, Int)

Feb 5, 2010

I need to pull a SubString from a Linq Datasource, but can't use INTs per .SubString(int, int) I have strings such as xxxx.xxxx.xxxxx.AAAA.xxxx.xxxx.xxxx.xxx and I need to pull AAAA out. the preceeding x's will be varying lengths, so I can't use a static int. What I do know is that there will be a static number of periods (.) leading up to the AAAA. I can't figure out how to use the SubSting with characters rather than indexs. This is what I have so far:

[Code]....

View 2 Replies

DataSource Controls :: Variable Connection String Parameter In A DataSource Control

May 20, 2010

I have several web forms which use a GridView linked to a DataSource control which is defined at design time as follows:

<cc1:pgsqldatasource
id="dsStates"
runat="server"
connectionstring="<%&#36; ConnectionStrings:PgSqlConnection %>"
oldvaluesparameterformatstring="Original_{0}"
providername="<%&#36; ConnectionStrings:PgSqlConnection.ProviderName %>" >
</cc1:pgsqldatasource>

As you can see, the connectionstring parameter is defined to a specific connection string name and I need to be able to set such a parameter to a different value, for example, to a session variable content.

View 1 Replies

DataSource Controls :: Control Value In A Datacontrol Inobject Datasource Events?

Feb 23, 2011

I've a listview with checkbox control in it and datasource as object data source.

I'm updating the values in listview using update method in object data source, problem is I'm not able to pass the value of checkbox checked in the update event as parameter.

View 2 Replies

Bind Checklistbox Inside Repeater Control Having Datasource As LINQ

Aug 23, 2010

i my website i am using Repeater control which further contain checkboxlist control. Now my problem is that i have successfully bind "Parameter Type" in repeater control but when i am binding checkbox values, it does't appears in display

<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<h4>
<%#Container.DataItem%></h4>
<asp:CheckBoxList ID="chkParList" runat="server" RepeatDirection="Horizontal"
DataTextField = >
</asp:CheckBoxList>
<br /><br />
</ItemTemplate>
<SeparatorTemplate>
<hr />
</SeparatorTemplate>
</asp:Repeater>
In *.cs file following are my code
IMonitoringDataInfo objMonitoringDataInfo = new ChannelFactory<IMonitoringDataInfo>("MonitoringDataInfo").CreateChannel();
Collection<ParameterDetailDTO> clParameterDetailDTO = objMonitoringDataInfo.GetAllParameters(idList, out errorCode);
var parameters = (from resx in clParameterDetailDTO
select resx.ParameterType).Distinct();
Repeater1.DataSource = parameters.ToList();
Repeater1.DataBind();
counter = Repeater1.Items.Count;
while (i < counter - 1)
{
foreach (var parType in parameters)
{
var items = from resx in clParameterDetailDTO
where resx.ParameterType.ToLower().Contains(parType.ToLower())
select new { resx.ParameterName, resx.ParameterID };
((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataSource = items;
((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataTextField = "ParameterName";
((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataValueField = "ParameterID";
((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataBind();
}
i++;
}

I am using LINQ as datasource.

View 1 Replies

C# - DataBind DataSource Result To Web Application Labels?

May 19, 2010

I have an AccessDataSource TestSummaryADS. I can easily view the results in a GridView or DropDownList by setting its DataSourceID property.

How do I bind a value from the results TestSummaryADS to the text of a label?

I'm just trying to populate labels on my page with results from the DB entry.

C# or VB.NET answers okay.

View 2 Replies

DataSource Controls :: Compile In Order To Get The System.Linq.Dynamic Namespace / Dynamic Linq Error

Apr 20, 2010

I've added the Dynamic.cs file to my project and have set it's Build Action = Compile in order to get the System.Linq.Dynamic namespace.

However, when I try to use any of the new code I am getting an ambiguous call error; see below.

[Code]....

View 2 Replies

DataSource Controls :: How To Convert To Linq (vb.net)

Sep 16, 2010

I have an sql statement I want to convert to LINQ (VB.Net).

View 2 Replies

DataSource Controls :: Linq Distinct Ip According To Day?

May 4, 2010

I'm trying the pull out a result that shows me how many visitors I have had each day.

My database looks like this.

[code]....

View 5 Replies

DataSource Controls :: Linq - Next Withing Do While?

Jan 14, 2010

I am trying to use a linq query to create a report and I am unclear on how to traverse the linq dataquery in my case. Inside my for each loop, i have a do while loop. The way it is written below, the do while loop is infinite because I never skip to the next itm in oneSchedule. Placing a Next inside the do while loop causes a syntax error. So what is the correct method for moving to the next itm within the loop?????

[Code]....

[Code]....

View 3 Replies

DataSource Controls :: Query Using Linq To Sql?

Jun 25, 2010

I´m using Linq to Sql in my asp.net application, but the problem is:I have a query like this:

[Code]....

My query is not returning anything, how do I do to get this?my problem is with this interval I need to have.

View 2 Replies

DataSource Controls :: How To Do In Linq To Entity

Feb 2, 2010

select * from MyTable select "MonthName"= case when datepart(month,date1) =1 then 'January' when datepart(month,date1) =2 then 'February' end , count(*) as CountByMonth from venkat group by datepart(month,date1)

View 1 Replies

DataSource Controls :: Keyword In Linq To SQL?

Feb 1, 2010

I'm trying to "move" a LinqDataSource control to code behind to better control the query parameters. Problem I'm having is how does the "It" keyword translate to Linq To SQL syntax (not sure if I'm getting the terminology right here, but I think you get my meaning).

Control Markup:

[Code]....

Query:

[Code]....

View 3 Replies

DataSource Controls :: Linq Between Two Dates (VB)?

Jan 18, 2010

I am wanting to write this in linq SELECT *FROM Store_InformationWHERE Date BETWEEN '12/03/2007' AND '01/04/2008'Can anyone give me an example?

View 1 Replies

DataSource Controls :: Linq To XML - Get The Next Record?

Jan 28, 2010

I have the following xml:

[Code]....

If I have an ID, I would like to retrieve the next item that also has the same category as the item ID I have. So, for example, if I have ID=2, I would like to return the item with ID=4 (as item ID=3 has a different category).

View 2 Replies

DataSource Controls :: Compromising With A DBA On Linq To SQL?

Apr 7, 2010

Whenever you want to implement Linq to SQL on a project there is inevitably a battle between the DBA and the developers over it.

From the developer standpoint, Linq to SQL eliminates the need to manually write stored procs, ADO.NET data access classes, business object classes, and datatable -> business object conversion classes. This makes development a breeze and eliminates a lot of the traditional layers that you'd normally have to code.

Alternately, from a DBA perspective there are some issues. One is that a lot of DBA's like to do security at the sproc level, and this level would be gone. Another issue is that if the DBA wanted to mimic some sql functionality that the application is doing, possibly for a scripted action, they wouldn't be able to simply call the sproc that the application is using. Also they wouldn't be able to tell which columns are actively being used and which are not, as it'd be C# code specifying which columns are returned rather than sprocs. Lastly, if something needed to be changed structurally, it'd require a recompile and redeploy of the entire app rather than a simple sql script of 2 being deployed.

There are valid points on both ends, so I'm wondering what experiences you all have with this and what sort of compromises you made. In my situation, I'm the developer and I'm trying to figure out a compromise I can make with the DBA so we both give a little rather than one of us having to completely bend over. The obvious compromise to me is using sprocs from within Linq to SQL, but it adds another layer of development and the sprocs have to coded a certain way to play nice with Linq to SQL.

View 7 Replies







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