Search VB 2010

Showing posts with label Visual Basic 2010. Show all posts
Showing posts with label Visual Basic 2010. Show all posts

Thursday, July 11, 2019

VS2010 Crystal Reports dll older version vs newer version

VS2010 Crystal Reports dll older version vs newer version

The problem 

- I have Visual Studio 2010 SP1 installed on Windows 10 32 bit, I had CR4VS 13.0.2 working perfectly on both developer machine and client machine with no problems.
- I downloaded CR4VS sp16 (exe)
- I uninstalled CR4VS 13.0.2 completely
- I installed CR4VS sp16 (exe) successfully
- Now, each time I open my Visual Basic 2010 Project I notice that the old CrystalDecision dll still has the same version 13.0.2000.0, although in my C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet .... I have the new version of dll.
Crystal Reports installed in VS 2015 in Win10 32 bit

Crystal Reports 13 sp16 is installed in VS 2010 in Win10 32 bit

CrystalDescision with old version 13.0.2 is still in VS 2010 though

CrystalDecision with new version 13.0.16 is in place correctly
After searching and searching and searching for a solution and also many un-installations and installations trials, I've found the following :

Solution :

Visual Studio 2010 loads its assemblies dll from
not from

so I deleted the windows.old folder
"Please, carefully search for a safe method to do so", I've done the following :

Exit Visual Studio 2010 for now.

Now, If you think you might want to downgrade from Windows 10 back to the previous version, don't delete that folder. Solve your win10 problems first.
Windows 10 will automatically delete the Windows.old folder one month after you performed your upgrade. But we are in a hurry. Here's the proper way to delete the Windows.old folder:

1: Click in Windows' search field, type Cleanup, then click Disk Cleanup.
2: Click the "Clean up system files" button.
3: Wait a bit while Windows scans for files, then scroll down the list until you see "Previous Windows installation(s)."
4: Check the box next to the entry, then make sure there are no other boxes checked (unless you do indeed want to delete those items). Click OK to start the cleanup.
5: Restart

---------- Finally, I realized that :

1) There is a difference between File version and assembly version in CrystalDescision.
2) File version varies (i.e CR4VS 13.0.16 means Developer Version 13 SP16 - File version 13.0.16, but the assembly version will always be
3) Developing and application for x86 CPU needs CR4VS (32 bit) even if you are developing on Win-xx 64 bit and vise versa. (Crystal Reports targets the CPU Arch. target not the OS build)
4) Having your Visual Studio -xx developed with Crystal Reports i.e 13.0.16, you will need Crystal Reports Redist. 13.0.16 for your client machine as well.
5) If you have more than one Visual Studio version installed side-by-side you can work with one compatible Crystal Reports installation (I.e : Visual Studio 2010 side-by-side Visual Studio 2015, you can install CR4VS 13.0.16 for both)
Update : 

According to GAC

Crystal Reports Assembly location : 

Starting with the .NET Framework 4, the default location for the global assembly cache is %windir%\Microsoft.NET\assembly (C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL). In earlier versions of the .NET Framework, the default location is %windir%\assembly. But you won't find any assemblies there because :


you need the .NET Framework 3.5. Some of the code in the SDK itself requires that version of the framework even though you can compile your application to use newer frameworks.

Crystal Reports Error 1606 "Could not access network location v4.0.30319\ASP.netClientfiles\"
- I reinstalled it using the original (exe) file, not from Add\Remove control panel.

All problems solved by reinstalling CR4VS 13.0.16 using (Exe) after removing CR4VS 13.0.2.

.Net Framework 4.5.2

