Click here to Skip to main content
15,913,282 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Getting error ORA12541 while connecting to oracle through ASP.net Pin
Akshay Dukhande20-Sep-14 6:34
Akshay Dukhande20-Sep-14 6:34 
GeneralRe: Getting error ORA12541 while connecting to oracle through ASP.net Pin
jkirkerx20-Sep-14 8:07
professionaljkirkerx20-Sep-14 8:07 
GeneralRe: Getting error ORA12541 while connecting to oracle through ASP.net Pin
Akshay Dukhande21-Sep-14 19:20
Akshay Dukhande21-Sep-14 19:20 
GeneralRe: Getting error ORA12541 while connecting to oracle through ASP.net Pin
jkirkerx22-Sep-14 13:30
professionaljkirkerx22-Sep-14 13:30 
AnswerRe: Getting error ORA12541 while connecting to oracle through ASP.net Pin
thatraja21-Sep-14 19:28
professionalthatraja21-Sep-14 19:28 
QuestionPosting a form to a table Pin
Member 914293618-Sep-14 10:23
Member 914293618-Sep-14 10:23 
AnswerRe: Posting a form to a table Pin
Richard Deeming19-Sep-14 1:34
mveRichard Deeming19-Sep-14 1:34 
QuestionI am having problem updating one table by selecting values from dynamic dropdownlist from another table Pin
samflex18-Sep-14 5:40
samflex18-Sep-14 5:40 
don't know if this is due to poor db design or not but I have been struggling since last night to update some records from by selecting the values of records to be updated from a dynamically populated dropdownlist from a lookup table.

Essentially, we have three tables called Courses, Instructors and CourseInstructor tables.

CourseInstructor table is a bridge table between Courses and Instructor tables.

So, when adding courses and instructors to their various tables, their foreign keys are automatically added to the bridge table.

This seems to work fine so far.

However, users are having difficulties making changes to these tables.

For instance, if a user wishes to replace one instructor with another, she has not been to do so for far. After an update, the message indicates successful update the instructor names don't change.

Any ideas what I could have done wrong with the code below?



PHP
<asp:TemplateField HeaderText="Instructor">
            <EditItemTemplate>
                <asp:DropDownList ID="ddlInstructors" runat="server" AppendDataBoundItems="True" DataSourceID="SubjectDataSource"
                    DataTextField="InstructorName" DataValueField="InstructorId">
                </asp:DropDownList>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="lblInstructors" runat="server" Text='<% #Bind("InstructorName") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>

          <asp:SqlDataSource ID="sqlDataSourceloc" runat="server" 
    ConnectionString="<%$ ConnectionStrings:DBConn %>" 
    SelectCommand="SELECT locationId, Location FROM Locations order by location asc"></asp:SqlDataSource>
       <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:DBConnectionString %>" 
     UpdateCommand = "Update tblCourseInstructor Set CourseId = @CourseId where (CourseId =@CourseId) Update tblCourseInstructor set InstructorId=@InstructorId where (instructorId=@instructorId and courseId = @courseId)"
     SelectCommand="select l.locationid,c.CourseId, i.instructorId,CourseName, i.instructorname, dbo.fnFormatDate(t.trainingDates, 'MON/DD/YYYY') trainingDates, t.trainingTime,CourseDescription from Courses c, tblLocations l, TrainingDates t, Instructors i, CourseInstructor ci where l.locationid = c.locationid and c.dateId = t.dateId and i.instructorid =  ci.instructorId and c.courseid=ci.courseid and YEAR(t.trainingDates) = YEAR(getDate())"
                   FilterExpression="LocationId = '{0}'" >
<FilterParameters>
 <asp:ControlParameter ControlID="ddlLocation" Name="LocationId" PropertyName="SelectedValue" Type="Int32" />
 </FilterParameters>              
    <UpdateParameters>
        <asp:Parameter Name="CourseId" Type="Int32" />
        <asp:Parameter Name="instructorId" Type="Int32" />
    </UpdateParameters>
   </asp:SqlDataSource>
   <asp:SqlDataSource ID="SubjectDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DBConn %>"
    SelectCommand="SELECT instructorId, InstructorName FROM dbo.Instructors order by InstructorName">
   </asp:SqlDataSource>   


Then I tried updating it from codebehind with code below

PHP
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GridView1.RowUpdating
        Dim ddAssigned As DropDownList = DirectCast(GridView1.Rows(e.RowIndex).FindControl("ddlInstructors"), DropDownList)
        e.NewValues("instructorId") = ddAssigned.SelectedValue
        SubjectDataSource.DataBind()

    End Sub


but got the following error:

'SqlDataSource1' unless UpdateCommand is specified.

Any ideas how do I fixt this one?
AnswerRe: I am having problem updating one table by selecting values from dynamic dropdownlist from another table Pin
jkirkerx18-Sep-14 13:25
professionaljkirkerx18-Sep-14 13:25 
GeneralRe: I am having problem updating one table by selecting values from dynamic dropdownlist from another table Pin
samflex18-Sep-14 17:28
samflex18-Sep-14 17:28 
GeneralRe: I am having problem updating one table by selecting values from dynamic dropdownlist from another table Pin
jkirkerx18-Sep-14 17:45
professionaljkirkerx18-Sep-14 17:45 
GeneralRe: I am having problem updating one table by selecting values from dynamic dropdownlist from another table Pin
jkirkerx18-Sep-14 18:04
professionaljkirkerx18-Sep-14 18:04 
QuestionHow to check for validation as well as run code in code page on submit button press Pin
omrohit118-Sep-14 3:39
omrohit118-Sep-14 3:39 
AnswerRe: How to check for validation as well as run code in code page on submit button press Pin
hypermellow18-Sep-14 3:45
professionalhypermellow18-Sep-14 3:45 
QuestionCalling multiple OData services from within .net API async Pin
LiQuick17-Sep-14 21:49
LiQuick17-Sep-14 21:49 
AnswerRe: Calling multiple OData services from within .net API async Pin
LiQuick22-Sep-14 2:08
LiQuick22-Sep-14 2:08 
QuestionAspx Page Load Pin
Narendra L17-Sep-14 1:48
Narendra L17-Sep-14 1:48 
AnswerRe: Aspx Page Load Pin
Kornfeld Eliyahu Peter17-Sep-14 2:00
professionalKornfeld Eliyahu Peter17-Sep-14 2:00 
AnswerRe: Aspx Page Load Pin
Sibeesh KV29-Sep-14 1:13
professionalSibeesh KV29-Sep-14 1:13 
QuestionHow to learn Asp.net MVC? Pin
RajeeshMenoth16-Sep-14 23:32
professionalRajeeshMenoth16-Sep-14 23:32 
AnswerRe: How to learn Asp.net MVC? Pin
Swinkaran17-Sep-14 18:20
professionalSwinkaran17-Sep-14 18:20 
GeneralRe: How to learn Asp.net MVC? Pin
RajeeshMenoth17-Sep-14 21:51
professionalRajeeshMenoth17-Sep-14 21:51 
AnswerRe: How to learn Asp.net MVC? Pin
Sibeesh KV29-Sep-14 1:15
professionalSibeesh KV29-Sep-14 1:15 
QuestionASP - Display a GridView on Second Page Pin
Member 1090638616-Sep-14 5:16
Member 1090638616-Sep-14 5:16 
AnswerRe: ASP - Display a GridView on Second Page Pin
ZurdoDev16-Sep-14 10:29
professionalZurdoDev16-Sep-14 10:29 

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.