473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

VB.Net to C# conversion phenomenon

I had the following VB.Net code

ds.Tables.Add(BindData(camp_id, grid_id, cbo.SelectedValue, "CAMP"))
tbl = BindData(camp_id, grid_id, cbo.SelectedValue, "CHURN")

ds.Tables(0).ImportRow(tbl.Rows(0))

For i = 1 To ds.Tables(0).Columns.Count - 1
If IsDBNull(tbl.Rows(0).Item(i)) Or campCustomers = 0 Then
dr(i) = 0
dr1(i) = 0
Else
dr(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 100,
"0.00")
dr1(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 12 *
100, "0.00")
End If
next
Which I translated into C# like this

ds.Tables.Add(BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue),
"CAMP"));
tbl = BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue), "CHURN");

ds.Tables[0].ImportRow(tbl.Rows[0]);

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[0][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
}
else
{
dr[i] = (Convert.ToDouble (tbl.Rows[0][i]) / campCustomers *
100).ToString("#0.00");
dr1[i] = (Convert.ToDouble(tbl.Rows[0][i]) / campCustomers * 12 *
100).ToString("#0.00");
}
}

The interesting part is that under some in C# “ds.Tables[0].Rows[0][i]” does
not contain the data but I could get the date to define
“ds.Tables[0].Rows[1][i]”

And under some circumstances “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns a null value. Hence I have to access the
data with “ds.Tables[0].Rows[0][i]”

In VB.Net that does not cause any problems it seems it always accesses the
“right” row even if “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns null.

I found a (dodgy) workaround in C# to test what value is in the row and then
define which rownumber to use.

If “ds.Tables.Add(BindData(camp_id, grid_id,
Convert.ToInt32(cbo.SelectedValue), "CAMP"));” did not return null I got
these values in the datasets rows

ds.Tables[0].Rows[0][0] "Campaign"
ds.Tables[0].Rows[1][0] "CHURN"

If it returned a null

ds.Tables[0].Rows[0][0] "Churn"
ds.Tables[0].Rows[1][0] error: object 'ds.Tables[0].Rows[1]' doesn't have
an indexer

So now I check

if (ds.Tables[0].Rows[0][0].ToString().Equals("Campaign"))
intRowId = 1;
else
intRowId = 0;

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[intRowId][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
……..

I am surprised that the C# translation does not behave in the same manner as
the VB.Net version. Can someone please explain why that is? Or did I
mistranslate?

I hope I did not confuse you guys to much….

Thanks a lot

Chris
Nov 17 '05 #1
4 1092
I'm not sure if this is the problem, but I would use
"System.Convert.IsDBNull" as the replacement for the VB IsDBNull function.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter

"chris" wrote:
I had the following VB.Net code

ds.Tables.Add(BindData(camp_id, grid_id, cbo.SelectedValue, "CAMP"))
tbl = BindData(camp_id, grid_id, cbo.SelectedValue, "CHURN")

ds.Tables(0).ImportRow(tbl.Rows(0))

For i = 1 To ds.Tables(0).Columns.Count - 1
If IsDBNull(tbl.Rows(0).Item(i)) Or campCustomers = 0 Then
dr(i) = 0
dr1(i) = 0
Else
dr(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 100,
"0.00")
dr1(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 12 *
100, "0.00")
End If
next
Which I translated into C# like this

ds.Tables.Add(BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue),
"CAMP"));
tbl = BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue), "CHURN");

ds.Tables[0].ImportRow(tbl.Rows[0]);

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[0][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
}
else
{
dr[i] = (Convert.ToDouble (tbl.Rows[0][i]) / campCustomers *
100).ToString("#0.00");
dr1[i] = (Convert.ToDouble(tbl.Rows[0][i]) / campCustomers * 12 *
100).ToString("#0.00");
}
}

The interesting part is that under some in C# “ds.Tables[0].Rows[0][i]” does
not contain the data but I could get the date to define
“ds.Tables[0].Rows[1][i]”

And under some circumstances “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns a null value. Hence I have to access the
data with “ds.Tables[0].Rows[0][i]”

In VB.Net that does not cause any problems it seems it always accesses the
“right” row even if “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns null.

I found a (dodgy) workaround in C# to test what value is in the row and then
define which rownumber to use.

If “ds.Tables.Add(BindData(camp_id, grid_id,
Convert.ToInt32(cbo.SelectedValue), "CAMP"));” did not return null I got
these values in the datasets rows

