Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / December 2003

Tip: Looking for answers? Try searching our database.

Help converting exampe from C# to JScript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Norman - 15 Dec 2003 21:31 GMT
The following is a example of C# ADO.Net code that I am trying to
incorporate in my JScript code. How do I make the line with the
********* work in JScript. I have tried various permutations with no
success. I assume that the object needs to be a .Net Framework
System.object, not a JScript object, or are they the same thing.

private void FindInMultiPKey(DataTable myTable){
   DataRow foundRow;
   // Create an array for the key values to find.
   object[]findTheseVals = new object[3]; //*******
   // Set the values of the keys to find.
   findTheseVals[0] = "John";
   findTheseVals[1] = "Smith";
   findTheseVals[2] = "5 Main St.";
   foundRow = myTable.Rows.Find(findTheseVals);
   // Display column 1 of the found row.
   if(foundRow != null)
     Console.WriteLine(foundRow[1]);
}

Thanks,
Norman
Martin Honnen - 16 Dec 2003 11:42 GMT
> The following is a example of C# ADO.Net code that I am trying to
> incorporate in my JScript code. How do I make the line with the
[quoted text clipped - 6 lines]
>     // Create an array for the key values to find.
>     object[]findTheseVals = new object[3]; //*******

object in C# is an alias for System.Object in .NET thus is you use

var findTheseVals: System.Object[] = new System.Object[3];
findTheseVals[0] = "John";
findTheseVals[1] = "Smith";
findTheseVals[2] = "5 Main St.";

I think it should work
Signature


    Martin Honnen
    http://JavaScript.FAQTs.com/

Norman - 16 Dec 2003 21:47 GMT
That is correct.

Thank you.

> > The following is a example of C# ADO.Net code that I am trying to
> > incorporate in my JScript code. How do I make the line with the
[quoted text clipped - 15 lines]
>
> I think it should work

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.