JScript .NET error

603 views Asked by At

I'm trying to compile the program listed here:

http://www.webreference.com/js/column117/index.html

However, every time I try I get an error:

error JS1259: A referenced assembly depends on another assembly that is not referenced or could not be found

I checked and I have all the DLL files for the libraries being imported as far as I can tell. What is happening?

Is there a way to get more detailed information as to which library is missing which class or vise versa?

1

There are 1 answers

1
posfan12 On BEST ANSWER

Seems I needed to also import Accessibility in order for it to work with the new version. A more verbose error message would have been nice. :(

But I'm getting the same error now in this script when it gets to the "private var myData: DataTable;" part:

import System;
import System.Windows.Forms;
//import System.ComponentModel;
import System.Drawing;
import Accessibility;
import System.Data;
import System.Data.SqlClient;


package ResizeMe
{
 class PanelForm extends System.Windows.Forms.Form
 {
  private var panel1: Panel;
  private var label1: Label;
  private var myDataForm: DataGridView;
  private var myData: DataTable;   // !!!
  private var connectionString: String;
  private var selectCommand: String;
  private var dataAdapter: SqlDataAdapter;
  private var commandBuilder: SqlCommandBuilder;

  function PanelForm()
  {
   this.Text= "Anchoring Demo: Resize Me"; 



   try
   {
    selectCommand = "SELECT * FROM dbo.Deities";
    connectionString = "Integrated Security=SSPI;Persist Security Info=False;" +
    "Initial Catalog=protos;Data Source=localhost"

    dataAdapter = new SqlDataAdapter(selectCommand, connectionString);
    commandBuilder = new SqlCommandBuilder(dataAdapter);

//    myData = new DataTable();
//    myData.Locale = System.Globalization.CultureInfo.InvariantCulture;
//    dataAdapter.Fill(myData);       // !!!

//    myDataForm = new DataGridView();
//    myDataForm.DataSource = myData;
//    myDataForm.Location= new Point(100,100);
//    myDataForm.Size= new System.Drawing.Size(100,100);
   }
   catch (e:SqlException)
   {
//    MessageBox.Show("To run this example, replace the value of the " +
//    "connectionString variable with a connection string that is " +
//    "valid for your system.");
   }



   label1= new Label;       
   label1.Location= new Point(10,10);
   label1.Size= new System.Drawing.Size(80,20);
   label1.Name= "label1";
   label1.Text= "This is a Label";

   panel1= new Panel;
   panel1.Location= new Point(0,0);
   panel1.Size= new System.Drawing.Size(300,300);
   panel1.Name= "This is a Panel";
   panel1.Anchor= AnchorStyles.Top | AnchorStyles.Left;

   panel1.Controls.Add(label1);  
   panel1.Controls.Add(myDataForm);

   this.Controls.Add(panel1);
  } 
 }
}

Application.Run(new ResizeMe.PanelForm());

Any clue what I'm missing?

[edit] FYI, during development use jsc.exe included with v2.0.50727 of the .NET Framework as it produces verbose errors that actually are useful. You can always switch to newer versions for the final build if need be. That's what solved my problem.