ds.Tables[0].Rows[0][0] "Campaign"
ds.Tables[0].Rows[1][0] "CHURN"

If it returned a null

ds.Tables[0].Rows[0][0] "Churn"
ds.Tables[0].Rows[1][0] error: object 'ds.Tables[0].Rows[1]' doesn't have
an indexer

So now I check

if (ds.Tables[0].Rows[0][0].ToString().Equals("Campaign"))
intRowId = 1;
else
intRowId = 0;

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[intRowId][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
……..

I am surprised that the C# translation does not behave in the same manner as
the VB.Net version. Can someone please explain why that is? Or did I
mistranslate?

I hope I did not confuse you guys to much….

Thanks a lot

Chris

Nov 17 '05 #2
I am also not sure but i hope the modification suggested by David will solve
the problem. As then the code will be similar to what you have implemented
under VB.NET

Just to point out: the IsDDNull checks for System.TypeCode.DBNull whereas
Sytem.DBNull.Value is an object of class System.DBNull

I dont know the exact difference between these two but i guess this
difference is causing the difference in behavior.

--
Cheers,
Rahul Anand

"David Anton" wrote:
I'm not sure if this is the problem, but I would use
"System.Convert.IsDBNull" as the replacement for the VB IsDBNull function.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter

"chris" wrote:
I had the following VB.Net code

ds.Tables.Add(BindData(camp_id, grid_id, cbo.SelectedValue, "CAMP"))
tbl = BindData(camp_id, grid_id, cbo.SelectedValue, "CHURN")

ds.Tables(0).ImportRow(tbl.Rows(0))

For i = 1 To ds.Tables(0).Columns.Count - 1
If IsDBNull(tbl.Rows(0).Item(i)) Or campCustomers = 0 Then
dr(i) = 0
dr1(i) = 0
Else
dr(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 100,
"0.00")
dr1(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 12 *
100, "0.00")
End If
next
Which I translated into C# like this

ds.Tables.Add(BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue),
"CAMP"));
tbl = BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue), "CHURN");

ds.Tables[0].ImportRow(tbl.Rows[0]);

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[0][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
}
else
{
dr[i] = (Convert.ToDouble (tbl.Rows[0][i]) / campCustomers *
100).ToString("#0.00");
dr1[i] = (Convert.ToDouble(tbl.Rows[0][i]) / campCustomers * 12 *
100).ToString("#0.00");
}
}

The interesting part is that under some in C# “ds.Tables[0].Rows[0][i]” does
not contain the data but I could get the date to define
“ds.Tables[0].Rows[1][i]”

And under some circumstances “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns a null value. Hence I have to access the
data with “ds.Tables[0].Rows[0][i]”

In VB.Net that does not cause any problems it seems it always accesses the
“right” row even if “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns null.

I found a (dodgy) workaround in C# to test what value is in the row and then
define which rownumber to use.

If “ds.Tables.Add(BindData(camp_id, grid_id,
Convert.ToInt32(cbo.SelectedValue), "CAMP"));” did not return null I got
these values in the datasets rows

ds.Tables[0].Rows[0][0] "Campaign"
ds.Tables[0].Rows[1][0] "CHURN"

If it returned a null

ds.Tables[0].Rows[0][0] "Churn"
ds.Tables[0].Rows[1][0] error: object 'ds.Tables[0].Rows[1]' doesn't have
an indexer

So now I check