All .Net frame work 4.0 and up to 4.8 , uses this app.config lines (i.e: I'm creating project using .net framework 4.5.2), so my App.Config file looks something like this :

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />

Wednesday, August 03, 2016

.Net framework 4.5.2 for Visual Studio 2010

.Net framework 4.5.2 for Visual Studio 2010
Visual Basic 2010 Advanced Compiler
Visual Basic 2010 Advanced Compiler
If you have installed Visual Studio 2010 on Windows 7, 8, 10 recently, you will notice that you have all .Net Framework versions available, and you will notice also that you Windows updates .net framework versions to a higher versions (i.e. If you have .net framework 4, windows will update this to 4.5) but you won't find .net framework v4.5 in your Visual Studio 2010, why ?!

Because targeting .net framework 4.5 via Visual Studio 2010 Each version of VS prior to Visual Studio 2010 is tied to a certain .NET framework. (VS2008 is .NET 3.5, VS2005 is .NET 2.0, VS2003 is .NET1.1) VS2010 and beyond allow for targeting of prior framework versions but cannot be used for future releases. You must use Visual Studio 2012 in order to utilize .NET 4.5.

Sunday, May 01, 2016

VB 2010 with MS Access 2010 Error Conversion from type 'DBNull' to type 'String' is not valid.

Conversion from type 'DBNull' to type 'String' is not valid.
Error :
Conversion from type 'DBNull' to type 'String' is not valid.
Cause :
Trying to Fetch Data From empty database table field
Solution :

Here are some online Visual Basic lessons and courses :

Sunday, December 15, 2013

Visual Basic Compare Two Treeviews and return differences

Visual Basic 2010 - Compare Two Strings and return differences and matches

vb2010 compare strings and return differences
VB2010 Compare Strings in Collections

Collections as an Alternative to Arrays

Visual Studio 2010
Although collections are most often used for working with the Object Data Type, you can use a collection to work with any data type. In some circumstances, it can be more efficient to store items in a collection than in an array.

If you need to change the size of an array, you must use the ReDim Statement (Visual Basic). When you do this, Visual Basic creates a new array and releases the previous array for disposal. This takes execution time. Therefore, if the number of items you are working with changes frequently, or you cannot predict the maximum number of items you need, you might obtain better performance using a collection.

A collection, which does not have to create a new object or copy existing elements, can handle resizing in less execution time than an array, which has to use ReDim. But if the size does not change, or changes only rarely, an array is likely to be more efficient. As always, performance is highly dependent on the individual application. It is often worth your time to try both an array and a collection.

This Example

How to compare two Treeviews in VB2010
How to return the differences between two Treeviews


- Create Visual Basic 2010 Windows Application Project
- On Form1, place two tree views and two textboxes and one button

Visual Basic Online Course
Visual Basic 2010 Compare Strings from Treeview
How does it work ?
- Store the Treeview1 [TRV1] nodes into Textbox, and the same with Treeview2 [TRV2]
- How many strings [Lines] in each Textbox

  • We want to find where both Textboxes is different and where both Textboxes is match to one another. For example, differences are :
- TRV1 has an extra string [Southern American]
- TRV2 node string [Africa] is different from TRV2 node string [African]

Steps to accomplish this task :

Download example from Mediafire
Extended work :
You can easily extract any Database tables, columns Schema into a treeview control, and you can also using this example compare two tables or two columns in a Database using this example as well.

You can use ListViews or ComboBoxes or ListBoxes instead of the Treeview control, I used the treeview control because it's always tricky to work with. Using other controls that store strings in Collection format would be so easy, even much easier than using Treeviews.

Another Treeview Examples

Expand and Collapse two treeviews at the same time according to one another even if they both don't have the same nodes names. Expand TreeView1[TRV1] node when TreeView2 [TRV2] node is expanded or collapsed.

TreeView Example : Change the node font

TreeView Example : Add a photo (icon) to the TreeView
1) Add ImageList from the ToolBox
2) Add 2 photos to the ImageList1 [From properties, Collection], for example :
- Photo1.Png (Index by default is Zero 0), this will be the Parent icon
- Photo2.Png (Index by default is One 1), this will be the first child icon
3) Code to display image/Icon in the Tree View :

Here are some online Visual Basic lessons and courses :

Friday, December 09, 2011

Solution - There is already an open DataReader associated with this Command which must be closed first.

VB 2010

Problem : There is already an open DataReader associated with this Command which must be closed first.
Cause : Having more than 1 dataReader result set working at the same time .
Solution : In my solution example, i work with SqlServer2000 and VB.Net 2005 
The Example Project can be downloaded at the end of this post :
It contains (SqlServer2000 DataBase - VB.Net Project)
The example shows how to navigate (First Record - Next Record) using ADO.Net 2.0 Online-Mode using SqlClient DataReader ...
Sql Database Name : Market
Sql Database Table : Market.Info
Server Name : evry1falls
(in order to see the example correctly, you'll have to Import the Database 'Market' into your sqlserver2000 Enterprise Manager)
Photo1 : Application Final Design
Photo 1

Photo2 : Table Structure
Photo 2

Photo3 : Codes
Photo 3

Photo4 : Codes
Photo 4

Photo5 : Codes
Photo 5

Now if you run the project and tried to navigate using (First) or (Next) you will get the Exception :
There is already an open DataReader .....
so the solution would be :
Trap the Exception that shows in the (SelectedIndexChanged) Event of the (ComboBox) like this :

and the same for the (Next) Button ..
now you can Navigate and search using combobox safely without exceptions ..

Note :
- Source code will give you exception and you will have to re-write the solution by yourself  as shown above .
- The Folder(Bin/Debug) Includes (Back-Up) use it to restore the (Market Database) in your sqlserver2000
- use the namespace (evry1falls) as new server Registration .

Download Source Code : MediaFire Link

Using MS Access 2003/2007/2010

- In case of using Microsoft Access Database, OleDb.OleDbDataReader with OleDb.OleDbCommand.

The work around or the solution would be :
Always create a new Instance of the OleDbCommand, I.e

Visual Basic Courses - Share