Click here to Skip to main content
15,885,244 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Adding Textbox dynamically when the value of Drop down list changes Pin
Sundar_R1-Feb-09 17:25
Sundar_R1-Feb-09 17:25 
GeneralRe: Adding Textbox dynamically when the value of Drop down list changes Pin
Abhijit Jana1-Feb-09 17:51
professionalAbhijit Jana1-Feb-09 17:51 
AnswerRe: Adding Textbox dynamically when the value of Drop down list changes Pin
N a v a n e e t h1-Feb-09 13:20
N a v a n e e t h1-Feb-09 13:20 
GeneralRe: Adding Textbox dynamically when the value of Drop down list changes Pin
fasttoshiba1-Feb-09 14:22
fasttoshiba1-Feb-09 14:22 
GeneralRe: Adding Textbox dynamically when the value of Drop down list changes Pin
N a v a n e e t h1-Feb-09 14:26
N a v a n e e t h1-Feb-09 14:26 
QuestionHow do you pass values to a datasource Pin
AndyASPVB1-Feb-09 10:39
AndyASPVB1-Feb-09 10:39 
AnswerRe: How do you pass values to a datasource Pin
sana171-Feb-09 22:20
sana171-Feb-09 22:20 
GeneralRe: How do you pass values to a datasource Pin
AndyASPVB2-Feb-09 7:55
AndyASPVB2-Feb-09 7:55 
Hi

thanks for your reply, but I couldn't get it to work. Below is my code snippet:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
ProviderName="<%$ ConnectionStrings:NorthwindConnectionString.ProviderName %>"
SelectCommand="SELECT [EmployeeID], [LastName] FROM [Employees]">
</asp:SqlDataSource>

<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="LastName"
DataValueField="EmployeeID" AutoPostBack="true">
</asp:DropDownList>

<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
ProviderName="<%$ ConnectionStrings:NorthwindConnectionString.ProviderName %>"
UpdateCommand="UPDATE [Employees] SET [NotActive]=@NotActive WHERE [EmployeeID]=@EmployeeID">
<UpdateParameters>
<asp:Parameter Name="NotActive" DefaultValue="YES" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="EmployeeID" PropertyName="SelectedValue" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource3" Visible="true">
<Columns>
<asp:BoundField DataField="LastName" HeaderText="LastName"
SortExpression="LastName" />
<asp:BoundField DataField="Active" HeaderText="Active"
SortExpression="Active" />
<asp:BoundField DataField="NotActive" HeaderText="NotActive"
SortExpression="NotActive" />
</Columns>
</asp:GridView>

I have been experimenting by using a parameter tag in order to hold a default value which when the Update query is run the default is passed to the query. Unfortunately, when I check the table it hasn't updated.

What do I need to do fix the problem?

Thanks
GeneralRe: How do you pass values to a datasource Pin
sana173-Feb-09 1:06
sana173-Feb-09 1:06 
GeneralRe: How do you pass values to a datasource Pin
AndyASPVB3-Feb-09 8:51
AndyASPVB3-Feb-09 8:51 
GeneralRe: How do you pass values to a datasource Pin
sana174-Feb-09 1:34
sana174-Feb-09 1:34 
QuestionHow do you add childnodes to a treeview? Pin
AndyASPVB1-Feb-09 10:35
AndyASPVB1-Feb-09 10:35 
QuestionImage not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 4:38
Anita_Kamat_inds1-Feb-09 4:38 
AnswerRe: Image not been displayed from SQL Pin
Colin Angus Mackay1-Feb-09 12:43
Colin Angus Mackay1-Feb-09 12:43 
GeneralRe: Image not been displayed from SQL Pin
vaghelabhavesh1-Feb-09 13:02
vaghelabhavesh1-Feb-09 13:02 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay1-Feb-09 13:04
Colin Angus Mackay1-Feb-09 13:04 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:19
Anita_Kamat_inds1-Feb-09 16:19 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay2-Feb-09 8:43
Colin Angus Mackay2-Feb-09 8:43 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds2-Feb-09 9:02
Anita_Kamat_inds2-Feb-09 9:02 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay2-Feb-09 9:53
Colin Angus Mackay2-Feb-09 9:53 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds2-Feb-09 10:01
Anita_Kamat_inds2-Feb-09 10:01 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:06
Anita_Kamat_inds1-Feb-09 16:06 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:08
Anita_Kamat_inds1-Feb-09 16:08 
QuestionGridview binding to both base n derived classes Pin
dotnet.coder1-Feb-09 2:59
dotnet.coder1-Feb-09 2:59 
AnswerRe: Gridview binding to both base n derived classes Pin
Manas Bhardwaj1-Feb-09 4:01
professionalManas Bhardwaj1-Feb-09 4:01 

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.