if (ds.Tables[0].Rows[0][0].ToString().Equals("Campaign"))
intRowId = 1;
else
intRowId = 0;

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[intRowId][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
……..

I am surprised that the C# translation does not behave in the same manner as
the VB.Net version. Can someone please explain why that is? Or did I
mistranslate?

I hope I did not confuse you guys to much….

Thanks a lot

Chris

Nov 17 '05 #3
I converted to c# from VB.Net. But you guys are right. I changed it to
System.Convert.IsDBNull in the VB code and behaves in the same manner as the
c# version. Can you say "IsDBNull" in C# as well. Maybe not since C# would
not allow ambiguous coding.

Thanks Chris

"Rahul Anand" wrote:
I am also not sure but i hope the modification suggested by David will solve
the problem. As then the code will be similar to what you have implemented
under VB.NET

Just to point out: the IsDDNull checks for System.TypeCode.DBNull whereas
Sytem.DBNull.Value is an object of class System.DBNull

I dont know the exact difference between these two but i guess this
difference is causing the difference in behavior.

--
Cheers,
Rahul Anand

"David Anton" wrote:
I'm not sure if this is the problem, but I would use
"System.Convert.IsDBNull" as the replacement for the VB IsDBNull function.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter

"chris" wrote:
I had the following VB.Net code

ds.Tables.Add(BindData(camp_id, grid_id, cbo.SelectedValue, "CAMP"))
tbl = BindData(camp_id, grid_id, cbo.SelectedValue, "CHURN")

ds.Tables(0).ImportRow(tbl.Rows(0))

For i = 1 To ds.Tables(0).Columns.Count - 1
If IsDBNull(tbl.Rows(0).Item(i)) Or campCustomers = 0 Then
dr(i) = 0
dr1(i) = 0
Else
dr(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 100,
"0.00")
dr1(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 12 *
100, "0.00")
End If
next
Which I translated into C# like this

ds.Tables.Add(BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue),
"CAMP"));
tbl = BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue), "CHURN");

ds.Tables[0].ImportRow(tbl.Rows[0]);

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[0][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
}
else
{
dr[i] = (Convert.ToDouble (tbl.Rows[0][i]) / campCustomers *
100).ToString("#0.00");
dr1[i] = (Convert.ToDouble(tbl.Rows[0][i]) / campCustomers * 12 *
100).ToString("#0.00");
}
}

The interesting part is that under some in C# “ds.Tables[0].Rows[0][i]” does
not contain the data but I could get the date to define
“ds.Tables[0].Rows[1][i]”

And under some circumstances “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns a null value. Hence I have to access the
data with “ds.Tables[0].Rows[0][i]”

In VB.Net that does not cause any problems it seems it always accesses the
“right” row even if “ds.Tables.Add(BindData(camp_id, grid_id,
cbo.SelectedValue, "CAMP"))” returns null.

I found a (dodgy) workaround in C# to test what value is in the row and then
define which rownumber to use.

If “ds.Tables.Add(BindData(camp_id, grid_id,
Convert.ToInt32(cbo.SelectedValue), "CAMP"));” did not return null I got
these values in the datasets rows

ds.Tables[0].Rows[0][0] "Campaign"
ds.Tables[0].Rows[1][0] "CHURN"

If it returned a null

ds.Tables[0].Rows[0][0] "Churn"
ds.Tables[0].Rows[1][0] error: object 'ds.Tables[0].Rows[1]' doesn't have
an indexer

So now I check

if (ds.Tables[0].Rows[0][0].ToString().Equals("Campaign"))
intRowId = 1;
else
intRowId = 0;

