Default Image URL In DataList Control!
Nov 29, 2007
Hey,
I have two questions:
1- In my page there should be a list of all system users, each of them may have an image or may not.
So what I need to do is how to make the next SQL query return a default ImageURL - e.g. "noAvator.jpg" - in case of null image value?
SELECT UserName , image, notes
FROM Members
2- When I try to write an image url in the SQL Server 2005 Management Studio - as "images/noAvator.jpg" or any other name - it always through me this error messagebox:
The changed value is not recignized as valid.
.NET Framework Data Type: Byte[]
Error Message: You can not use the Result pane to set this Field data to value other than NULL.
Why is that? is there a problem with the format of typing the image url?
I appreciate your help!
View 4 Replies
ADVERTISEMENT
Feb 13, 2007
I have learned lots of informative thing from your forums. I have little problem regarding “Display image from SQL Server on ASP.NET� I have done it and image display on my page from SQL Server. I have cleared you here I have adopt two different methods which are following for displaying picture.
1.Response.BinaryWrite(rd("picture"))
2.image.Save(Response.OutputStream, ImageFormat.Jpeg)
but in both above methods I have faced little problem when image display on my page all other information can not display and I also want to display picture on my specific location on the page. My second question is can use any web control like “Image1� to display image from SQL Server where my pictures are stored.
Hope you will help me.
Thanks and regards
Aftab Abbasi
View 4 Replies
View Related
Jan 30, 2007
In my asp.net application I have a local report with an image control in thedetail row of the table and the Value attribute set as="File://" & Fields!FQPhotoFileName.ValueThe first row in the table always shows the wrong image and it's always thesame wrong image. The problem is there even when I change the sort order orthe criteria for the underlying dataset. For example, I ran a small testthat populated the dataset with 2 rows and 2 images. When I sort by anycolumn (e.g. ID) in ascending ascending order the ID=1 row (the 1st row)shows the wrong image and the ID=2 row shows the correct image. When I rerunthe report sorting in descending order the ID=2 row (which is now the 1strow) shows the wrong image and the ID=1 shows the correct image.Any suggestions?
View 1 Replies
View Related
Sep 15, 2007
I wanna know how to retrieve & insert an image from/to a Sql Server database.
using image control or any other control
I’ve done that with windows form picture box.
As that was explained in MS tutorials
Code….
-------------------------------------------Dim ms As New MemoryStreamPictureBox1.Image.Save(ms, PictureBox1.Image.RawFormat)Dim arrImage() As Byte = ms.GetBuffer
ms.Close() Dim strSQL As String = _ "INSERT INTO Emp (EmpName,EmpSalary,Picture)" & _ "VALUES (@EmpName,@EmpSalary,@Picture)" Dim cmd As New SqlCommand(strSQL, ConnEmp) With cmd .Parameters.Add(New SqlParameter("@Picture", _ SqlDbType.Image)).Value = arrImage .Parameters.Add(New SqlParameter("@EmpName", _ SqlDbType.NVarChar)).Value = txtEmpName.Text .Parameters.Add(New SqlParameter("@EmpSalary", _ SqlDbType.Decimal)).Value = txtEmpSalary.Text End With
cmd.ExecuteNonQuery()
-------------------------------------------
But with a web form’s image control I DO NOT know how to do it
I real appreciate your help
Thank you
View 1 Replies
View Related
Apr 18, 2008
How to change the imageurl of the image control that exists in a usercontrol in asp.net?
View 1 Replies
View Related
Apr 18, 2008
How to change the imageurl of the image control that exists in a usercontrol in asp.net? can anyone told me wat to do?plssssssssss
View 1 Replies
View Related
Oct 31, 2007
I am calling my report logo image via http: url
the moment the image is loaded to image control, it is changing its height and width.
how can i make it fixed and the image to be resized appropriately to fit the image control.
Thank you very much, for the help.
View 1 Replies
View Related
Mar 24, 2005
Hi, i would like to insert a default value for a image column in sql server express. is this possible?
I would like to do this so that when users pull up a record in my web forms there is something to see.
thanks
View 3 Replies
View Related
Aug 16, 2007
Hi , Iam using sqlserver 2005. what default value i can set to image data type. Thanksvijay
View 1 Replies
View Related
Apr 24, 2004
Hi,
Is it at all possible to have a default image in an image field in sql server?
If so how?
Thanks,
JB
View 5 Replies
View Related
May 25, 2004
HI All,
Does someone knows if it is possible to get a default value on a image column type!
Cheers Wim
View 4 Replies
View Related
May 22, 2007
I have created an employee directory that displays a picture from a folder based on a consistent naming scheme. I need to set a default value for the picture for when a photo by that name does not exist in the folder. I've tried using both the ISNULL and ISNOTHING commands. Does anyone know how to do this?
View 1 Replies
View Related
Jan 21, 2007
I thought this would be easy. I have a repeater control and a sqldatasource control. I am trying to filter the select statement using DateTime.Now.ToString() and keep getting an invalid date string format. The control is on a content page in my asp.net site. On the master page this <%= DateTime.Now.ToLongDateString() %> works to display the current date. If I try and put <%= DateTime.Now.ToString() %> in the Default value of the SelectParameter it does not work. No intellisense either so I am assuming I am missing something. Here is the code... pretty basic really.
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="sqlDSnews">
<ItemTemplate>
<h3><%# Eval("newTitle")%></h3>
</ItemTemplate>
</asp:Repeater>
<asp:SqlDataSource
ID="sqlDSnews"
runat="server"
ConnectionString="<%$ ConnectionStrings:XXXX%>"
SelectCommand="SELECT [newTitle], [newsDetails], [dateExpires], [newsImage], [dateCreated] FROM [News] WHERE (([GroupID] = @GroupID) AND ([dateExpires] >= @dateExpires))">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="0" Name="GroupID" QueryStringField="Gid" Type="Int32" />
<asp:Parameter Name="dateExpires" DefaultValue='<%= DateTime.Now.ToString() %> 'Type="DateTime" />
</SelectParameters>
</asp:SqlDataSource>
** NOTE the DateTime does not show up in blue - if that helps with a solution **
View 5 Replies
View Related
Jan 20, 2006
Hi,
I'm having some troubles getting my UPDATE to work with my DataList control. I am trying to get Optimistic Concurrency working, but i'm getting an exception stating that the dictionary for oldValues is empty. I understand this is referring to the original values it compares with before performing the update, however, my question is how do I fill this dictionary in with the original values?
I have included a code sample of the sort of thing i am trying to achieve, it is just a simplified example of how I am trying to UPDATE the underlying data source. Am I on the right track? What do I need to do in order to get this to work?
Thankstrenyboy
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void DataList1_EditCommand(object source, DataListCommandEventArgs e)
{
DataList1.EditItemIndex = e.Item.ItemIndex;
DataList1.DataBind();
}
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
{
SqlDataSource1.UpdateParameters["UnitPrice"].DefaultValue = ((TextBox)e.Item.FindControl("UnitPriceTextBox")).Text;
SqlDataSource1.UpdateParameters["UnitsInStock"].DefaultValue = ((TextBox)e.Item.FindControl("UnitsInStockTextBox")).Text;
SqlDataSource1.UpdateParameters["UnitsOnOrder"].DefaultValue = ((TextBox)e.Item.FindControl("UnitsOnOrderTextBox")).Text;
SqlDataSource1.Update();
DataList1.EditItemIndex = -1;
DataList1.DataBind();
}
protected void DataList1_CancelCommand(object source, DataListCommandEventArgs e)
{
DataList1.EditItemIndex = -1;
DataList1.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductName], [UnitPrice], [UnitsInStock], [UnitsOnOrder], [ProductID] FROM [Products]" UpdateCommand="UPDATE [Products] SET [ProductName] = @ProductName, [UnitPrice] = @UnitPrice, [UnitsInStock] = @UnitsInStock, [UnitsOnOrder] = @UnitsOnOrder WHERE [ProductID] = @original_ProductID AND [ProductName] = @original_ProductName AND [UnitPrice] = @original_UnitPrice AND [UnitsInStock] = @original_UnitsInStock AND [UnitsOnOrder] = @original_UnitsOnOrder" OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues">
<UpdateParameters>
<asp:Parameter Name="ProductName" Type="String" />
<asp:Parameter Name="UnitPrice" Type="Decimal" />
<asp:Parameter Name="UnitsInStock" Type="Int16" />
<asp:Parameter Name="UnitsOnOrder" Type="Int16" />
<asp:Parameter Name="original_ProductID" Type="Int32" />
<asp:Parameter Name="original_ProductName" Type="String" />
<asp:Parameter Name="original_UnitPrice" Type="Decimal" />
<asp:Parameter Name="original_UnitsInStock" Type="Int16" />
<asp:Parameter Name="original_UnitsOnOrder" Type="Int16" />
</UpdateParameters>
</asp:SqlDataSource>
</div>
<asp:DataList ID="DataList1" runat="server" DataKeyField="ProductID" DataSourceID="SqlDataSource1" RepeatDirection="Horizontal" RepeatLayout="Flow" OnEditCommand="DataList1_EditCommand" OnUpdateCommand="DataList1_UpdateCommand" OnCancelCommand="DataList1_CancelCommand">
<HeaderTemplate>
<table border="1" style="border-collapse:collapse">
<tr>
<th>Product Name</th>
<th>Unit Price</th>
<th>Units in Stock</th>
<th>Units on Order</th>
<th></th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label ID="ProductNameLabel" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label></td>
<td><asp:Label ID="UnitPriceLabel" runat="server" Text='<%# Eval("UnitPrice") %>'></asp:Label></td>
<td><asp:Label ID="UnitsInStockLabel" runat="server" Text='<%# Eval("UnitsInStock") %>'></asp:Label></td>
<td><asp:Label ID="UnitsOnOrderLabel" runat="server" Text='<%# Eval("UnitsOnOrder") %>'></asp:Label></td>
<td><asp:LinkButton ID="LinkButtonEdit" runat="server" CommandName="Edit" Text="Edit"></asp:LinkButton></td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<tr>
<td><asp:Label ID="ProductNameLabel" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label></td>
<td><asp:TextBox ID="UnitPriceTextBox" runat="server" Text='<%# Eval("UnitPrice") %>'></asp:TextBox></td>
<td><asp:TextBox ID="UnitsInStockTextBox" runat="server" Text='<%# Eval("UnitsInStock") %>'></asp:TextBox></td>
<td><asp:TextBox ID="UnitsOnOrderTextBox" runat="server" Text='<%# Eval("UnitsOnOrder") %>'></asp:TextBox></td>
<td><asp:LinkButton ID="LinkButtonUpdate" runat="server" CommandName="Update" Text="Update"></asp:LinkButton> <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Cancel" Text="Cancel"></asp:LinkButton></td>
</tr>
</EditItemTemplate>
</asp:DataList>
</form>
</body>
</html>
View 1 Replies
View Related
Aug 23, 2006
Hello,
I am currently trying to use the Login control in an ASP.NET website with IIS. The control works fine when I am running the website in debug mode within Visual Studio 2005. However, when I create the Virtual Directory in IIS, and try to log in from there, I get an error message as follows:
Cannot open user default database. Login failed. Login failed for user 'machinenameASPNET'
Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed. Login failed for user 'machinenameASPNET'.
The application is very simple. I created a Login.aspx page with a login control on it, and I have the default.aspx page. I used theASP.NET administration tool to change the authentication mode to AspNetSqlProvider (forms authentication), and to create one user (no roles). I am using the default provider with the aspnetdb.mdf database. I have been working on this for a few days now, and have searched this site but have not found a solution that works for me. Any suggestions?
Jen
View 6 Replies
View Related
Apr 13, 2007
Hello Guys,I am really not very happy with all the possibilities you have in ASP.Net other than in Classic ASP. Back then I made a loop in which you access to a Database with your SQL-Statement and fill the Recordset into HTML-Tables. Now I cannot really do that anymore (at least not in this existing project). My task is to display additional content.We are using the Timetracker-SDK and are displaying the hours spent on any projects.Now I shall add the number of bugs, suggestions and so on that are in the database for the specific project.An ObjectDatasource is accessing to a DotProcedure (written correctly?) and displaying it in a DataList.I really do not have any knowledge to modify itSo my question: Can I add a SqlDatasource and modify the "Select-" Statement in the runtime and add the Output to the Datalist?Thanks in advance on any reply here!Below the .ASPX-Part of the Site: <asp:ObjectDataSource ID="ProjectReportData" runat="server" TypeName="ASPNET.StarterKit.BusinessLogicLayer.Project"
SelectMethod="GetProjectByIds">
<SelectParameters>
<asp:SessionParameter Name="ProjectIds" SessionField="SelectedProjectIds" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:timetrackerConnectionString2 %>"
SelectCommand="select Count(*) as Anzahl from issuetracker_issues where projectid =9 and issuecategoryid=16 and issuestatusid =17">
</asp:SqlDataSource>
<table>
<tr>
<td colspan="2">
<asp:DataList ID="ProjectList" RepeatColumns="1" RepeatDirection="Vertical" runat="server"
DataSourceID="projectReportData" OnItemCreated="OnProjectListItemCreated">
<HeaderStyle CssClass="header-gray" />
<HeaderTemplate>
Project Report
</HeaderTemplate>
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" class="Content" width="100%">
<tr>
<td valign="top">
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" class="Content" width="100%">
<tr>
<td width="180" class="report-main-header">
Project Name</td>
<td width="70" align="right" class="report-main-header">
Est. Hours</td>
<td width="100" align="right" class="report-main-header">
Actual Hours</td>
<td width="100" align="right" class="report-main-header">
Est. Completion</td>
<td width="100" align="right" class="report-main-header">
Issues</td>
<td width="100" align="right" class="report-main-header">
Solved</td>
<td width="100" align="right" class="report-main-header">
Reported</td>
<td width="100" align="right" class="report-main-header">
Not Qualified</td>
</tr>
<tr>
<td class="report-text">
<%# Eval("Name") %>
</td>
<td class="report-text" align="right">
<%# Eval("EstimateDuration") %>
</td>
<td class="report-text" align="right">
<%# Eval("ActualDuration") %>
</td>
<td class="report-text" align="right">
<%# Eval("CompletionDate", "{0:d}") %>
</td>
</tr>
</table>
View 2 Replies
View Related
Jan 31, 2008
Hi all, I'm trig to create a simple cart in ASP.NET/C#. I've create a table named cart in which there are 2 field (user_id and id_product). In my page product I show all product and the cart icon (this is made by an asp.net image_button). When a person click on the cart there's and event in .cs which should insert the relative product in cart table. But how a can retrieve the product id?This is my .cs page: using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class provacarrello : System.Web.UI.Page{ private string connectionString = WebConfigurationManager.ConnectionStrings["MySQLconnection"].ConnectionString; protected void Page_Load(object sender, EventArgs e) { } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { MembershipUser mu = Membership.GetUser(User.Identity.Name); Guid myGuid = (Guid)mu.ProviderUserKey; string insertSQL = "INSERT INTO cart ("; insertSQL += "userid, id_product)"; insertSQL += "VALUES("; insertSQL += "@userid, @id_product)"; SqlConnection myConnection = new SqlConnection(connectionString); SqlCommand cmd = new SqlCommand(insertSQL, myConnection); //Add the parameters cmd.Parameters.AddWithValue("@userid", myGuid); cmd.Parameters.AddWithValue("@id_product", DataList1.??? <--- ??? }} Thank u in advance!
View 5 Replies
View Related
Jan 19, 2007
Hi all
I am having problem in selecting the data from my datalist. Here is teh sample code
<asp:datalist id="dlAttrName" runat="server" OnItemCommand="dlAttrName_SelectData" DataKeyField="attrID">
<ItemTemplate>
<asp:LinkButton ID="lbSelect" Runat="server" CommandName="Select" style="display:none">Select</asp:LinkButton>
<%# Container.DataItem("attrDef1")%>
</ItemTemplate>
</asp:DataList>
Private Sub dlAttrName_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlAttrName.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
'Add eventhandlers for highlighting
'a DataListItem when the mouse hovers over it.
e.Item.Attributes.Add("onmouseover","????")
e.Item.Attributes.Add("onmouseout", "????")
'Add eventhandler for simulating
'a click on the 'SelectButton'
e.Item.Attributes.Add("onclick", ?????????????????????, String.Empty))
??????????????????? this should have something like this
Me.Page.ClientScript.GetPostBackEventReference(e.Item.Controls(1)
But I am not able to get the ClientScript option, I don't know which namespace should I import?
I don't know whether I am right or not.
Its urgent please reply back soon,any help will be useful.
Thanks!!!!!!!
View 1 Replies
View Related
Dec 25, 2007
Hi! I'm creating a social network, and in one page I need to compare each result of the datalist to a value of a table in my database. For example, I have the datalist showing all the entries in the table users, and when I am showing this information, I want each dataitem to be compared to a select statement of the friends of the logged in user, so that if that datalistitem is present in the results of that other select, I will change the text of a field to say "already a friend". If the user is not present in that select, ie is not a friend of the user who is logged in, the text will say "add friend". I have this comparison working already for a specific name, but not for the database query. Can anyone please help me? The code is below... <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %><%@ Import Namespace="System.Data" %><%@ Import Namespace="System.Data.SqlClient" %><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><script language="VB" runat="server"> Sub Page_Load(Sender As Object, E As EventArgs) Dim DS As DataSet Dim MyConnection As SqlConnection Dim MyCommand As SqlDataAdapter MyConnection = New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True") MyCommand = New SqlDataAdapter("select * from aspnet_Users where IsAnonymous='False'", MyConnection) 'Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|;Integrated Security=True;User Instance=True DS = New DataSet() MyCommand.Fill(DS, "aspnet_Users") MyDataList.DataSource = DS.Tables("aspnet_Users").DefaultView MyDataList.DataBind() End Sub</script><body> <br /> <ASP:DataList id="MyDataList" RepeatColumns="1" runat="server"> <ItemTemplate> <table cellpadding="10" style="font: 10pt verdana" cellspacing="0"> <tr> <td width="1" bgcolor="BD8672"/> <td valign="top"> </td> <td valign="top"> <div id="hey"><div id="dados"><b>Name: </b><%#DataBinder.Eval(Container.DataItem, "UserName")%><br><b>city: </b><%#DataBinder.Eval(Container.DataItem, "City")%><br></div> <div id="photo"><b>Photo: </b><%#DataBinder.Eval(Container.DataItem, "UserName")%><br>status: </div> <p></div> <a href='<%# DataBinder.Eval(Container.DataItem, "UserName", "purchase.aspx?titleid={0}") %>' > <%#IIf(Container.DataItem("UserName") = "marta", "<a href='mailto:" & Container.DataItem("UserName") & "'>Email</a>", "")%> <img border="0" src="/quickstart/aspplus/images/purchase_book.gif" > </a> </td> </tr> </table> </ItemTemplate> </ASP:DataList> </body></asp:Content> Thanks a lot.
View 5 Replies
View Related
Apr 22, 2006
Everything works great on my development box. I am using GoDaddy for production (ASP.Net v2, SQL 2000).
I am not receiving any errors, so I am stumped; no data from the database is displaying on the GoDaddy pages.
I updated the connection string in web.config to this:
< add name="snsb" connectionString="
Server=whsql-vXX.prod.mesaX.secureserver.net;
Database=DB_42706;
User ID=username;
Password=pw;
Trusted_Connection=False" providerName="System.Data.SqlClient" / >
But I am unsure if this is the issue?? Any insights? This is the page I am working on: www.sugarandspicebakery.com/demo/bakery/default.aspx. So, the page displays fine, but it should be showing data from the database. This particular page uses a DataList with ItemTemplate. There is definitely data in the database, and I have even ran the same exact query from the code using the Query Analayzer on GoDaddt and it returned results
I know there isn't much info to go by, but I am hoping someone has some insight since I have been trying to figure this out for days now!
Thank youJennifer
View 2 Replies
View Related
Oct 6, 2006
Hello!I have two tables:Pressreleases:| Pressrelease_ID | PressDate | FilePath | Title |PressLinks:| PressLink_ID | PressLinkDate | PressLinkUrl | PressText |I would like to select the the TOP 3 with the most recent dates from either Pressreleases or PressLinks, and present them in a DataList. How do I do that? Selecting from one table is no problem:SELECT TOP 3 Pressreleases.PressDate, Pressreleases.Filepath, PressReleases.Title FROM Pressreleases ORDER BY PressDate DESCHow do I select from both tables and rename the columns to Date, Path, Text so that I can use it in a Datalist?Thank you in advance!
View 4 Replies
View Related
Aug 26, 2007
Hello, I'm really stuck at trying to figure out how to write out the proper SQL statement for my problem. I'm relatively new to SQL, so this may not be so tough for some of you. Basically, a user logs in (I'm using the default membership provider) and goes to his INBOX to see his list of messages sent to him. The list is presented to him via a datalist. Each item of the datalist contains a table of 2 columns and 1 row as pictured below. The first box contains the user photo and user name of the person who SENT him the message (not the logged in user). The second box contains the subject title of the message.
FROM | SUBJECT | User Photo | || | Subject || User Name | |
Here is the list of the relevant 4 tables of my database and the relevant fields.....
aspnet_Users tableUserId (used to link to Member table)UserName
Member tablememberId (int - primary key)UserId (guid - used to link to aspnet_Users table)primaryPhotoId (int - used to link to Photo table)
Photo tablephotoId (int - primary key)photoUrl (string - path to file on local drive)
Message tablemessageId (int - primary key)fromMember (int - connects with memberId from Member table)toMember (int - connects with memberId from Member table)subject (varchar(max))
So basically, from a simplistic high level point of view, the datalist is going to list all of the messages where Message.toMember = the logged in user. The senders will be determined by the Member.fromMember fields. Intuitive enough so far, I guess. This is the SQL statement I have so far.....
SELECT aspnet_Users.UserName, Message.subjectFROM aspnet_Users, Member, MessageWHERE aspnet_Users.UserName = Profile.UserName AND aspnet_Users.UserId = Member.UserId AND Member.memberId = Message.toMember
Note that I'm grabbing the logged in user info from Profile.UserName. So far, this SQL statement should make the datalist crank out all messages that were sent to the logged in user. HOWEVER, how would I modify this so that the datalist generates the username of the sender, NOT the receiver (aka person who logged in)? Do you see the core of my dilemna here? I'm trying to get a resultset based on the Message.toMember (the logged in user), but also want data on the sender (the Message.fromMember so I can use the username and the photo of the SENDER, not the person logged in aka the RECEIVER). Currently, the aspnet_Users in the SELECT statement gets the username of the logged in person, not the sender.
And once we solve the issue of retrieving the sender's username, I also have to get his MAIN photo (I say "main" since a user can have multiple photos and the main one is determined by the value in a given member's primaryPhotoId field of the Member table) ?? I'm a newbie to ASP.NET and to databases in general so this may not be as tough for most of you and perhaps you're laughing at the simplicity hehe. The SQL statement so far asks to retrieve information based on the logged in user. But how do I also tell it to now go grab the Message.fromMember data, go back to the Member table to A)get the username after going back to the aspnet_Users table and B) to get the Member.primaryPhotoId, and then finally to the Photo table where the Photo.photoUrl string value is obtained..... and still hang on to the results I have up until now? And since I'm using the provided datalist control, I think I need to get all the results I need with just one SQL statement. This is indeed very very complicated for me lol.
This problem has been giving me migraines this whole weekend. Has anyone been through such a problem before? Any help would be greatly appreciated - thanks in advance.
View 22 Replies
View Related
Sep 26, 2007
I am coding a DataList control for 2 column data from a stored procedure. The 1st column isprogramName and the 2nd is programLink. I used Edit Template -> Edit DataBonding to add<h ref="http.....>, but can not get it right. Please help. Also, what is the Parameter Sourcefor using Logon User ID as a stored procedure paramter when configuring a SqlDataSource? None, cookie, control,..? TIA,Jeffrey
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" Style="z-index: 16;left: 29px; position: absolute; top: 82px"><ItemTemplate>programName:<asp:Label ID="programNameLabel" runat="server" Text='<%# Eval("programName") %>'></asp:Label><br />programlink:<asp:Label ID="programlinkLabel" runat="server" Text='<%# Eval("programlink") %>'></asp:Label><br /><br /></ItemTemplate></asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:iTemplatesConnectionString %>"SelectCommand="MyPrograms" SelectCommandType="StoredProcedure"><SelectParameters><asp:Parameter Name="meid" Type="Int32" DefaultValue="3532" /></SelectParameters></asp:SqlDataSource>
View 4 Replies
View Related
Jan 27, 2008
Hi All,
I am placing a Matrix inside the table control for grouping requirements,but when we export the report to the Excel, the contents inside the table cell are ignored. Is there any way to get the full report exported, as per the Requirement.Please help me with this issue.
With Thanks
M.Mahendra
View 5 Replies
View Related
Oct 25, 2007
does any one have and example of how to embedd a flash swf file onto a report.??? Is it possable? any examples would be helpful.
View 1 Replies
View Related
Apr 20, 2007
I am using the 3-tiered architecture design (presentation, business laws, and data acess layers). I am stuck on how to send the image the user selects in the upload file control to the BLL and then to the DAL because the DAL does all the inserts into the database. I would like to be able to check the file type in the BLL to make sure the file being uploaded is indeed a picture. Is there a way I can send the location of the file to the BLL, check the filetype, then upload the file and have the DAL insert the image into the database? I have seen examples where people use streams to upload the file directly from their presentation layer, but I would like to keep everything seperated in the three classes if possible. I also wasn't sure what variable type the image would be in the function in the BLL that receive the image from the PL. If there are any examples or tips anyone can give me that would be appreciated.
View 2 Replies
View Related
Jun 27, 2007
Hay Friend's
Can u plese send me the way how to save image in sql server and display that images in datagrid or other control also like Image control or Image control Button?? Plese send the coding in C#.
Thank's
Amit
View 5 Replies
View Related
Jul 12, 2007
hi all,
i have created a table with image field in it. Now i just want to store a jpeg file in it but not finding any way to do so.
how can i store any image ? what are the steps???????
thanx in advance
View 5 Replies
View Related
Jul 6, 2006
Ok, the problem is that , i have a field called "Attach" in sql of type image, when selecting it , the field is getting data of type BYTE(). which am being unable to display them on an Image on the panel.
using the following vb.net code:
'Dim sel2 As String
'Dim myCom As SqlCommand
'Dim conn As New SqlConnection
'Dim drr As SqlDataReader
'Dim image As System.Drawing.Image
'sel2 = "select * from attach where att_desc = '" & DropDownList1.SelectedItem().Text & "' and doc_code = " & w_doc_code & " and subcode = " & w_doc_subcode & " and doc_num= " & w_doc_num & " "
'conn.ConnectionString = ("server=developer01;uid=sa;password=aims;database=DVPSOC;timeout=45")
'myCom = New SqlCommand(sel2, conn)
'conn.Open()
'drr = myCom.ExecuteReader()
'If drr.Read Then
' Me.ImageMap1.ImageUrl = drr.Item("attach")
'End If
'conn.Close()
Am getting an exeption on the following line Me.ImageMap1.ImageUrl = drr.Item("attach")
saying: Conversion from type 'Byte()' to type 'String' is not valid.
knowing that i tried converting using ToString but it's not getting any output then.
thanks for your help.
View 4 Replies
View Related
Mar 7, 2006
hi,i have inserted the image present in mydocuments using alter commandcreate table aa(a int, d image)insert into aa values (1,'F:prudhviaba 002.jpg')when i doselect * from aai am getting the result in the column d as0x463A5C707275646876695C70727564687669203030322E6A 7067how i can i view the image?pls clarify my doubtsatish
View 2 Replies
View Related
Aug 17, 2007
Hi,
I have a website and i am uploading the gif image to the database. i have used varchar(500) as the datatype and i am saving the file in the webserver so the path to it c:intepub....a.gif
my upload table has the folliwing feilds
UploadId Int Identity, Description, FileName, DiskPath varchar(500), weblocation varchar(500). I have a main sproc for the report where i am doing a inner join with other table to get the path of the gif..
So my question is how can i get a picture to show up on the report. .
What kinda datatype the gif file should be stored in the database? If it is stored as a varchar how can i access it and what is best way to reference that particular.
any help will appreciated....
Regards
Karen
View 9 Replies
View Related
Sep 20, 2006
I have inherited a VS 2005 database with a table that has a column of type IMAGE. I need to change the image for one of the rows in the table. I have the new image in a *.PNG file on my C: drive. What is the correct method for inserting this file into the IMAGE column.
Many thanks!
View 6 Replies
View Related
Mar 20, 2007
UPDATE #2: When it said "Do you want to install Microsoft SQL Server" I said "yes" and that caused it to work. I exited and re-ran and now the print runs w/o the "install SQL Server" (If the prompt had said "Do you want to install the print dialog" we wouldn't be having this discussion...)
UPDATE: After posting this i discovered that the same thing occurs when attempting to print the report direct from IE6: First a dialog pops up "Do you want to install this software?" Name: Microsoft SQL Server. When I click "Don't Install" I get the dialog "unable to load client print control." Since this happens direct from IE6 I suspect it's browser settings. I'll resume tomorrow and post a followup.
My WinForm C# app integrates Reporting Services by calling them from WebBrowser controls. The problem is attempts to print cause a dialog: "unable to load client print control."
I've read prior posts that say "enable Active-X in your browser" - I don't know how to do that from a WebBrowser control.
Any ideas how to support Reporting Services "Print" from within a WebBrowser control?
RELATED THREADS
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=332145&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=264478&SiteID=1
View 1 Replies
View Related