Missing References Devexpress VB.net - vb.net

I really need help. I remember removing a reference, completely unrelated to DevExpress, from my project a few days ago and I think it's completely broke my project. I have 92~ errors relating to devexpress items. I can't definatively say what caused this mess, but my entire project has broken. Here's a snap shot below.
But I appear to have all the references I need:
Everything relating to DevExpress is highlighted as errors.
I've tried re-installing DevExpress and Visual Studio, I can create a new project and work with DevExpress without any issues, so I feel like I'm missing something in my current project.
The designer code:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class EngineerCallOut
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(EngineerCallOut))
Me.Label1 = New System.Windows.Forms.Label()
Me.lblStoreType = New System.Windows.Forms.Label()
Me.comboStoreType = New DevExpress.XtraEditors.ComboBoxEdit()
Me.lblPriority = New System.Windows.Forms.Label()
Me.comboPriority = New DevExpress.XtraEditors.ComboBoxEdit()
Me.PopupMenu1 = New DevExpress.XtraBars.PopupMenu(Me.components)
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
Me.lblStatus = New System.Windows.Forms.ToolStripStatusLabel()
Me.lblInitials = New System.Windows.Forms.Label()
Me.lblIncident = New System.Windows.Forms.Label()
Me.lblEquipment = New System.Windows.Forms.Label()
Me.lblDescription = New System.Windows.Forms.Label()
Me.lblDisclaimer = New System.Windows.Forms.Label()
Me.txtEquip = New System.Windows.Forms.TextBox()
Me.txtRef = New System.Windows.Forms.TextBox()
Me.txtInitials = New System.Windows.Forms.TextBox()
Me.txtDisclaimer = New System.Windows.Forms.TextBox()
Me.LogTime = New DevExpress.XtraEditors.DateEdit()
Me.lblLogDate = New System.Windows.Forms.Label()
Me.lblStore = New System.Windows.Forms.Label()
Me.lblOpenHours = New System.Windows.Forms.Label()
Me.Label13 = New System.Windows.Forms.Label()
Me.txtOpeningHours = New System.Windows.Forms.TextBox()
Me.txtStore = New System.Windows.Forms.TextBox()
Me.txtDesc = New System.Windows.Forms.TextBox()
Me.btnSettings = New DevExpress.XtraEditors.PictureEdit()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.btnClear = New DevExpress.XtraEditors.PictureEdit()
Me.btnPreview = New DevExpress.XtraEditors.PictureEdit()
Me.btnExport = New DevExpress.XtraEditors.PictureEdit()
Me.lblHardwareETA = New System.Windows.Forms.Label()
Me.lblSoftware = New System.Windows.Forms.Label()
Me.Label16 = New System.Windows.Forms.Label()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.btnPreviewRetry = New DevExpress.XtraEditors.PictureEdit()
Me.btnPreviewConfirm = New DevExpress.XtraEditors.PictureEdit()
Me.txtPreview = New System.Windows.Forms.TextBox()
Me.comboTemplateType = New DevExpress.XtraEditors.ComboBoxEdit()
Me.Label3 = New System.Windows.Forms.Label()
CType(Me.comboStoreType.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.comboPriority.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PopupMenu1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.StatusStrip1.SuspendLayout()
CType(Me.LogTime.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LogTime.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.btnSettings.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.btnClear.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.btnPreview.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.btnExport.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.Panel2.SuspendLayout()
CType(Me.btnPreviewRetry.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.btnPreviewConfirm.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.comboTemplateType.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.BackColor = System.Drawing.Color.Transparent
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(111, 57)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(229, 20)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Engineer Call Out Template"
....

Delete the same name in reference and add it again.
If you do not have the DevExpress.dll, you can search by Google and added it to reference and to bin folder.
Check your framework if it except this reference.

Open the form where shows error.
Just peek devexpresstools form toolbox.like xtrabutton.
Then if you dont want this tool then you can delete it.

You have a simple way, just uninstall the DevExpress, remove the unregistered dll as suggested by follow.
Open PowerShell/CMD
and type in
ToolboxCreator.exe /INI:toolboxcreator.ini /LOG:CreatorLog.log /PATH "%PROGRAMFILES%/DevExpress 2010.2/Components/Sources/DevExpress.DLL/
and hit Enter.
If it does not work, then remove the registry suggested from
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Packages\{2c298b35-07da-45f1-96a3-be55d91c8d7a}\Toolbox

Related

How do i handle a multiple null image values from Microsoft SQL Server database with vb.net code

I was hoping someone could point me in the right direction with my current code. I'm getting an error while opening my program:
Data is Null. This method or property cannot be called on null values.
I put an else statement for btn.backgroundimage but still get that error.
Here is what my code looks like:
Sub FillItems()
Try
con = New SqlConnection(cs)
con.Open()
Dim PictureCol As Integer = 1 ' the column # of the BLOB field
Dim cmdText1 As String = "SELECT RTRIM(ProductName),Image from Temp_Stock_Company INNER JOIN Product ON Product.PID=Temp_Stock_Company.ProductID where ShowPOS='Yes'"
cmd = New SqlCommand(cmdText1)
cmd.Connection = con
cmd.CommandTimeout = 0
rdr = cmd.ExecuteReader()
flpItems.Controls.Clear()
Do While (rdr.Read())
'Dim btn As New Button
'btn.Text = rdr.GetValue(0)
'btn.TextAlign = ContentAlignment.MiddleCenter
'btn.BackColor = Color.SteelBlue
'btn.ForeColor = Color.White
'btn.FlatStyle = FlatStyle.Popup
'btn.Width = 125
'btn.Height = 60
'btn.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
'UserButtons.Add(btn)
'flpItems.Controls.Add(btn)
Dim b(rdr.GetBytes(PictureCol, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
rdr.GetBytes(PictureCol, 0, b, 0, b.Length)
Dim ms As New System.IO.MemoryStream(b)
Dim Dflp As New FlowLayoutPanel
Dflp.Size = New System.Drawing.Size(197, 197)
Dflp.BackColor = Color.Black
Dflp.BorderStyle = BorderStyle.None
Dflp.FlowDirection = FlowDirection.TopDown
Dim btn As New Button
Dim btnX As New Button
btn.Text = rdr.GetValue(0)
btn.Width = 197
btn.Height = 197
If DBNull.Value.Equals(rdr(1)) = False Then
btn.BackgroundImage = Image.FromStream(ms)
btn.BackgroundImageLayout = ImageLayout.Stretch
Else
btn.BackgroundImage = My.Resources._12
btn.BackgroundImageLayout = ImageLayout.Stretch
End If
btn.FlatStyle = FlatStyle.Flat
btn.FlatAppearance.BorderSize = 0
btn.Text = rdr.GetValue(0)
btn.Font = New System.Drawing.Font("Segoe UI Semibold", 1.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
btn.TextAlign = System.Drawing.ContentAlignment.BottomCenter
btn.ForeColor = System.Drawing.Color.Black
btnX.Text = rdr.GetValue(0)
btnX.FlatStyle = FlatStyle.Flat
btnX.Width = 0
btnX.Height = 0
btnX.FlatAppearance.BorderSize = 0
btnX.Text = rdr.GetValue(0)
btnX.Font = New System.Drawing.Font("Segoe UI Semibold", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
btnX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
btnX.ForeColor = Color.White
btnX.BackColor = Color.SteelBlue
UserButtons.Add(btn)
UserButtons.Add(btnX)
Dflp.Controls.Add(btn)
Dflp.Controls.Add(btnX)
flpItems.Controls.Add(Dflp)
AddHandler btn.Click, AddressOf Me.btnItems_Click
AddHandler btnX.Click, AddressOf Me.btnItems_Click
Loop
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
End Try
End Sub
You do not want to hold the connection open while you update the user interface so I have used a DataTable which will hold your data after the connection is closed and disposed. Using...End Using blocks will close and dispose your database objects. Any class in the framework that shows you a .Dispose method should be enclosed in Using blocks. This includes streams.
Load the DataTable. Check for DBNull and only then get your byte array.
I used AdventureWorks (a sample database available from Microsoft) to test.
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim dt As New DataTable
Using cn As New SqlConnection(My.Settings.Adventure),
cmd As New SqlCommand("Select Top 10 ProductPhotoID, ThumbNailPhoto From Production.ProductPhoto;", cn)
cn.Open()
Using reader = cmd.ExecuteReader
dt.Load(reader)
End Using
End Using
For Each row As DataRow In dt.Rows
Dim btn As New Button
If Not IsDBNull(row(1)) Then
Dim b() As Byte = DirectCast(row(1), Byte())
Using ms As New System.IO.MemoryStream(b)
btn.BackgroundImage = Image.FromStream(ms)
End Using
Else
btn.BackgroundImage = Image.FromFile("C:\Users\***\Desktop\Graphics\TreeFrog.jpg")
End If
btn.BackgroundImageLayout = ImageLayout.Stretch
btn.Width = 50
btn.Height = 50
FlowLayoutPanel1.Controls.Add(btn)
Next
End Sub

Type 'usercontrol' is not defined (Visual Studio 2015)

I have a custom winforms user control I added to a project in VS2015. When I drag the control to a form and compile, I get the error Type 'xxx' is not defined. I can fix if I remove the namespace from the control name, but any changes to the user control overwrites my changes.
Is there a way to prevent this from happening?
Here's the auto-generated control (called "ctrlTestStatus"):
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class ctrlTestStatus
Inherits System.Windows.Forms.UserControl
'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
Me.prgLocalDatabase = New System.Windows.Forms.ProgressBar()
Me.prgRemoteDatabase = New System.Windows.Forms.ProgressBar()
Me.lblLocalDatabaseStatus = New System.Windows.Forms.Label()
Me.lblRemoteDatabaseStatus = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.prgAmazon = New System.Windows.Forms.ProgressBar()
Me.Label6 = New System.Windows.Forms.Label()
Me.lblAmazonStatus = New System.Windows.Forms.Label()
Me.prgEbay = New System.Windows.Forms.ProgressBar()
Me.lblEbayStatus = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.lbStatus = New System.Windows.Forms.ListBox()
Me.TableLayoutPanel1.SuspendLayout()
Me.SuspendLayout()
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.BackColor = System.Drawing.SystemColors.Window
Me.TableLayoutPanel1.ColumnCount = 3
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.30766!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 58.95527!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 15.73707!))
Me.TableLayoutPanel1.Controls.Add(Me.prgLocalDatabase, 1, 0)
Me.TableLayoutPanel1.Controls.Add(Me.prgRemoteDatabase, 1, 1)
Me.TableLayoutPanel1.Controls.Add(Me.lblLocalDatabaseStatus, 2, 0)
Me.TableLayoutPanel1.Controls.Add(Me.lblRemoteDatabaseStatus, 2, 1)
Me.TableLayoutPanel1.Controls.Add(Me.Label4, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Label5, 0, 1)
Me.TableLayoutPanel1.Controls.Add(Me.prgAmazon, 1, 2)
Me.TableLayoutPanel1.Controls.Add(Me.Label6, 0, 2)
Me.TableLayoutPanel1.Controls.Add(Me.lblAmazonStatus, 2, 2)
Me.TableLayoutPanel1.Controls.Add(Me.prgEbay, 1, 3)
Me.TableLayoutPanel1.Controls.Add(Me.lblEbayStatus, 2, 3)
Me.TableLayoutPanel1.Controls.Add(Me.Label1, 0, 3)
Me.TableLayoutPanel1.Location = New System.Drawing.Point(8, 7)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 4
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TableLayoutPanel1.Size = New System.Drawing.Size(425, 107)
Me.TableLayoutPanel1.TabIndex = 8
'
'prgLocalDatabase
'
Me.prgLocalDatabase.Location = New System.Drawing.Point(110, 3)
Me.prgLocalDatabase.Name = "prgLocalDatabase"
Me.prgLocalDatabase.Size = New System.Drawing.Size(244, 20)
Me.prgLocalDatabase.TabIndex = 0
'
'prgRemoteDatabase
'
Me.prgRemoteDatabase.Location = New System.Drawing.Point(110, 29)
Me.prgRemoteDatabase.Name = "prgRemoteDatabase"
Me.prgRemoteDatabase.Size = New System.Drawing.Size(244, 20)
Me.prgRemoteDatabase.TabIndex = 1
'
'lblLocalDatabaseStatus
'
Me.lblLocalDatabaseStatus.Anchor = System.Windows.Forms.AnchorStyles.Left
Me.lblLocalDatabaseStatus.AutoSize = True
Me.lblLocalDatabaseStatus.Location = New System.Drawing.Point(360, 6)
Me.lblLocalDatabaseStatus.MinimumSize = New System.Drawing.Size(40, 13)
Me.lblLocalDatabaseStatus.Name = "lblLocalDatabaseStatus"
Me.lblLocalDatabaseStatus.Size = New System.Drawing.Size(40, 13)
Me.lblLocalDatabaseStatus.TabIndex = 3
'
'lblRemoteDatabaseStatus
'
Me.lblRemoteDatabaseStatus.Anchor = System.Windows.Forms.AnchorStyles.Left
Me.lblRemoteDatabaseStatus.AutoSize = True
Me.lblRemoteDatabaseStatus.Location = New System.Drawing.Point(360, 32)
Me.lblRemoteDatabaseStatus.MinimumSize = New System.Drawing.Size(40, 13)
Me.lblRemoteDatabaseStatus.Name = "lblRemoteDatabaseStatus"
Me.lblRemoteDatabaseStatus.Size = New System.Drawing.Size(40, 13)
Me.lblRemoteDatabaseStatus.TabIndex = 4
'
'Label4
'
Me.Label4.Anchor = System.Windows.Forms.AnchorStyles.Right
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(4, 6)
Me.Label4.MinimumSize = New System.Drawing.Size(100, 13)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(100, 13)
Me.Label4.TabIndex = 6
Me.Label4.Text = "Local Database:"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'Label5
'
Me.Label5.Anchor = System.Windows.Forms.AnchorStyles.Right
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(4, 32)
Me.Label5.MinimumSize = New System.Drawing.Size(100, 13)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(100, 13)
Me.Label5.TabIndex = 7
Me.Label5.Text = "Remote Database:"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'prgAmazon
'
Me.prgAmazon.Location = New System.Drawing.Point(110, 55)
Me.prgAmazon.Name = "prgAmazon"
Me.prgAmazon.Size = New System.Drawing.Size(244, 20)
Me.prgAmazon.TabIndex = 9
'
'Label6
'
Me.Label6.Anchor = System.Windows.Forms.AnchorStyles.Right
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(4, 58)
Me.Label6.MinimumSize = New System.Drawing.Size(100, 13)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(100, 13)
Me.Label6.TabIndex = 8
Me.Label6.Text = "Amazon:"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'lblAmazonStatus
'
Me.lblAmazonStatus.Anchor = System.Windows.Forms.AnchorStyles.Left
Me.lblAmazonStatus.AutoSize = True
Me.lblAmazonStatus.Location = New System.Drawing.Point(360, 58)
Me.lblAmazonStatus.MinimumSize = New System.Drawing.Size(40, 13)
Me.lblAmazonStatus.Name = "lblAmazonStatus"
Me.lblAmazonStatus.Size = New System.Drawing.Size(40, 13)
Me.lblAmazonStatus.TabIndex = 5
'
'prgEbay
'
Me.prgEbay.Location = New System.Drawing.Point(110, 81)
Me.prgEbay.Name = "prgEbay"
Me.prgEbay.Size = New System.Drawing.Size(244, 20)
Me.prgEbay.TabIndex = 11
'
'lblEbayStatus
'
Me.lblEbayStatus.Anchor = System.Windows.Forms.AnchorStyles.Left
Me.lblEbayStatus.AutoSize = True
Me.lblEbayStatus.Location = New System.Drawing.Point(360, 86)
Me.lblEbayStatus.MinimumSize = New System.Drawing.Size(40, 13)
Me.lblEbayStatus.Name = "lblEbayStatus"
Me.lblEbayStatus.Size = New System.Drawing.Size(40, 13)
Me.lblEbayStatus.TabIndex = 12
'
'Label1
'
Me.Label1.Anchor = System.Windows.Forms.AnchorStyles.Right
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(4, 86)
Me.Label1.MinimumSize = New System.Drawing.Size(100, 13)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(100, 13)
Me.Label1.TabIndex = 10
Me.Label1.Text = "Ebay:"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'lbStatus
'
Me.lbStatus.FormattingEnabled = True
Me.lbStatus.Location = New System.Drawing.Point(7, 120)
Me.lbStatus.Name = "lbStatus"
Me.lbStatus.Size = New System.Drawing.Size(425, 56)
Me.lbStatus.TabIndex = 9
'
'ctrlTestStatus
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.TableLayoutPanel1)
Me.Controls.Add(Me.lbStatus)
Me.Name = "ctrlTestStatus"
Me.Size = New System.Drawing.Size(440, 185)
Me.TableLayoutPanel1.ResumeLayout(False)
Me.TableLayoutPanel1.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents TableLayoutPanel1 As TableLayoutPanel
Friend WithEvents prgLocalDatabase As ProgressBar
Friend WithEvents prgRemoteDatabase As ProgressBar
Friend WithEvents lblLocalDatabaseStatus As Label
Friend WithEvents lblRemoteDatabaseStatus As Label
Friend WithEvents Label4 As Label
Friend WithEvents Label5 As Label
Friend WithEvents prgAmazon As ProgressBar
Friend WithEvents Label6 As Label
Friend WithEvents lblAmazonStatus As Label
Friend WithEvents prgEbay As ProgressBar
Friend WithEvents lblEbayStatus As Label
Friend WithEvents Label1 As Label
Friend WithEvents lbStatus As ListBox
End Class
and the designer code for the form I plop the control onto (before I put it in):
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmTestStart
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.SuspendLayout()
'
'frmTestStart
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(468, 206)
Me.Name = "frmTestStart"
Me.Text = "Test Connections"
Me.ResumeLayout(False)
End Sub
End Class
What the designer generated after I dragged the control and saved:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmTestStart
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.CtrlTestStatus1 = New QBI.ctrlTestStatus()
Me.SuspendLayout()
'
'CtrlTestStatus1
'
Me.CtrlTestStatus1.Location = New System.Drawing.Point(13, 13)
Me.CtrlTestStatus1.Name = "CtrlTestStatus1"
Me.CtrlTestStatus1.Size = New System.Drawing.Size(440, 185)
Me.CtrlTestStatus1.TabIndex = 0
'
'frmTestStart
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(468, 206)
Me.Controls.Add(Me.CtrlTestStatus1)
Me.Name = "frmTestStart"
Me.Text = "Test Connections"
Me.ResumeLayout(False)
End Sub
Friend WithEvents CtrlTestStatus1 As QBI.ctrlTestStatus
End Class
I get the squiggly lines under the QBI.ctrlTestStatus() and it generates the error if I try to compile. I thought it was a namespace bug in the designer, so I immediately wrapped the usercontrol to fix (no joy).The project namespace is QBI (it's not a reserved word as far as I can tell).
Namespace QBI
Public Class ctrlTestStatus
Private Sub ctrlTestStatus_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
End Namespace
Unfortunately, this created more problems and the properties and events for the CtrlTestStatus1 instance are not available (I get squiggly lines).
I found one problem from MS saying to set the compile to Any CPU (which the project build has always been set to this) due to a 64bit / 32bit issue (VS is STILL 32bit!), but no joy either.
Any ideas (settings, things I'm doing wrong) as to how to remedy this?
Old post, but for anyone else having this issue...
I had this happen in a Project where I'd defined a sub-namespace with the same name as my project (root namespace) (in the OP's case, "QBI"). This happens when you have code that looks like this somewhere in your project:
Namespace [Name of your Project/Root Namespace]
[...]
End Namespace
The result of this is that your project contains both a "QBI" namespace AND a "QBI.QBI" namespace (which you can see for yourself if you look at the Object Browser for your project). This situation causes a resolution conflict in the designer file whereby it looks under the wrong namespace for your custom control.
A few possible ways to fix this:
Where the sub-namespace is declared (as in the example code above), remove the namespace declaration altogether. This will move all the code within the declaration to your root "QBI" namespace. You can do this if having that code in a sub-namespace is unnecessary.
Where the sub-namespace is declared, right-click the Namespace name and rename it to something OTHER than your Root Namespace's name.
If you want to keep the sub-namespace named as such, you can instead rename your root namespace to something unique, from My Project --> Application --> Root namespace.
Option 1 is the simplest option and should immediately resolve the error.
Option 2 is the next simplest, but, for example, if your renamed the sub-namespace to "NewName", all references to "ctrlTestStatus" in your Designer files will be mistakenly renamed to "NewName.ctrlTestStatus", and you'll have to repair them to "QBI.ctrlTestStatus".
Option 3 is the most tedious, because you have to resolve all Designer file references to the Root namespace, using Find and Replace, being careful not to mistakenly replace legitimate references to the sub-QBI namespace.

.Net Windows Form Arabic Encoding issue at Runtime

I created a VB.net windows forms project under VS2008 and Windows Vista, now when I take to code to other PC having VS2015 and Windows 10 I faced an encoding problem, the Application has Arabic captions in it, Visual Studio is able to read those captions but when I click start (F5) to compile and run the app I see that all Arabic text are not encoded. knowing that when I took the compiled version of the app from old pc and run it in the new pc it behave as expected and all Arabic texts are displayed well, so the problem here is on compile time of VS2015 under Windows 10.
I searched around this issue but all advises was to try to open the files with code editor and use the compatible encoding, but actually I don't have problem reading the code content, the problem is when compiling the code it will not encode the Arabic text.
The following is the code of the frmWelcome.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmWelcome
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmWelcome))
Me.btnSalesCenter = New System.Windows.Forms.Button
Me.btnAdministrator = New System.Windows.Forms.Button
Me.btnPurchaseCenter = New System.Windows.Forms.Button
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.btnMinimize = New System.Windows.Forms.PictureBox
Me.Label5 = New System.Windows.Forms.Label
Me.btnClose = New System.Windows.Forms.PictureBox
Me.Label3 = New System.Windows.Forms.Label
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.btnMinimize, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.btnClose, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'btnSalesCenter
'
Me.btnSalesCenter.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnSalesCenter.Font = New System.Drawing.Font("Times New Roman", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSalesCenter.ForeColor = System.Drawing.Color.Navy
Me.btnSalesCenter.Location = New System.Drawing.Point(408, 276)
Me.btnSalesCenter.Name = "btnSalesCenter"
Me.btnSalesCenter.Size = New System.Drawing.Size(262, 70)
Me.btnSalesCenter.TabIndex = 1
Me.btnSalesCenter.TabStop = False
Me.btnSalesCenter.Text = "قسم المبيعات"
Me.btnSalesCenter.UseVisualStyleBackColor = True
'
'btnAdministrator
'
Me.btnAdministrator.BackColor = System.Drawing.Color.White
Me.btnAdministrator.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnAdministrator.Font = New System.Drawing.Font("Times New Roman", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAdministrator.ForeColor = System.Drawing.Color.Navy
Me.btnAdministrator.Location = New System.Drawing.Point(408, 200)
Me.btnAdministrator.Name = "btnAdministrator"
Me.btnAdministrator.Size = New System.Drawing.Size(262, 70)
Me.btnAdministrator.TabIndex = 0
Me.btnAdministrator.TabStop = False
Me.btnAdministrator.Text = "الادارة"
Me.btnAdministrator.UseVisualStyleBackColor = False
'
'btnPurchaseCenter
'
Me.btnPurchaseCenter.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnPurchaseCenter.Font = New System.Drawing.Font("Times New Roman", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnPurchaseCenter.ForeColor = System.Drawing.Color.Navy
Me.btnPurchaseCenter.Location = New System.Drawing.Point(408, 352)
Me.btnPurchaseCenter.Name = "btnPurchaseCenter"
Me.btnPurchaseCenter.Size = New System.Drawing.Size(262, 70)
Me.btnPurchaseCenter.TabIndex = 21
Me.btnPurchaseCenter.TabStop = False
Me.btnPurchaseCenter.Tag = ""
Me.btnPurchaseCenter.Text = "قسم المشتريات"
Me.btnPurchaseCenter.UseVisualStyleBackColor = True
'
'PictureBox1
'
Me.PictureBox1.Cursor = System.Windows.Forms.Cursors.Hand
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(78, 240)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(146, 138)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox1.TabIndex = 151
Me.PictureBox1.TabStop = False
'
'btnMinimize
'
Me.btnMinimize.BackColor = System.Drawing.Color.Navy
Me.btnMinimize.Cursor = System.Windows.Forms.Cursors.Hand
Me.btnMinimize.Image = CType(resources.GetObject("btnMinimize.Image"), System.Drawing.Image)
Me.btnMinimize.Location = New System.Drawing.Point(676, 5)
Me.btnMinimize.Name = "btnMinimize"
Me.btnMinimize.Size = New System.Drawing.Size(50, 50)
Me.btnMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
Me.btnMinimize.TabIndex = 231
Me.btnMinimize.TabStop = False
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.BackColor = System.Drawing.Color.Navy
Me.Label5.Font = New System.Drawing.Font("Times New Roman", 27.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.ForeColor = System.Drawing.Color.White
Me.Label5.Location = New System.Drawing.Point(464, 9)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(206, 42)
Me.Label5.TabIndex = 230
Me.Label5.Text = "القائمة الرئيسية"
'
'btnClose
'
Me.btnClose.BackColor = System.Drawing.Color.Navy
Me.btnClose.Cursor = System.Windows.Forms.Cursors.Hand
Me.btnClose.Image = CType(resources.GetObject("btnClose.Image"), System.Drawing.Image)
Me.btnClose.Location = New System.Drawing.Point(732, 5)
Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(50, 50)
Me.btnClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
Me.btnClose.TabIndex = 229
Me.btnClose.TabStop = False
'
'Label3
'
Me.Label3.BackColor = System.Drawing.Color.Navy
Me.Label3.Font = New System.Drawing.Font("Times New Roman", 27.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.ForeColor = System.Drawing.Color.Navy
Me.Label3.Location = New System.Drawing.Point(0, -3)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(800, 67)
Me.Label3.TabIndex = 228
'
'frmWelcome
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.White
Me.ClientSize = New System.Drawing.Size(794, 568)
Me.ControlBox = False
Me.Controls.Add(Me.btnMinimize)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.btnClose)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.btnPurchaseCenter)
Me.Controls.Add(Me.btnSalesCenter)
Me.Controls.Add(Me.btnAdministrator)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "frmWelcome"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "القائمة الرئيسية"
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.btnMinimize, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.btnClose, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btnAdministrator As System.Windows.Forms.Button
Friend WithEvents btnSalesCenter As System.Windows.Forms.Button
Friend WithEvents btnPurchaseCenter As System.Windows.Forms.Button
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents btnMinimize As System.Windows.Forms.PictureBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents btnClose As System.Windows.Forms.PictureBox
Friend WithEvents Label3 As System.Windows.Forms.Label
End Class
This is the expected screen:
And this is the screen I get after compile:
Please Advise.
change windows locale in adminstrative language settings to arabic
I managed to solve the problem, but it took with me a lot of time to finish it.
The solution is as the following:
Open each file containing arabic with Visual Basic Editor With Encoding and choose Arabic Windows Codepage 1256.
Click on save as and in the save screen choose the arrow on the save button to select save with encoding and select utc-8.
It will replace the old file with new one with good format, after I finished all files I build the solution and run it and everything worked as expected. (more then 70 files and for each of them one for design and other for code so basically 140 files)
I hope my experience with this problem can help someone who faced the same issue.

Ambiguous in the namespace

I've updated a project from VB6 to VB.NET. Everything seemed to work fine, but now I'm facing errors related to the namespace when trying to build. Besides, I'm getting them on Form's designers, which have been automatically generated by Visual Studio. More specifically, the errors I'm facing involve the System.Drawing namespace and its internal structures (Point, Size, SizeF, etc).
I've checked it and I haven't found any other class that could be causing the conflict. I've also tried to delete the reference to the library and add it again, and to Clean the project, but the error is still there.
It's seems a problem similar to the one asked in this question, but I've tried the solutions answered there and haven't worked either. Any ideas of what could I do? This is driving me crazy and my whole project is stopped until I can fix that.
Thank you very, very much in advance.
EDIT: Added screenshots of the error and the code that's throwing it
Complete message of one of the errors: Error 18 'Point' is ambiguous in the namespace 'System.Drawing'. C:\Users\practiquesINF\Desktop\Projecte01_VBNET_V2\Upgraded\Frm_Files.Designer.vb 152 39 P_IF01
Complete code of one of the files that throws the error (as I've said, it's the designer of one of the forms and it has been generated automatically):
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Frm_Files
#Region "Upgrade Support "
Private Shared m_vb6FormDefInstance As Frm_Files
Private Shared m_InitializingDefInstance As Boolean
Public Shared Property DefInstance() As Frm_Files
Get
If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
m_InitializingDefInstance = True
m_vb6FormDefInstance = CreateInstance()
m_InitializingDefInstance = False
End If
Return m_vb6FormDefInstance
End Get
Set(ByVal Value As Frm_Files)
m_vb6FormDefInstance = Value
End Set
End Property
#End Region
#Region "Windows Form Designer generated code "
Public Shared Function CreateInstance() As Frm_Files
Dim theInstance As Frm_Files = New Frm_Files()
theInstance.Form_Load()
Return theInstance
End Function
Private visualControls() As String = New String() {"components", "ToolTipMain", "_Text1_4", "DataCombo1", "_Text1_3", "_Text1_2", "_Command1_2", "_Command1_1", "_Text1_1", "_Text1_0", "_Command1_0", "CommonDialog1Open", "_Label1_6", "_Label1_5", "_Label1_4", "_Label1_3", "_Label1_2", "_Label1_1", "_Label1_0", "Command1", "Label1", "Text1"}
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
Public ToolTipMain As System.Windows.Forms.ToolTip
Private WithEvents _Text1_4 As System.Windows.Forms.TextBox
Public WithEvents DataCombo1 As AxMSDataListLib.AxDataCombo
Private WithEvents _Text1_3 As System.Windows.Forms.TextBox
Private WithEvents _Text1_2 As System.Windows.Forms.TextBox
Private WithEvents _Command1_2 As System.Windows.Forms.Button
Private WithEvents _Command1_1 As System.Windows.Forms.Button
Private WithEvents _Text1_1 As System.Windows.Forms.TextBox
Private WithEvents _Text1_0 As System.Windows.Forms.TextBox
Private WithEvents _Command1_0 As System.Windows.Forms.Button
Public WithEvents CommonDialog1Open As System.Windows.Forms.OpenFileDialog
Private WithEvents _Label1_6 As System.Windows.Forms.Label
Private WithEvents _Label1_5 As System.Windows.Forms.Label
Private WithEvents _Label1_4 As System.Windows.Forms.Label
Private WithEvents _Label1_3 As System.Windows.Forms.Label
Private WithEvents _Label1_2 As System.Windows.Forms.Label
Private WithEvents _Label1_1 As System.Windows.Forms.Label
Private WithEvents _Label1_0 As System.Windows.Forms.Label
Public Command1(2) As System.Windows.Forms.Button
Public Label1(6) As System.Windows.Forms.Label
Public Text1(4) As System.Windows.Forms.TextBox
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Frm_Files))
Me.ToolTipMain = New System.Windows.Forms.ToolTip(Me.components)
Me._Text1_4 = New System.Windows.Forms.TextBox()
Me.DataCombo1 = New AxMSDataListLib.AxDataCombo()
Me._Text1_3 = New System.Windows.Forms.TextBox()
Me._Text1_2 = New System.Windows.Forms.TextBox()
Me._Command1_2 = New System.Windows.Forms.Button()
Me._Command1_1 = New System.Windows.Forms.Button()
Me._Text1_1 = New System.Windows.Forms.TextBox()
Me._Text1_0 = New System.Windows.Forms.TextBox()
Me._Command1_0 = New System.Windows.Forms.Button()
Me.CommonDialog1Open = New System.Windows.Forms.OpenFileDialog()
Me._Label1_6 = New System.Windows.Forms.Label()
Me._Label1_5 = New System.Windows.Forms.Label()
Me._Label1_4 = New System.Windows.Forms.Label()
Me._Label1_3 = New System.Windows.Forms.Label()
Me._Label1_2 = New System.Windows.Forms.Label()
Me._Label1_1 = New System.Windows.Forms.Label()
Me._Label1_0 = New System.Windows.Forms.Label()
CType(Me.DataCombo1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'_Text1_4
'
Me._Text1_4.AcceptsReturn = True
Me._Text1_4.BackColor = System.Drawing.SystemColors.Window
Me._Text1_4.Cursor = System.Windows.Forms.Cursors.IBeam
Me._Text1_4.ForeColor = System.Drawing.SystemColors.WindowText
Me._Text1_4.Location = New System.Drawing.Point(160, 200)
Me._Text1_4.MaxLength = 1
Me._Text1_4.Name = "_Text1_4"
Me._Text1_4.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Text1_4.Size = System.Drawing.Size(19, 20)
Me._Text1_4.TabIndex = 14
Me._Text1_4.Text = "S"
Me._Text1_4.Visible = False
'
'DataCombo1
'
Me.DataCombo1.Location = New System.Drawing.Point(112, 240)
Me.DataCombo1.Name = "DataCombo1"
Me.DataCombo1.OcxState = CType(resources.GetObject("DataCombo1.OcxState"), System.Windows.Forms.AxHost.State)
' Me.DataCombo1.RowSource = Nothing HI HA QUE AFEGIR UN DATA SOURCE O SINO EL PROBLEMA NO GENERA EL FORMULARI
Me.DataCombo1.Size = New System.Drawing.Size(233, 21)
Me.DataCombo1.TabIndex = 13
'
'_Text1_3
'
Me._Text1_3.AcceptsReturn = True
Me._Text1_3.BackColor = System.Drawing.SystemColors.Window
Me._Text1_3.Cursor = System.Windows.Forms.Cursors.IBeam
Me._Text1_3.ForeColor = System.Drawing.SystemColors.WindowText
Me._Text1_3.Location = New System.Drawing.Point(270, 112)
Me._Text1_3.MaxLength = 0
Me._Text1_3.Name = "_Text1_3"
Me._Text1_3.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Text1_3.Size = New System.Drawing.Size(67, 20)
Me._Text1_3.TabIndex = 10
Me._Text1_3.Text = "19"
Me._Text1_3.Visible = False
'
'_Text1_2
'
Me._Text1_2.AcceptsReturn = True
Me._Text1_2.BackColor = System.Drawing.SystemColors.Window
Me._Text1_2.Cursor = System.Windows.Forms.Cursors.IBeam
Me._Text1_2.ForeColor = System.Drawing.SystemColors.WindowText
Me._Text1_2.Location = New System.Drawing.Point(113, 111)
Me._Text1_2.MaxLength = 0
Me._Text1_2.Name = "_Text1_2"
Me._Text1_2.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Text1_2.Size = New System.Drawing.Size(43, 20)
Me._Text1_2.TabIndex = 8
Me._Text1_2.Text = "32"
Me._Text1_2.Visible = False
'
'_Command1_2
'
Me._Command1_2.BackColor = System.Drawing.SystemColors.Control
Me._Command1_2.Cursor = System.Windows.Forms.Cursors.Default
Me._Command1_2.ForeColor = System.Drawing.SystemColors.ControlText
Me._Command1_2.Location = New System.Drawing.Point(155, 272)
Me._Command1_2.Name = "_Command1_2"
Me._Command1_2.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Command1_2.Size = New System.Drawing.Size(78, 33)
Me._Command1_2.TabIndex = 6
Me._Command1_2.Text = "Cancel"
Me._Command1_2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
Me._Command1_2.UseVisualStyleBackColor = False
'
'_Command1_1
'
Me._Command1_1.BackColor = System.Drawing.SystemColors.Control
Me._Command1_1.Cursor = System.Windows.Forms.Cursors.Default
Me._Command1_1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me._Command1_1.ForeColor = System.Drawing.SystemColors.ControlText
Me._Command1_1.Location = New System.Drawing.Point(245, 266)
Me._Command1_1.Name = "_Command1_1"
Me._Command1_1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Command1_1.Size = New System.Drawing.Size(97, 40)
Me._Command1_1.TabIndex = 5
Me._Command1_1.Text = "OK"
Me._Command1_1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
Me._Command1_1.UseVisualStyleBackColor = False
'
'_Text1_1
'
Me._Text1_1.AcceptsReturn = True
Me._Text1_1.BackColor = System.Drawing.SystemColors.Window
Me._Text1_1.Cursor = System.Windows.Forms.Cursors.IBeam
Me._Text1_1.ForeColor = System.Drawing.SystemColors.WindowText
Me._Text1_1.Location = New System.Drawing.Point(114, 82)
Me._Text1_1.MaxLength = 0
Me._Text1_1.Name = "_Text1_1"
Me._Text1_1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Text1_1.Size = New System.Drawing.Size(225, 20)
Me._Text1_1.TabIndex = 2
Me._Text1_1.Text = "c:\cgc\RUSTICA.TXT"
'
'_Text1_0
'
Me._Text1_0.AcceptsReturn = True
Me._Text1_0.BackColor = System.Drawing.SystemColors.Window
Me._Text1_0.Cursor = System.Windows.Forms.Cursors.IBeam
Me._Text1_0.ForeColor = System.Drawing.SystemColors.WindowText
Me._Text1_0.Location = New System.Drawing.Point(113, 53)
Me._Text1_0.MaxLength = 0
Me._Text1_0.Name = "_Text1_0"
Me._Text1_0.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Text1_0.Size = New System.Drawing.Size(225, 20)
Me._Text1_0.TabIndex = 1
Me._Text1_0.Text = "c:\cgc\240padrus.cnt"
'
'_Command1_0
'
Me._Command1_0.BackColor = System.Drawing.SystemColors.Control
Me._Command1_0.Cursor = System.Windows.Forms.Cursors.Default
Me._Command1_0.ForeColor = System.Drawing.SystemColors.ControlText
Me._Command1_0.Location = New System.Drawing.Point(248, 7)
Me._Command1_0.Name = "_Command1_0"
Me._Command1_0.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Command1_0.Size = New System.Drawing.Size(91, 38)
Me._Command1_0.TabIndex = 0
Me._Command1_0.Text = "Buscar Fitxer"
Me._Command1_0.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
Me._Command1_0.UseVisualStyleBackColor = False
'
'CommonDialog1Open
'
'
'_Label1_6
'
Me._Label1_6.BackColor = System.Drawing.SystemColors.Control
Me._Label1_6.Cursor = System.Windows.Forms.Cursors.Default
Me._Label1_6.ForeColor = System.Drawing.SystemColors.ControlText
Me._Label1_6.Location = New System.Drawing.Point(8, 205)
Me._Label1_6.Name = "_Label1_6"
Me._Label1_6.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Label1_6.Size = New System.Drawing.Size(137, 23)
Me._Label1_6.TabIndex = 15
Me._Label1_6.Text = "Firma Secretari (S/N):"
Me._Label1_6.Visible = False
'
'_Label1_5
'
Me._Label1_5.BackColor = System.Drawing.SystemColors.Control
Me._Label1_5.Cursor = System.Windows.Forms.Cursors.Default
Me._Label1_5.ForeColor = System.Drawing.SystemColors.ControlText
Me._Label1_5.Location = New System.Drawing.Point(8, 248)
Me._Label1_5.Name = "_Label1_5"
Me._Label1_5.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Label1_5.Size = New System.Drawing.Size(97, 23)
Me._Label1_5.TabIndex = 12
Me._Label1_5.Text = "Remesa:"
Me._Label1_5.Visible = False
'
'_Label1_4
'
Me._Label1_4.BackColor = System.Drawing.SystemColors.Control
Me._Label1_4.Cursor = System.Windows.Forms.Cursors.Default
Me._Label1_4.ForeColor = System.Drawing.SystemColors.ControlText
Me._Label1_4.Location = New System.Drawing.Point(8, 24)
Me._Label1_4.Name = "_Label1_4"
Me._Label1_4.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Label1_4.Size = New System.Drawing.Size(91, 19)
Me._Label1_4.TabIndex = 11
Me._Label1_4.Text = "Banc"
Me._Label1_4.Visible = False
'
'_Label1_3
'
Me._Label1_3.BackColor = System.Drawing.SystemColors.Control
Me._Label1_3.Cursor = System.Windows.Forms.Cursors.Default
Me._Label1_3.ForeColor = System.Drawing.SystemColors.ControlText
Me._Label1_3.Location = New System.Drawing.Point(171, 112)
Me._Label1_3.Name = "_Label1_3"
Me._Label1_3.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Label1_3.Size = New System.Drawing.Size(99, 19)
Me._Label1_3.TabIndex = 9
Me._Label1_3.Text = "Pes de les Cartes:"
Me._Label1_3.Visible = False
'
'_Label1_2
'
Me._Label1_2.BackColor = System.Drawing.SystemColors.Control
Me._Label1_2.Cursor = System.Windows.Forms.Cursors.Default
Me._Label1_2.ForeColor = System.Drawing.SystemColors.ControlText
Me._Label1_2.Location = New System.Drawing.Point(8, 116)
Me._Label1_2.Name = "_Label1_2"
Me._Label1_2.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Label1_2.Size = New System.Drawing.Size(97, 23)
Me._Label1_2.TabIndex = 7
Me._Label1_2.Text = "Remesa:"
Me._Label1_2.Visible = False
'
'_Label1_1
'
Me._Label1_1.BackColor = System.Drawing.SystemColors.Control
Me._Label1_1.Cursor = System.Windows.Forms.Cursors.Default
Me._Label1_1.ForeColor = System.Drawing.SystemColors.ControlText
Me._Label1_1.Location = New System.Drawing.Point(8, 85)
Me._Label1_1.Name = "_Label1_1"
Me._Label1_1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Label1_1.Size = New Drawing.Size(97, 23)
Me._Label1_1.TabIndex = 4
Me._Label1_1.Text = "Fitxer d'Eixida:"
'
'_Label1_0
'
Me._Label1_0.BackColor = System.Drawing.SystemColors.Control
Me._Label1_0.Cursor = System.Windows.Forms.Cursors.Default
Me._Label1_0.ForeColor = System.Drawing.SystemColors.ControlText
Me._Label1_0.Location = New System.Drawing.Point(8, 55)
Me._Label1_0.Name = "_Label1_0"
Me._Label1_0.RightToLeft = System.Windows.Forms.RightToLeft.No
Me._Label1_0.Size = New System.Drawing.Size(97, 22)
Me._Label1_0.TabIndex = 3
Me._Label1_0.Text = "Fitxer d'Entrada:"
'
'Frm_Files
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.Control
Me.ClientSize = New System.Drawing.Size(364, 324)
Me.Controls.Add(Me._Text1_4)
Me.Controls.Add(Me.DataCombo1)
Me.Controls.Add(Me._Text1_3)
Me.Controls.Add(Me._Text1_2)
Me.Controls.Add(Me._Command1_2)
Me.Controls.Add(Me._Command1_1)
Me.Controls.Add(Me._Text1_1)
Me.Controls.Add(Me._Text1_0)
Me.Controls.Add(Me._Command1_0)
Me.Controls.Add(Me._Label1_6)
Me.Controls.Add(Me._Label1_5)
Me.Controls.Add(Me._Label1_4)
Me.Controls.Add(Me._Label1_3)
Me.Controls.Add(Me._Label1_2)
Me.Controls.Add(Me._Label1_1)
Me.Controls.Add(Me._Label1_0)
Me.Cursor = System.Windows.Forms.Cursors.Default
Me.Location = New System.Drawing.Point(3, 18)
Me.Name = "Frm_Files"
Me.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Text = "Fitxers d'entrada i Eixida"
CType(Me.DataCombo1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Sub ReLoadForm(ByVal addEvents As Boolean)
InitializeText1()
InitializeLabel1()
InitializeCommand1()
Form_Load()
If addEvents Then
AddHandler MyBase.Closed, AddressOf Me.Frm_Files_Closed
End If
End Sub
Sub InitializeText1()
ReDim Text1(4)
Me.Text1(4) = _Text1_4
Me.Text1(3) = _Text1_3
Me.Text1(2) = _Text1_2
Me.Text1(1) = _Text1_1
Me.Text1(0) = _Text1_0
End Sub
Sub InitializeLabel1()
ReDim Label1(6)
Me.Label1(6) = _Label1_6
Me.Label1(5) = _Label1_5
Me.Label1(4) = _Label1_4
Me.Label1(3) = _Label1_3
Me.Label1(2) = _Label1_2
Me.Label1(1) = _Label1_1
Me.Label1(0) = _Label1_0
End Sub
Sub InitializeCommand1()
ReDim Command1(2)
Me.Command1(2) = _Command1_2
Me.Command1(1) = _Command1_1
Me.Command1(0) = _Command1_0
End Sub
#End Region
End Class
In case this is relevant for the question, the form was upgraded from VB6 to VB.NET using an automatic tool. Specifically, the VBUC by Mobilize.net (I do not intend to do this as spam, but to give as much information as I can. If I shouldn't have done this, I'll edit the post and delete the reference)
Finally, I've managed to solve it! It seems that one of the external libraries I was using was creating a conflict. As Visual Studio didn't tell my which one it was, I simply unreferenced them all and then referenced again only the ones that I needed at that exact moment.
The conflict seemed to be caused by one of the libraries of the GrapeCity's ActiveReport tool. As I had to upgrade the tool and it wasn't code that I had written (and it was quite poorly commented), I didn't know which ones were or will be needed, so I referenced more than necessary. And it seems that precisely one of the extra libraries (I'm not sure at all, but I think that it was one of the Chart ones) was the one causing the conflict.
Thank you all for your help! And sorry for not answering before, but I had to switch to another urgent project and I couldn't try the solutions until today.

Error in File *****.rpt: The table could not be found. in crystal reports C#

I am a newbie in programming.
I just created a small app using C#.NET with externally designed crystal report(v 9.0).
The crystal report has TWO DATA SOURCES in two different servers (But both are SQL SERVER 2008 R2 s).
FYI - When the external report runs separately it prompts twice for entering login info.
Now I integrated it with my code as below.
private void PrintVoucher()
{
int varvoucherno;
ReportDocument rptDocument = new ReportDocument();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
TableLogOnInfos crtableLogoninfos2 = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo2 = new TableLogOnInfo();
ConnectionInfo crConnectionInfo2 = new ConnectionInfo();
Tables CrTables2;
rptDocument.Load(#"K:\PRIDER_VOUCHER_V2.rpt");
varvoucherno = 2014090005;
ParameterFieldDefinitions crParameterFieldDefinitions;
ParameterFieldDefinition crParameterFieldDefinition;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
crParameterDiscreteValue.Value = varvoucherno;
crParameterFieldDefinitions = rptDocument.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["VOUCHER_NO"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
PRIDER_STATEMENT.Transactions objtrans = new Transactions();
conn = new SqlConnection(objtrans.sqlstring);
cmd = new SqlCommand("PRINT_VOUCHER", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Clear();
cmd.Parameters.Add("#VoucherNo", SqlDbType.Int).Value = varvoucherno;
SqlParameter pararetvalueout = cmd.Parameters.Add("#ReturnValue", SqlDbType.Int);
pararetvalueout.Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
conn.Dispose();
crConnectionInfo.ServerName = "SERVER_IP_1";
crConnectionInfo.DatabaseName = "DB_1";
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "*****";
crConnectionInfo2.ServerName = "SERVER_IP_2";
crConnectionInfo2.DatabaseName = "DB_2";
crConnectionInfo2.UserID = "sa";
crConnectionInfo2.Password = "*****";
CrTables = rptDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
crtableLogoninfo2 = CrTable.LogOnInfo;
crtableLogoninfo2.ConnectionInfo = crConnectionInfo2;
CrTable.ApplyLogOnInfo(crtableLogoninfo2);
}
rptDocument.PrintToPrinter(1, false, 0, 0);
}
I am getting following error with it.
DataSourceException was unhandled.
Error in File PRIDER_VOUCHER_V2 {CF71142D-5D36-4121-A854-BCA381FA9B67}.rpt:
The table could not be found.
Please help me. I'm in a very needy situation.