Click here to Skip to main content
15,115,261 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionA control/script for image manipulation Pin
VictorSotnikov20-Nov-11 8:50
MemberVictorSotnikov20-Nov-11 8:50 
QuestionHow to crypt my URL Pin
TRAORE cheickna20-Nov-11 6:15
MemberTRAORE cheickna20-Nov-11 6:15 
AnswerRe: How to crypt my URL Pin
Morgs Morgan22-Nov-11 22:37
MemberMorgs Morgan22-Nov-11 22:37 
Questionto import all tables Pin
sk_ko19-Nov-11 20:27
Membersk_ko19-Nov-11 20:27 
AnswerRe: to import all tables Pin
jkirkerx19-Nov-11 21:22
professionaljkirkerx19-Nov-11 21:22 
QuestionWorking with cached DataTables ? Pin
devboycpp19-Nov-11 7:47
Memberdevboycpp19-Nov-11 7:47 
AnswerRe: Working with cached DataTables ? Pin
jkirkerx19-Nov-11 20:16
professionaljkirkerx19-Nov-11 20:16 
Questiondata source problem with web control Pin
rachel_m19-Nov-11 7:05
Memberrachel_m19-Nov-11 7:05 
I am having problem trying to use a linq to sql datasource on a detailsview control in a C# 2010 web form new application. What I want to be able to do is use the linq to sql datasource listed below to update records in the table called 'Atts". According to a Devexpress online tutorial that I looked at, it said to remove the ' new statement' in the select statement, and then you can do an edit.

The following is the select statement: Select="new (Att_id, Prior_Cutoff_Date)" statement.

However visual studio 2010 will not allow me to remove the 'new' statement. I am guessing the reason why is the column called 'Att_id' is an identity column.

Thus can you tell me what I can do so I can setup the edit feature to work? Is there something I can do with the linq to sql dataource to work around the identity column? Should I have a second linq to sql data source where I would have one linq to sql datasource for inserting and another dataource for updating? Let me know what your recommendation is and/or point me to a reference I can use to solve my problem

Here is the code I have so far:
<pre>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="Support.AttDataContext"
Select="new (Att_id, Prior_Cutoff_Date)"
TableName="Atts" Where="Att_id == @Att_id"
EnableUpdate="True">
<UpdateParameters>
<asp:SessionParameter Name="Att_id" SessionField="AttID" />
</UpdateParameters>
<WhereParameters>
<asp:SessionParameter Name="Att_id" SessionField="AttID" Type="Int32" />
</WhereParameters>
</asp:LinqDataSource>

<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" EnableModelValidation="False"
AutoGenerateRows="False" DataSourceID="LinqDataSource1" BorderStyle="Solid" HorizontalAlign="Center"
DefaultMode="Edit">
<Fields>
<asp:TemplateField HeaderText="Att ID">
<ItemTemplate>
<asp:TextBox ID="TextBoxAttid" runat="server" Text='<%# Eval("Att_id") %>'
BorderStyle="None"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="Prior Cutoff Date" SortExpression="Prior_Cutoff_Date">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Prior_Cutoff_Date") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Prior_Cutoff_Date") %>'></asp:TextBox>
</EditItemTemplate>

</asp:TemplateField>
</Fields>
</asp:DetailsView>
</pre>
AnswerRe: data source problem with web control Pin
jkirkerx19-Nov-11 20:29
professionaljkirkerx19-Nov-11 20:29 
GeneralRe: data source problem with web control Pin
rachel_m20-Nov-11 9:43
Memberrachel_m20-Nov-11 9:43 
GeneralRe: data source problem with web control Pin
jkirkerx20-Nov-11 10:10
professionaljkirkerx20-Nov-11 10:10 
GeneralRe: data source problem with web control Pin
rachel_m20-Nov-11 15:32
Memberrachel_m20-Nov-11 15:32 
GeneralRe: data source problem with web control Pin
jkirkerx20-Nov-11 16:19
professionaljkirkerx20-Nov-11 16:19 
QuestionSite navigation link generation using sitemap Pin
Tridip Bhattacharjee19-Nov-11 0:46
professionalTridip Bhattacharjee19-Nov-11 0:46 
AnswerRe: Site navigation link generation using sitemap Pin
jkirkerx19-Nov-11 20:35
professionaljkirkerx19-Nov-11 20:35 
AnswerRe: Site navigation link generation using sitemap Pin
Bernhard Hiller20-Nov-11 20:52
MemberBernhard Hiller20-Nov-11 20:52 
QuestionURL routing issue asp.net 4.0 Pin
Tridip Bhattacharjee19-Nov-11 0:42
professionalTridip Bhattacharjee19-Nov-11 0:42 
AnswerRe: URL routing issue asp.net 4.0 Pin
jkirkerx19-Nov-11 20:44
professionaljkirkerx19-Nov-11 20:44 
QuestionI have some queires releated to DataCalendar Pin
Ostwal Aarti18-Nov-11 2:37
MemberOstwal Aarti18-Nov-11 2:37 
AnswerRe: I have some queires releated to DataCalendar Pin
Blue_Boy18-Nov-11 2:54
MemberBlue_Boy18-Nov-11 2:54 
QuestionMultiple dll's Refrencing Asp.net Website Pin
vishnukamath17-Nov-11 21:14
Membervishnukamath17-Nov-11 21:14 
QuestionRe: Multiple dll's Refrencing Asp.net Website Pin
Pandya Anil17-Nov-11 23:25
MemberPandya Anil17-Nov-11 23:25 
AnswerRe: Multiple dll's Refrencing Asp.net Website Pin
Richard MacCutchan18-Nov-11 1:44
mveRichard MacCutchan18-Nov-11 1:44 
AnswerRe: Multiple dll's Refrencing Asp.net Website Pin
jkirkerx19-Nov-11 20:51
professionaljkirkerx19-Nov-11 20:51 
QuestionGet Regional Language settings. Pin
Mugdha_Aditya17-Nov-11 20:56
MemberMugdha_Aditya17-Nov-11 20:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.