Click to See Complete Forum and Search --> : Beginner question


LVJ
June 22nd, 2009, 11:23 AM
Greetings & Salutations,

Hello. I am a quality assurance analyist who also does automation and performance testing using HP testing tools. While I would never consider myself to be a developer there are times where I'm creating an automated script that I have to do some basic programming. So, I really only have basic skills when it comes to programming.

I have encountered an issue in my code that really doesn't make sense to me. The code was generated in a program I use called VuGen which is part of the HP Loadrunner suite of tools. The script was generated in vb.net and it will not compile. I am receiving the following error:

'System.Data.SqlServerCe.SqlCeChangeTracking' is not accessible in this context because it is 'Private'.

Now, in my globals.vb it looks like the following:

Option Strict Off
Option Explicit On

Imports LoadRunner
Imports Mercury.LoadRunner.DotNetProtocol.Replay
Imports Microsoft.Synchronization.Data
Imports SyncUtility.WindowsSyncServiceReference
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlServerCe
Imports System.Globalization

Namespace Script

'Partial Public Class VuserClass

Private SqlCeChangeTracking_1 As System.Data.SqlServerCe.SqlCeChangeTracking

Please keep in mind this is not the entire code but I figured I'd condense it because the generated code in globals.vb is over 18,000 lines long. Now, based on the error message I figured I would change the Private to Public and voila, the script should compile but it did not.

I also tried changing "Partial Public Class VuserClass" to "Public Class VuserClass" but that did not correct the problem. Can anyone give me an idea as to what I need to do here or what I am doing wrong? A point in the right direction would be so helpful. Thank you in advance.

Shuja Ali
June 22nd, 2009, 03:09 PM
Welcome to the Forum.

I am guessing that you might have another variable with the same name. Also when your compiler throws an error, it must be telling you which line is causing the compile to error out. You can show us that exact line.

LVJ
June 22nd, 2009, 03:37 PM
Welcome to the Forum.

I am guessing that you might have another variable with the same name. Also when your compiler throws an error, it must be telling you which line is causing the compile to error out. You can show us that exact line.

Thank you very much for your reply.

I have other variables in my script that were generated with similar names but they are not the same as far as I can tell. I did a search in the globals.vb section of my code and there are no repeating variables that share the same name. For example, I am receiving the same error message for several similar variables:


Private SqlCeChangeTracking_41 As System.Data.SqlServerCe.SqlCeChangeTracking
Private SqlCeChangeTracking_42 As System.Data.SqlServerCe.SqlCeChangeTracking
Private SqlCeChangeTracking_43 As System.Data.SqlServerCe.SqlCeChangeTracking


The exact line my code is having an error starts at line 6764 in my code.


Private SqlCeChangeTracking_41 As System.Data.SqlServerCe.SqlCeChangeTracking


This compile error keeps repeating for as many SqlCeChangeTracking_## variables that I have in the globals.vb section. Now, in the Action section of my code SqlCeChangeTracking_41 is used in the following manner:

[code]
SqlCeTransaction_42 = SqlCeConnection_1.BeginTransaction(System.Data.IsolationLevel.ReadCommitted)

SqlCeChangeTracking_41 = New System.Data.SqlServerCe.SqlCeChangeTracking(SqlCeTransaction_42)
[/quote]

I'm not sure if this helps. As I mentioned in my previous post I'm reluctant to post 32,000+ lines of code. Any insight will be greatly appreciated. For the time being I'm going to search on .net beginner tutorials on the web so I can have a better understanding of .net in general.

Shuja Ali
June 22nd, 2009, 05:14 PM
You are using the same name for your variable as the class name. Can you change the variable names to something different and then try compiling.

LVJ
June 23rd, 2009, 09:18 AM
You are using the same name for your variable as the class name. Can you change the variable names to something different and then try compiling.

Thank you for your reply but unfortunately that did not work.

Shuja Ali
June 23rd, 2009, 02:16 PM
I am afraid that you will have to attach your project here and let others take a look at it. You can zip your project(minus the executable) and attach to your post.

dglienna
June 23rd, 2009, 10:00 PM
Create a small test to see if the problem is with VB.Net or your AppGen program.

If you get a Private error, it is probably being used in a class that isn't referenced properly.

btw - are you using Sql CE Express? That looks like the wrong namespace for SQLEXPRESS or SQLSERVER