AccessDataSource constraining results?

G

Guest

Hi guys

I'm having a really strange error which I can't wor out, so I thought I'd
post it here cos I'm not sure if it's a datasource problem or otherwise.

I have a site with an Access MDB file, and a page which uses an
AccessDataSource to display data in labels and DIVs.

All was working fine, but I've suddenly noticed that one of the fields is
"cut off" half way through the text. It was an asp:label originally, but I
changed it to a div and it's still chopping.

Looking at the database in VS, the cell is fine. The text I entered is
displayed in its entirety when I view the table data. However, the text on
the page (and the div.InnerText watch) is only showing me *about* 250
characters.

Any ideas why?!?! Thanks...


Dan
 
G

Guest

I've also just noticed that it's the Query that's cutting off the text.
Here's the SQL...

SELECT Stories.StoryTitle, Stories.Synopsis, Stories.Story, Stories.Name
AS StoryOwner, Stories.Visits, Stories.PayPalEmail, COUNT(Comments.CommentID)
AS ComCount
FROM (Stories LEFT OUTER JOIN
Comments ON Stories.StoryID = Comments.StoryID)
WHERE (Stories.StoryID = ?)
GROUP BY Stories.StoryTitle, Stories.Synopsis, Stories.Story, Stories.Name,
Stories.Visits, Stories.PayPalEmail

The field that is being chopped is "Stories.Story" - an Memo field.

So, why is the SQL query chopping the text?!
 
S

Steven Cheng[MSFT]

Hello Dan,

From your description, when you use the ADO.NET component to query some
data from an access mdb file, the returned Memo field text value is
incorrectly shortened, correct?

Regarding on this issue, I've just performed some simple test on my local
side. I use OleDbCommand/Connection to manually query a access mdb file and
bind the Memo field to a repeater and it seems work correct(the returned
text is not cut). Here is my test page's aspx and code behind function

=============aspx=========
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<hr /><br /><%# Eval("MemoText") %>
</ItemTemplate>
</asp:Repeater>

======code==============
protected void BindData()
{
using (OleDbConnection conn = new
OleDbConnection(ConfigurationManager.ConnectionStrings["testdbConnectionStri
ng"].ConnectionString))
{
conn.Open();

string sql = "SELECT [ID], [Name], [MemoText] FROM [memotable]";
OleDbCommand comm = new OleDbCommand(sql, conn);

IDataReader reader = comm.ExecuteReader();


Repeater1.DataSource = reader;

Repeater1.DataBind();


reader.Close();


}
}
======================================

I think the problem is likely specific to the page or the database file.
Maybe my test data is not large enough to repro the problem. Have you tried
testing through some other mdb database table(contains memo field) to see
whether the same problem occur? If convenient, would you post your page's
databinding template and code so that I can also take a look into it?

Please feel free to let me know if you have any further finding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Hello Dan,

How are you doing on this issue, have you got any further progress? If you
still need any assistance on this, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top