15,891,423 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 13802222 (Top 8 by date)
Member 13802222
17-May-18 12:05pm
View
thank you
Member 13802222
14-May-18 15:51pm
View
thank you for replying.
Member 13802222
7-May-18 11:24am
View
thank you for your reply...i checked the versions,i changed it to 10.5 version in web.config file but still the same error so i deleted the add assembly tags in web.config file and it worked.
Member 13802222
1-May-18 12:10pm
View
it worked but i cannot figure out why gridview is not showing up on page
Member 13802222
1-May-18 11:20am
View
error: Must declare the scalar variable "@album_name".
Member 13802222
1-May-18 11:19am
View
thanks.alright.
Member 13802222
1-May-18 10:29am
View
thank you for replying.
how do i mark the data?
Member 13802222
1-May-18 10:10am
View
<title>
#Select1
{
width: 197px;
}
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="Album_name"
DataValueField="Album_name">
<asp:listitem>Lamborghini
<asp:listitem>BMW
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:iuploadaz %>"
SelectCommand="SELECT [Album_name] FROM [tb_Gallery]">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<asp:AnimationExtender ID="Button1_AnimationExtender" runat="server"
Enabled="True" TargetControlID="Button1">
<asp:GridView ID="gvsearch" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Width="305px">
<columns>
<asp:BoundField DataField="Album_name" HeaderText="Album_name"
SortExpression="Album_name" />
<asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource1"
DataTextField="Album_name" DataValueField="Album_name">
....
code:
public partial class searchaz : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["iuploadaz"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
// Label3.Text = a.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("select * from tb_Gallery", con);
// SqlDataAdapter da = new SqlDataAdapter(cmd);
// DataSet ds = new DataSet();
// da.Fill(ds, "album_name");
// DropDownList1.DataSource = ds;
// DropDownList1.DataTextField = "album_name";
//DropDownList1.DataBind();
SqlDataAdapter da = new SqlDataAdapter("select album_name from tb_Gallery where album_name like '" + DropDownList1.Text + "'", con);
//DataSet ds = new DataSet();
//da.Fill(ds);
//DropDownList1.DataSource = ds;
//DropDownList1.DataTextField = "album_name";
//DropDownList1.DataBind();
//gvsearch.DataSource = ds;
//gvsearch.DataBind();
}
}
}
Show More