Click here to Skip to main content
15,900,725 members
Home / Discussions / C#
   

C#

 
AnswerRe: stored procedure vs class coding Pin
Charith Jayasundara9-Oct-07 20:05
Charith Jayasundara9-Oct-07 20:05 
QuestionInvoking windows service in C# code Pin
Charith Jayasundara9-Oct-07 18:50
Charith Jayasundara9-Oct-07 18:50 
AnswerRe: Invoking windows service in C# code Pin
il_masacratore9-Oct-07 21:33
il_masacratore9-Oct-07 21:33 
GeneralRe: Invoking windows service in C# code Pin
Charith Jayasundara10-Oct-07 0:54
Charith Jayasundara10-Oct-07 0:54 
QuestionRe: Invoking windows service in C# code Pin
Charith Jayasundara10-Oct-07 1:16
Charith Jayasundara10-Oct-07 1:16 
QuestionRegarding Promotion Code/Copoun Number Generator Pin
Murthy India9-Oct-07 18:30
Murthy India9-Oct-07 18:30 
AnswerRe: Regarding Promotion Code/Copoun Number Generator Pin
Christian Graus9-Oct-07 18:42
protectorChristian Graus9-Oct-07 18:42 
QuestionHow to display image in DataList ? Pin
whale849-Oct-07 18:22
whale849-Oct-07 18:22 
I have this code in file default.aspx below :


<asp:DataList id="DstAlbum" RepeatColumns="3" RepeatDirection = "Horizontal" BackColor="#FFFFFF" OnItemDataBound="Album_DataList_ItemDataBound"> <ItemTemplate> <tr>
<td><table width="100%" style="WIDTH:100%"> <tr>
<td align="center"><asp:HyperLink id=Album_name NavigateUrl='<%# "AlbumDetail.aspx"+"?"+"id+Album="+Server.UrlEncode(DataBinder.Eval(Container.DataItem, "id_Album").ToString()) +"&" +""%>' style="font-size: 10pt; color: #000000" runat="server"> <%#Convert.ToString(DataBinder.Eval(Container.DataItem, "TenAlbum")) %> </asp:HyperLink>&nbsp;</td></tr>
<tr><td><input type=hidden id=Album_image runat="server" value=<%#Convert.ToString(DataBinder.Eval(Container.DataItem, "AnhBia")) %> NAME="Album_image"></td></tr>
</table></td></tr> </ItemTemplate>
</asp:DataList>

And file default.aspx.cs below :

private void Page_Load(object sender, System.EventArgs e)
{
string strConn = "Integrated Security = SSPI;" + "InitialCatalog=HopNhac_Database;" +
"Data Source=localhost;";
string strSQL = "Select id_Album,TenAlbum,AnhBia From tblAlbum";
SqlDataAdapter dad = new SqlDataAdapter(strSQL,strConn);
DataSet dst = new DataSet();
dad.Fill(dst,"tblAlbum");
DataView Source;
Source = new DataView(dst.Tables[0]);
DstAlbum.DataSource = Source;
DstAlbum.DataBind();
}

public void Album_DataList_ItemDataBound(Object Sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{ ((HyperLink)e.Item.FindControl("Album_name")).Text ="<img border=\"0\" src=\"" + ((DataRowView)e.Item.DataItem )["AnhBia"].ToString() + "\"></td><td valign=\"top\"><table width=\"100%\" style=\"width:100%\"><tr><td style=\"background-color: #FFFFFF; border-style: inset; border-width: 0\"><font style=\"font-size: 10pt; color: #CE7E00; font-weight: bold\"><b>" + ((DataRowView)e.Item.DataItem )["TenAlbum"].ToString() + "</b>";
}
}


When I compiled , it take an error : 'System.Web.UI.Control' does not contain a definition for 'DataItem'.
And that error is Hyperlink at default.aspx file.

somewhere is paradise.
AnswerRe: How to display image in DataList ? Pin
whale8410-Oct-07 6:26
whale8410-Oct-07 6:26 
QuestionDetecting URL in RichTextBox Control? Pin
wienzzz9-Oct-07 17:23
wienzzz9-Oct-07 17:23 
AnswerRe: Detecting URL in RichTextBox Control? Pin
Christian Graus9-Oct-07 18:20
protectorChristian Graus9-Oct-07 18:20 
GeneralRe: Detecting URL in RichTextBox Control? [modified] Pin
wienzzz9-Oct-07 18:47
wienzzz9-Oct-07 18:47 
GeneralRe: Detecting URL in RichTextBox Control? Pin
N a v a n e e t h9-Oct-07 19:09
N a v a n e e t h9-Oct-07 19:09 
AnswerRe: Detecting URL in RichTextBox Control? Pin
mav.northwind9-Oct-07 19:10
mav.northwind9-Oct-07 19:10 
GeneralRe: Detecting URL in RichTextBox Control? Pin
wienzzz9-Oct-07 19:34
wienzzz9-Oct-07 19:34 
QuestionHOW CAN I EXECUTING FILES PROGRAMATICALY Pin
Masterhame9-Oct-07 16:05
Masterhame9-Oct-07 16:05 
AnswerRe: HOW CAN I EXECUTING FILES PROGRAMATICALY Pin
Judah Gabriel Himango9-Oct-07 16:25
sponsorJudah Gabriel Himango9-Oct-07 16:25 
GeneralRe: HOW CAN I EXECUTING FILES PROGRAMATICALY Pin
Masterhame9-Oct-07 17:27
Masterhame9-Oct-07 17:27 
GeneralRe: HOW CAN I EXECUTING FILES PROGRAMATICALY Pin
Christian Graus9-Oct-07 18:18
protectorChristian Graus9-Oct-07 18:18 
GeneralRe: HOW CAN I EXECUTING FILES PROGRAMATICALY Pin
Judah Gabriel Himango10-Oct-07 3:59
sponsorJudah Gabriel Himango10-Oct-07 3:59 
GeneralSpecial tnx Pin
Masterhame9-Oct-07 17:37
Masterhame9-Oct-07 17:37 
QuestionHow to remove a character in Console Pin
humblepgmr9-Oct-07 13:48
humblepgmr9-Oct-07 13:48 
AnswerRe: How to remove a character in Console Pin
PIEBALDconsult9-Oct-07 13:51
mvePIEBALDconsult9-Oct-07 13:51 
GeneralRe: How to remove a character in Console Pin
humblepgmr9-Oct-07 14:14
humblepgmr9-Oct-07 14:14 
GeneralRe: How to remove a character in Console Pin
Anthony Mushrow9-Oct-07 14:49
professionalAnthony Mushrow9-Oct-07 14:49 

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.