Showing posts with label displaying. Show all posts
Showing posts with label displaying. Show all posts

Thursday, March 22, 2012

Data results to Variables

Hello,

I am using VWD, SQL EE, VB

I have a select statement with a varaiable in it (as below). Rather than displaying the results directly in a DetailsView I want to add the results to a set of variables (Dim XXX as String etc) so I can check to see if each variable contains data or not, before then displaying only those lines which contain data. Can anyone suggest how I go about linking each data field to a variable?

SELECT PID, Postcode, Address1, Address2, Address3, Address4, Address5, Town_City, County, Postcode AS Expr1
FROM postcode
WHERE (Postcode = @.Postcode)

cheers

marco gwiliani

Hi Marco,

If you haven't done so already, i would suggest giving a really good look at the data tutorials here on asp.net. It's well worth the time and the examples are in both VB and C#.

|||

Yes Marco,

I would suggest you start from learning ADO.NET. Here is a good place to start.

http://msdn2.microsoft.com/en-us/library/h43ks021.aspx

Sunday, March 11, 2012

Data not printing from crystal report generated using parameterized query in ASP

Data not printing from crystal report (9.0) generated using parameterized query in ASP.Net (Visual Studio 2003). But data is displaying properly. Tried changing the font to printer font, but no luck.
Any ideas?
Thanks,
Narayana Murty.Is there a problem in Printer settings?
Check the network

Data not displaying (in DataList) from SQL on GoDaddy

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:

<addname="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 you

JenniferPost the code that you bind the datalist with the data source.
|||

Here is the code:

<asp:SqlDataSourceID="snsb"runat="server"ConnectionString="<%$ ConnectionStrings:snsb %>"SelectCommand="SELECT [itemNumber], [name], [shortDescription], [category], [imageFileName] FROM [snsb] WHERE ([category] = @.category)"EnableCaching="true"><SelectParameters><asp:QueryStringParameterDefaultValue="Cakes"Name="category"QueryStringField="cat"Type="String"/>
</SelectParameters></asp:SqlDataSource><asp:DataListID="DataList1"runat="server"RepeatColumns="3"RepeatDirection="Horizontal"CellPadding="25"AlternatingItemStyle-BorderWidth="1"DataSourceID="snsb"><ItemTemplate>

<asp:HyperLinkID="HyperLink1"runat="server"NavigateUrl='<%# "~/bakery/item.aspx?item=" + Eval("itemNumber") %>'>
<asp:Imagerunat="server"BorderColor="#000000"BorderStyle="solid"BorderWidth="1"ImageUrl='<%# "../images/page/" + Eval("itemNumber") + "_a.jpg" %>'Width="123"Height="82"/></asp:HyperLink><br/>
<%# Eval("name") %><br/>
<%# Eval("shortDescription") %>
</ItemTemplate></asp:DataList>

Sorry it looks all over the place here on the forum, the insert code option doesn't appear to be working correctly.

Thanks,

Jennifer