<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Homespun &#187; .net</title>
	<atom:link href="http://www.janinedalton.com/blog/archives/category/web-dev/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.janinedalton.com/blog</link>
	<description>Random ramblings from a freelance web developer in Dublin, Ireland</description>
	<lastBuildDate>Tue, 31 May 2011 09:23:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>AdWords API problems</title>
		<link>http://www.janinedalton.com/blog/archives/2005/adwords-api-problems/</link>
		<comments>http://www.janinedalton.com/blog/archives/2005/adwords-api-problems/#comments</comments>
		<pubDate>Sat, 30 Jul 2005 04:41:36 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[techy]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=104</guid>
		<description><![CDATA[I finally started using the Google AdWords API this week. Generally, this allows you to do anything you do by logging on to the Adwords site programmatically. However, it seems there are some things you can only do through the UI at the moment and even a few things you can more easily do through [...]]]></description>
			<content:encoded><![CDATA[<p>I finally started using the <a href="http://www.google.com/apis/adwords/" rel="tag">Google AdWords API</a> this week. Generally, this allows you to do anything you do by logging on to the <a href="https://adwords.google.com/select/main?cmd=Login&amp;sourceid=mktadv&amp;subid=adwords&amp;hl=en_US">Adwords site</a> programmatically. However, it seems there are some things you can only do through the UI at the moment and even a few things you can more easily do through the API.</p>
<p>The service is in Beta at the moment (like most Google services!) and as such has limited support. Basically, there are references and <a href="http://www.google.com/support/adwordsapi/">lots of help docs</a>, some sample code and a <a href="http://groups.google.com/group/adwords-api">developer&#8217;s forum</a> which is not exactly buzzing. The documentation is easy enough to follow and there is a fair amount of it. However, I found that it may not be complete.</p>
<p>I am only using the API with C# in very straightforward ways to gather reports, but I have already come across 2 occasions where following the instructions has not worked.</p>
<p>The first thing I had trouble with was setting the <var>aggregationType</var> for my reports. Although I was specifying:</p>
<p><code>myReportJob.aggregationType = AggregationType.Daily;</code></p>
<p>I found that I was stuck with the Summary view!<br />
I only found the solution by chance when I saw a line of code I was missing in a post on the <a href="http://groups.google.com/group/adwords-api">developer&#8217;s forum</a>:</p>
<p><code>myReportJob.aggregationTypeSpecified = true;</code></p>
<p>I still cannot find this line mentioned in the documentation and it seems weird to me that you need it. Surely you are specifying the aggregation type by setting a value for it?!</p>
<p>I am still looking for a solution for my second problem. To use the AdWords API, you need to have a My Client Center (MCC) account. The idea is that the MCC account links all your AdWords accounts together in a central place. They all still exist separately, but the MCC provides a parent level of access where you can drill down to each account but also perform operations on  multiple accounts together. This is useful for search marketing companies who manage AdWords campaigns for multiple clients.</p>
<p>Google recently added reporting functionality to the MCC, so that it is now possible to create just one report in the MCC that includes data for all accounts. Since API usage is limited to a certain quota of operations each month, depending on how many accounts you have and how much you spend, this feature is great. It means that you can just run one report instead of one for each account which is far more efficient. Except I cannot get this to work!</p>
<p><strong>Update: I have seen reports on the developer forum that if you add a line ReportJob.crossClientSpecified = true, then generating a report at MCC level will work.</strong></p>
<p>The <a href="http://www.google.com/apis/adwords/developer/adwords_api_services.html#ReportService_section">relevant Adwords documentation</a> states the following:</p>
<blockquote>
<p>If you have registered with My Client Center (MCC) to administer<br />
accounts on behalf of your clients, you can get reports about your<br />
clients&#8217; AdWords accounts. To do this, login without setting the<br />
clientEmail header. When setting up the report job, you need to set the crossClient and clientAccounts fields. Set crossClient to true, and specify a list of the Ids of the accounts to include in the report as the value of the clientAccounts field.</p>
<p>If you set the crossClient field to true and do not supply a value for clientAccounts, the generated reports include all the client accounts</p>
</blockquote>
<p>These instructions seemed simple enough, but when I use the following C# code while specifying the MCC account login details, all I get is empty report columns with zero totals:</p>
<p><code><br />
//#instantiate Report service<br />
ReportService service = new ReportService();</p>
<p>String myUseragent = "SMCM: Get report for all campaigns";<br />
String myEmail = "***[MCC Account Email]***";<br />
String myPassword = "***[MCC Account Password]***";<br />
String myToken = "***[MCC Account Token]***";<br />
DateTime myStartDate = new DateTime(2005,7,21,12,0,0);<br />
DateTime myEndDate = myStartDate.AddDays(4);<br />
String myReportName = "test";</p>
<p>//#set service properties<br />
service.useragentValue = new useragent();<br />
service.useragentValue.Text = new String[] { myUseragent };<br />
service.emailValue = new email();<br />
service.emailValue.Text = new String[] { myEmail };<br />
service.passwordValue = new password();<br />
service.passwordValue.Text = new String[] { myPassword };<br />
service.tokenValue = new token();<br />
service.tokenValue.Text = new String[] { myToken };</p>
<p>//#create report job<br />
KeywordReportJob myReportJob = new KeywordReportJob();<br />
//#set report job parameters<br />
//#set crossClient to true to access individual a/cs from MCC a/c<br />
myReportJob.crossClient = true;<br />
//#don't set clientAccounts so that all individual a/cs will be<br />
included<br />
//#don't set campaigns so that all campaigns will be included<br />
//#don't set keywordStatuses or keywordType so that all will be<br />
included<br />
myReportJob.aggregationType = AggregationType.Daily;<br />
myReportJob.startDate = myStartDate;<br />
myReportJob.endDate = myEndDate;<br />
myReportJob.name = myReportName;</p>
<p></code></p>
<p>If I specify login details for an individual account instead, I get a complete report which suggests that my code must be OK in the main. Maybe I have missed something in the docs or perhaps there is another magic line of code I&#8217;m missing. At the moment, I have to run a report for each account so if you know where I am going wrong, please enlighten me!</p>
<p>A final niggle I have found is that even though I just want to replicate running a Keyword report, I have to run a Custom report to get the info I need. This is because even though you can check a box on the UI to include conversions for a Keyword report, the same option cannot be set in the API, unless the docs forgot to mention that as well. This is a minor gripe, but Custom reports are slightly longer and messier to code as you have to specify all the columns you want etc. It would be nice if the API mirrored the UI. Perhaps when (if?) the service comes out of Beta the 2 will be perfectly in sync.</p>
<p>Overall, it is fantastic that Google have made an API for AdWords freely available and are continually improving and extending its functionality. It is just frustrating when you run into issues and the chances of resolving these quickly is drastically low due to the lack of real time support.</p>
<h4>Useful links:</h4>
<ul>
<li><a href="http://groups.google.com/group/adwords-api">AdWords API developer forum</a></li>
<li><a href="http://www.google.com/support/adwordsapi/">AdWords API support</a></li>
<li><a href="http://adwordsapi.blogspot.com/">AdWords API blog</a></li>
<li><a href="http://www.google.com/apis/adwords/">AdWords API home page</a></li>
<li><a href="http://www.webmasterworld.com/forum81/">Webmaster World AdWords forum</a></li>
<li><a href="http://forums.digitalpoint.com/forumdisplay.php?f=35">Digital Point AdWords forum</a></li>
<li><a href="http://forums.digitalpoint.com/forumdisplay.php?f=35">SEO CHAT AdWords forum</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2005/adwords-api-problems/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Dreamweaver SQL Server connection: test works, but no tables found</title>
		<link>http://www.janinedalton.com/blog/archives/2005/dreamweaver-sql-server-connection-test-works-but-no-tables-found/</link>
		<comments>http://www.janinedalton.com/blog/archives/2005/dreamweaver-sql-server-connection-test-works-but-no-tables-found/#comments</comments>
		<pubDate>Sun, 06 Mar 2005 10:14:02 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=60</guid>
		<description><![CDATA[If you have SQL Server connections to databases on localhost in ASP.NET applications in Dreamweaver MX 2004 and they have suddenly stopped working, or you can&#8217;t create new connections, here is one possible reason. If you installed Windows XP SP2, this breaks the functionality in Dreamweaver which enables you to connect to local SQL Server [...]]]></description>
			<content:encoded><![CDATA[<p>If you have SQL Server connections to databases on localhost in ASP.NET applications in <a href="http://www.macromedia.com/software/dreamweaver/">Dreamweaver MX 2004</a> and they have suddenly stopped working, or you can&#8217;t create new connections, here is one possible reason.</p>
<p>If you installed <a href="http://www.microsoft.com/windowsxp/sp2/default.mspx">Windows XP SP2</a>, this breaks the functionality in Dreamweaver which enables you to connect to local SQL Server databases. Handy or what? <img src='http://www.janinedalton.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Luckily, <a href="http://www.macromedia.com/software/dreamweaver/">Macromedia</a> have released an extension to fix this. You can find out more info about the problem and instructions on how to solve it by clicking the link below:</p>
<p><a href="http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19515#aspnet_db">Database connectivity fails with local ASP.NET and ASP servers</a></p>
<p>I came across a few issues in applying the fix. I got &#8220;unable to remove connection scripts: access denied&#8221; errors. However, if I manually removed the connection tags from the web.config file that worked. Then I needed to restart Dreamweaver a few times to get all sites to co-operate. Eventually, everything works again&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2005/dreamweaver-sql-server-connection-test-works-but-no-tables-found/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>checking if a list web control contains an item</title>
		<link>http://www.janinedalton.com/blog/archives/2005/checking-if-a-list-web-control-contains-an-item/</link>
		<comments>http://www.janinedalton.com/blog/archives/2005/checking-if-a-list-web-control-contains-an-item/#comments</comments>
		<pubDate>Fri, 18 Feb 2005 02:40:28 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=51</guid>
		<description><![CDATA[when setting the selected value in a radiobuttonlist or other list web control in asp.net, it is prudent to check whether the list contains the option you intend selecting first! this avoids those annoying &#8220;out of range&#8221; error messages. one way of doing this is to use code similar to the following: if not myRadioButtonList.Items.FindByValue(&#34;whatever&#34;) [...]]]></description>
			<content:encoded><![CDATA[<p>when setting the selected value in a radiobuttonlist or other list web control in asp.net, it is prudent to check whether the list contains the option you intend selecting first! this avoids those annoying &#8220;out of range&#8221; error messages.</p>
<p>one way of doing this is to use code similar to the following:</p>
<pre>
if not myRadioButtonList.Items.FindByValue(&quot;whatever&quot;)
 is nothing then
    myRadioButtonList.selectedValue=&quot;whatever&quot;
end if</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2005/checking-if-a-list-web-control-contains-an-item/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>irish .net events</title>
		<link>http://www.janinedalton.com/blog/archives/2005/irish-net-events/</link>
		<comments>http://www.janinedalton.com/blog/archives/2005/irish-net-events/#comments</comments>
		<pubDate>Tue, 08 Feb 2005 15:05:45 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[irish]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=48</guid>
		<description><![CDATA[i&#8217;ve been under the weather again and an unfortunate casualty this time was a microsoft introductory .net lab which i was supposed to attend today i was really looking forward to learning what visual studio had to offer and getting an overview of the exciting features coming in asp.net 2.0. luckily, there seem to be [...]]]></description>
			<content:encoded><![CDATA[<p>i&#8217;ve been under the weather again and an unfortunate casualty this time was a microsoft introductory .net lab which i was supposed to attend today <img src='http://www.janinedalton.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>i was really looking forward to learning what visual studio had to offer and getting an overview of the exciting features coming in <a href="http://www.asp.net/whidbey/">asp.net 2.0</a>. luckily, there seem to be lots of events coming up.</p>
<p>a few handy sites for keeping up to date on the latest events and offers are:</p>
<ul>
<li><a href="http://www.developers.ie/">developers.ie</a> &#8211; irish .net developers alliance</li>
<li>microsoft ireland,  developer and platform evangelism (dpe) team blogs: <a href="http://blogs.msdn.com/robburke/">rob burke</a> and <a href="http://weblogs.asp.net/clare_dillon/">clare dillon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2005/irish-net-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The server committed an HTTP protocol violation</title>
		<link>http://www.janinedalton.com/blog/archives/2004/the-server-committed-an-http-protocol-violation/</link>
		<comments>http://www.janinedalton.com/blog/archives/2004/the-server-committed-an-http-protocol-violation/#comments</comments>
		<pubDate>Thu, 28 Oct 2004 04:57:28 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=22</guid>
		<description><![CDATA[Thanks to Communication WEB for pointing out a fix to this error which started springing up after .NET Framework 1.1 SP1 was released. To enhance security, this error will be raised on fetching from a web site if the server&#8217;s HTTP headers obey certain rules e.g. there cannot be a space in the header name. [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a title="The server committed an HTTP protocol violation" href="http://dotnetjunkies.com/WebLog/afontes/archive/2004/10/15/28726.aspx">Communication WEB</a> for pointing out a fix to this error which started springing up after .NET Framework 1.1 SP1 was released. To enhance security, this error will be raised on fetching from a web site if the server&#8217;s HTTP headers obey certain rules e.g. there cannot be a space in the header name. The problem is that some websites do not conform.<br />
To avoid errors on trying to fetch from these sites, you can add the following to your web.config file:</p>
<p>&lt;configuration&gt;<br />
   &lt;system.net&gt;<br />
     &lt;settings&gt;<br />
        &lt;httpWebRequest useUnsafeHeaderParsing=&quot;true&quot; /&gt;<br />
     &lt;/settings&gt;<br />
   &lt;/system.net&gt;<br />
&lt;/configuration&gt;</p>
<p>If you have a batch file or console application that is affected, you can resolve the issue by making a file called yourapp.exe.config (where yourapp is the name of your executable) containing the above code. You may need to precede this with the line:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243; ?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2004/the-server-committed-an-http-protocol-violation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>altering controls with dynamic data sources in dreamweaver</title>
		<link>http://www.janinedalton.com/blog/archives/2004/altering-controls-with-dynamic-data-sources-in-dreamweaver/</link>
		<comments>http://www.janinedalton.com/blog/archives/2004/altering-controls-with-dynamic-data-sources-in-dreamweaver/#comments</comments>
		<pubDate>Tue, 21 Sep 2004 15:47:53 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=18</guid>
		<description><![CDATA[If I&#8217;m binding a web control to database values, I generally set it&#8217;s properties at run time in the page_load or page_prerender events. However, since Dreamweaver has its own databinding event going on at page load, you can’t refer to controls that have dynamic data sources populated by Dreamweaver there as they will still be [...]]]></description>
			<content:encoded><![CDATA[<p>If I&#8217;m binding a web control to database values, I generally set it&#8217;s properties at run time in the page_load or page_prerender events. </p>
<p>However, since Dreamweaver has its own databinding event going on at page load, you can’t refer to controls that have dynamic data sources populated by Dreamweaver there as they will still be empty then!</p>
<p>Instead, you need to attach an onload event to the control and put the relevant code inside that function instead.</p>
<p>For example, if Dreamweaver is populating a dropdownlist from a mm:dataset, you can set the selected value from within a sub which you attach to the dropdownlist&#8217;s onload event.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2004/altering-controls-with-dynamic-data-sources-in-dreamweaver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>looking for isnumeric in vb.net?</title>
		<link>http://www.janinedalton.com/blog/archives/2004/looking-for-isnumeric-in-vbnet/</link>
		<comments>http://www.janinedalton.com/blog/archives/2004/looking-for-isnumeric-in-vbnet/#comments</comments>
		<pubDate>Sun, 04 Jul 2004 13:06:12 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=10</guid>
		<description><![CDATA[i was wondering why a vb.net class file was throwing up errors when i called the isnumeric function the other day. after some googling i found out from roy osherove&#8217;s blog that you now need to import the microsoft.visualbasic namespace to use this and a bunch of other once standard functions. as an aside, if [...]]]></description>
			<content:encoded><![CDATA[<p>i was wondering why a vb.net class file was throwing up errors when i called the isnumeric function the other day. after some googling i found out from <a href="http://weblogs.asp.net/rosherove/archive/2003/09/15/27519.aspx">roy osherove&#8217;s blog</a> that you now need to import the microsoft.visualbasic namespace to use this and a bunch of other once standard functions.</p>
<p>as an aside, if you want to pause your program and are wondering why sleep() does not seem to work, you now need to reference system.threading.thread.sleep() instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2004/looking-for-isnumeric-in-vbnet/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>mm:dataset not well formed errors</title>
		<link>http://www.janinedalton.com/blog/archives/2004/mmdataset-not-well-formed-errors/</link>
		<comments>http://www.janinedalton.com/blog/archives/2004/mmdataset-not-well-formed-errors/#comments</comments>
		<pubDate>Wed, 19 May 2004 17:19:57 +0000</pubDate>
		<dc:creator>janine</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://janinedalton.com/wp/?p=6</guid>
		<description><![CDATA[if you are using dreamweaver mx to code asp.net applications you will probably be using a lot of mm:dataset tags. if you ever need to edit the commandtext attribute of the mm:dataset tag, you may well see the charming error message &#8220;The server tag is not well formed&#8221;. one possible reason for this error is [...]]]></description>
			<content:encoded><![CDATA[<p>if you are using dreamweaver mx to code asp.net applications you will probably be using a lot of mm:dataset tags. if you ever need to edit the commandtext attribute of the mm:dataset tag, you may well see the charming error message &#8220;The server tag is not well formed&#8221;.</p>
<p>one possible reason for this error is the presence of single quotes in your query. for example, the following code will not work:</p>
<p>CommandText=&#8217;&lt;%# &#8220;SELECT substring(description, 0, CHARINDEX(&#8216; &#8216;, description, 200)) as intro FROM products&#8221; %&gt;&#8217;</p>
<p>luckily there is an easy way to get rid of this error. simply remove the outer single quotes surrounding the attribute:</p>
<p>CommandText=&lt;%# &#8220;SELECT substring(description, 0, CHARINDEX(&#8216; &#8216;, description, 200)) as intro FROM products&#8221; %&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.janinedalton.com/blog/archives/2004/mmdataset-not-well-formed-errors/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

