.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

trying to loop thru dataset to populate google map properties

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
I have the following code which works fine, but its hard coded to specific row and columns. And the Labels are just there for visual confirmation on the page, that will not be part of the final setup. How can i loop thru my dataset and populate the marker code for each row in the dataset? DataSet ds = (DataSet)Session["MapData"]; if (ds != null) { GoogleMap1.Latitude = 32.8030; GoogleMap1.Longitude = -96.7699; GoogleMap1.Zoom = 6; GoogleMarker bm = new GoogleMarker(); bm.Latitude = Convert.ToInt32(ds.Tables[0].Rows[0][4]); bm.Longitude = Convert.ToInt32(ds.Tables[0].Rows[0][5]); bm.Text = ds.Tables[0].Rows[0][7].ToString(); GoogleMarker bm1 = new GoogleMarker(); bm1.Latitude = Convert.ToInt32(ds.Tables[0].Rows[1][4]); bm1.Longitude = Convert.ToInt32(ds.Tables[0].Rows[1][5]); bm1.Text = ds.Tables[0].Rows[1][7].ToString(); GoogleMap1.Markers.Add(bm); GoogleMap1.Markers.Add(bm1); Label1.Text = "Not Empty"; } else { Label1.Text = "Is Empty"; } Any help woudl be great. thanks.

View Complete Post

More Related Resource Links

populate dataset from XML obtained from URL

I'm building a website for a client who gets their news from an external source. Their news is in XML and is retrieved via a URL similar to this http://news.domainname.com/LatestNewsXML?custID=1234 I was hoping to grab this news and use it to populate a dataset, could anyone please provide a sample code of how I could do this?  I've developing in .Net 2.0 with C#. Many thanks.

Foreach Loop Container.ForEachEnumerator.Properties[FileSpec] Exception -This occurs when an attempt

I run into the following 2 exceptions when I execute a package on SQL Server 2005 64 bit machine. The package fails when SQL Server version is 9.0.3310 which is a production box. I have tested it on 3 others development boxes with SQL version 9.0.1399, 9.0.3315 & 9.0.4053 and the package executes fine. I am unable to make a determination if this issue is related to SQL versions or a bug in the package design. I would like to understand the exception better before I request an SP3 & patches installed to upgrade it to version 9.0.4053 on the production box. I have scheduled jobs to run these packages and we are trying to locate Excel files on a drive using For Each Loop Enumerator. The packages are configured to use configuration files. Please note the destination directory does have the Excel files we are looking for. Source: Well_Test_Package Description: The package path referenced an object that cannot be found: "\Package\Daily Alloc Spread Sheet Foreach Loop Container.ForEachEnumerator.Properties[Directory]". This occurs when an attempt is made to resolve a package path to an object that cannot be found.  End Warning  Warning: 2010-08-31 00:41:13.66     Code: 0x80012017     Source: Well_Test_Package      Description: The package path referenced an object that ca

Populate a DataSet from an AccessDataSource


This very good piece of code was posted last week as a solution to populating a Data Set with an Objectdatasource.

I am now trying to populate a Data Set from a AccessDataSource.

But replacing the ObjectDataSource with an AccessDataSource doesn't seem to work.

What modifications to the code are needed please !?

Private Function GetDS(ods As ObjectDataSource) As DataSetDim 
ds = New DataSet()
Dim dv = DirectCast(ods.[Select](), DataView)
If dv IsNot Nothing AndAlso dv.Count > 0 Then
Dim dt = dv.ToTable()ds.Tables.Add(dt)
End IfReturn dsEnd Function

Dataset has one field, populate a table 2 columns wide n rows deep



A dataset returns a single field of child names, instead of presenting this as a single column table, I would like it to be multi column.

Dataset returns:


I would like to display it as:

Child1 Child2 
Child3 Child4


values from one dataadapter to multiple tables in a dataset through foreach loop



 How can i fill the values from one dataadapter to multiple tables in a dataset...ie,the adapter is fetching values through foreach loop...i want to take that values into different tables of one dataset....How to do this...Hope anyone will help me....

Thanks in advance

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

5 GridView Themes Based on Google's Personalized Homepage (igoogle)

One of the silly features I have found that I like about igoogle is how the pages color palette changes depending upon the time of day. So as the day progresses from morning to afternoon to evening the colors on the page change as well. Like I said, I know this is a silly feature, but I like it. And I have asked around a little bit and seems like other people like it to. To get a better idea of how the colors change, here are the background images from a few of the HTML elements.

Automatic vs Explicit Properties

If the reason that motivated the change from automatically implemented property to explicitly implemented property was to change the semantics of the property then you should evaluate whether the desired semantics when accessing the property from within the class are identical to or different from the desired semantics when accessing the property from outside the class.

Introducing ADO.NET and the Typed DataSet

In reviewing the applications it seemed everything they were doing involved database reads, writes, and manipulation. The development staff had been reviewing the articles and code samples for ADO.NET. They had spent many years refining their existing ADO based infrastructure and perfecting their use of ADO

Create and Use a Typed DataSet by Using Visual C# .NET

This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.

Get more then google search from here

Just make it home page and enjoy more then google search you not only get google result and prizes for searching but also free ebooks and link from here like orkut,facebook,twitter,yahoomail etc...


Dependency Properties

When you begin to develop appliations with WPF, you will soon stumble across DependencyProperties. They look quite similar to normal .NET properties, but the concept behind is much more complex and powerful

Get Top 1 Record from Dataset

Many of them in need of getting the Top 1 or Top 10 records from a Dataset without going to SQL query. It is possible to do from Code Behind. I have given the code below,
The below code is to get single record from a Dataset. Also I have given for getting 8 records at Green Color.

Returning a DataSet From a Web Services: Step-by-Step

This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.


This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.

Xml File Methods and Properties

Method and Properties of XmlTextWriter class:
The XmlWriter class is a base class that outputs an XML data structure. It has methods to sequentially write XML elements in a proper hierarchy to create an XML file or other types of output streams. The System.Xml namespace provides support for the XmlWriter. It must be imported to the ASP.NET page with the directive

<%@ Import Namespace="System.Xml" %>

The XmlTextWriter

XmlWriter is an abstract class that is implemented as an extended XMLTextWriter class. The XmlTextWriter writes a sequence of XML nodes one element at a time. Output can be written to an XML file, although other streams of output data can be produced. It can create a new file or overwrite an existing file. Its non-cached writing techniques provides very fast generation of an output stream.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend