Sign in to follow this  
Followers 0
JLogan3o13

Translating a SQL call from AutoIt to C#

3 posts in this topic

#1 ·  Posted (edited)

This is just a curiosity question; I've been playing with C# a little bit, with VS 2010 Express. I've taken a front-end I wrote in AutoIt, and am working through converting functions just to see what the translation looks like. One thing I have run into hurdles with is making a connection to and sending calls to a SQL database. I've been googling a bit, just thought I would ask here as well as I know many forum members work in other languages. Below is a snipped of the function in AutoIt, if anyone can nudge me in the right direction I would appreciate it.

Connection

$oLocator = ObjCreate("WbemScripting.SWbemLocator")
$oSMS = $oLocator.ConnectServer($sServer, "root\sms\site_" & $SCode)
   If @error Then Exit MsgBox(0, "Sparrow SCCM Console", "Can't Connect")
$oSMS.Security_.ImpersonationLevel = 3
$oSMS.Security_.AuthenticationLevel = 6

Sample Call

$oResults = $oSMS.ExecQuery("SELECT * FROM SMS_Collection WHERE Comment LIKE '%License%' ORDER by Name")
Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites



just a google search gave me this:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa393720%28v=vs.85%29.aspx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0