for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
{
if (ds.Tables[0].Rows[intRowId][i] == DBNull.Value || campCustomers == 0)
{
dr[i] = 0;
dr1[i] = 0;
……..

I am surprised that the C# translation does not behave in the same manner as
the VB.Net version. Can someone please explain why that is? Or did I
mistranslate?

I hope I did not confuse you guys to much….

Thanks a lot

Chris

Nov 17 '05 #4
If you have a "using System;" statement at the top of your file, then you can
use "Convert.IsDBNull", but you could never use "IsDBNull" alone. In C# you
always need to include the class qualifier for a static method. VB would
allow omitting the class qualifier since it allows "Import System.Convert" -
i.e., 'importing' a class.

--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter

"chris" wrote:
I converted to c# from VB.Net. But you guys are right. I changed it to
System.Convert.IsDBNull in the VB code and behaves in the same manner as the
c# version. Can you say "IsDBNull" in C# as well. Maybe not since C# would
not allow ambiguous coding.

Thanks Chris

"Rahul Anand" wrote:
I am also not sure but i hope the modification suggested by David will solve
the problem. As then the code will be similar to what you have implemented
under VB.NET

Just to point out: the IsDDNull checks for System.TypeCode.DBNull whereas
Sytem.DBNull.Value is an object of class System.DBNull

I dont know the exact difference between these two but i guess this
difference is causing the difference in behavior.

--
Cheers,
Rahul Anand

"David Anton" wrote:
I'm not sure if this is the problem, but I would use
"System.Convert.IsDBNull" as the replacement for the VB IsDBNull function.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter

"chris" wrote:

> I had the following VB.Net code
>
> ds.Tables.Add(BindData(camp_id, grid_id, cbo.SelectedValue, "CAMP"))
> tbl = BindData(camp_id, grid_id, cbo.SelectedValue, "CHURN")
>
> ds.Tables(0).ImportRow(tbl.Rows(0))
>
> For i = 1 To ds.Tables(0).Columns.Count - 1
> If IsDBNull(tbl.Rows(0).Item(i)) Or campCustomers = 0 Then
> dr(i) = 0
> dr1(i) = 0
> Else
> dr(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 100,
> "0.00")
> dr1(i) = Format(tbl.Rows(0).Item(i) / CInt(campCustomers) * 12 *
> 100, "0.00")
> End If
> next
>
>
> Which I translated into C# like this
>
> ds.Tables.Add(BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue),
> "CAMP"));
> tbl = BindData(camp_id, grid_id, Convert.ToInt32(cbo.SelectedValue), "CHURN");
>
> ds.Tables[0].ImportRow(tbl.Rows[0]);
>
> for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
> {
> if (ds.Tables[0].Rows[0][i] == DBNull.Value || campCustomers == 0)
> {
> dr[i] = 0;
> dr1[i] = 0;
> }
> else
> {
> dr[i] = (Convert.ToDouble (tbl.Rows[0][i]) / campCustomers *
> 100).ToString("#0.00");
> dr1[i] = (Convert.ToDouble(tbl.Rows[0][i]) / campCustomers * 12 *
> 100).ToString("#0.00");
> }
> }
>
> The interesting part is that under some in C# “ds.Tables[0].Rows[0][i]” does
> not contain the data but I could get the date to define
> “ds.Tables[0].Rows[1][i]”
>
> And under some circumstances “ds.Tables.Add(BindData(camp_id, grid_id,
> cbo.SelectedValue, "CAMP"))” returns a null value. Hence I have to access the
> data with “ds.Tables[0].Rows[0][i]”
>
> In VB.Net that does not cause any problems it seems it always accesses the
> “right” row even if “ds.Tables.Add(BindData(camp_id, grid_id,
> cbo.SelectedValue, "CAMP"))” returns null.
>
> I found a (dodgy) workaround in C# to test what value is in the row and then
> define which rownumber to use.
>
> If “ds.Tables.Add(BindData(camp_id, grid_id,
> Convert.ToInt32(cbo.SelectedValue), "CAMP"));” did not return null I got
> these values in the datasets rows
>
> ds.Tables[0].Rows[0][0] "Campaign"
> ds.Tables[0].Rows[1][0] "CHURN"
>
> If it returned a null
>
> ds.Tables[0].Rows[0][0] "Churn"
> ds.Tables[0].Rows[1][0] error: object 'ds.Tables[0].Rows[1]' doesn't have
> an indexer
>
> So now I check
>
> if (ds.Tables[0].Rows[0][0].ToString().Equals("Campaign"))
> intRowId = 1;
> else
> intRowId = 0;
>
> for (int i = 1; i <= ds.Tables[0].Columns.Count - 1; i++)
> {
> if (ds.Tables[0].Rows[intRowId][i] == DBNull.Value || campCustomers == 0)
> {
> dr[i] = 0;
> dr1[i] = 0;
> ……..
>
> I am surprised that the C# translation does not behave in the same manner as
> the VB.Net version. Can someone please explain why that is? Or did I
> mistranslate?
>
> I hope I did not confuse you guys to much….
>
> Thanks a lot
>
> Chris

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases...
4
by: Eric | last post by:
I found the following phenomenon in VC++ 2005: struct A {}; struct B : public A { virtual ~B() {} }; A* p = new B;
7
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
16
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. ...
31
by: Bjrn Augestad | last post by:
Below is a program which converts a double to an integer in two different ways, giving me two different values for the int. The basic expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
3
by: Steve Richter | last post by:
here is a warning I am getting in a C++ .NET compile: c:\SrNet\jury\JuryTest.cpp(55) : warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied while...
11
by: tthunder | last post by:
Hi @all, My small example does not compile... I know, that this (as always) has reasons, but I want to know WHY? BTW: I only get errors with g++ (4.x), BCB (6.0),... VS C++ (2005) works...
0
by: Lou Evart | last post by:
DOCUMENT CONVERSION SERVICES Softline International (SII) operates one of the industry's largest document and data conversion service bureaus. In the past year, SII converted over a million...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.