Click here to Skip to main content
16,005,141 members
Home / Discussions / C#
   

C#

 
QuestionNew workspace window Pin
sinosoidal27-Mar-07 4:15
sinosoidal27-Mar-07 4:15 
AnswerRe: New workspace window Pin
Christian Graus27-Mar-07 4:22
protectorChristian Graus27-Mar-07 4:22 
Questionconnect Dataset with reportviewer Pin
FrankBoonen27-Mar-07 4:10
FrankBoonen27-Mar-07 4:10 
QuestionHow can i rename a file?? Pin
Test27030727-Mar-07 4:10
Test27030727-Mar-07 4:10 
AnswerRe: How can i rename a file?? Pin
Martin#27-Mar-07 4:19
Martin#27-Mar-07 4:19 
QuestionEvent and EventHandler for communication required Pin
Starzfighter27-Mar-07 3:56
Starzfighter27-Mar-07 3:56 
AnswerRe: Event and EventHandler for communication required Pin
Not Active27-Mar-07 5:21
mentorNot Active27-Mar-07 5:21 
QuestionPassing Recordset from C# COM to VBScript Pin
rahvyn627-Mar-07 3:49
rahvyn627-Mar-07 3:49 
I am working on a COM dll in C# that needs to pass an ADODB recordset back to
the calling VBScript. I believe I have everthing setup correctly, as the
calls work, and it looks like a recordset is returned, however, the recordset
is null or closed. What is the trick to passing a recordset back from C#?

The Call:
Set rs = CreateObject("Interface")
rs.Init "System", "ODBC", "user", "pass", "database", "server"
retVal = rs.DataImport("value")

C#:
using ADODB;

[Guid("C3C26A94-9639-43c4-B59C-E245C8A68D44")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface iInterface
{
[DispId(1)] bool DataExport(string OrderNumber, string
TrackingNumber, decimal Freight, decimal Weight, string ShipDate, string
ShipVia, string MiscNum);
[DispId(2)] bool DataVoid(string OrderNumber, string TrackingNumber,
decimal Freight, decimal Weight, string MiscNum);
[DispId(3)] Recordset DataImport(string OrderNumber);
[DispId(4)] void Init(string nameVal, string odbcVal, string
userVal, string passVal, string dbVal, string srvVal);
}

[Guid("EF8369F0-CF42-40b1-B3F3-0EC54CE73FF4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Interface")]
public class PSIHeader:iInterface
{

public Recordset DataImport(string OrderNumber)
{
//misc stuff - create connection, query etc...
//Recordset creation and return
rs.CursorLocation = CursorLocationEnum.adUseClient;
rs.Open(query.ToString(), cn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockOptimistic, -1);

return rs;
}
}

I have been using regasm to register the type library.

Thanks
Questionend (break) Pin
SVb.net27-Mar-07 3:46
SVb.net27-Mar-07 3:46 
AnswerRe: end (break) Pin
Christian Graus27-Mar-07 3:48
protectorChristian Graus27-Mar-07 3:48 
GeneralI rarely say this Pin
Ennis Ray Lynch, Jr.27-Mar-07 5:13
Ennis Ray Lynch, Jr.27-Mar-07 5:13 
GeneralRe: end (break) Pin
SVb.net28-Mar-07 6:38
SVb.net28-Mar-07 6:38 
QuestionHow could i dispose a windows form. Pin
Test27030727-Mar-07 3:40
Test27030727-Mar-07 3:40 
AnswerRe: How could i dispose a windows form. Pin
Martin#27-Mar-07 3:44
Martin#27-Mar-07 3:44 
GeneralRe: How could i dispose a windows form. Pin
Test27030727-Mar-07 3:53
Test27030727-Mar-07 3:53 
AnswerRe: How could i dispose a windows form. Pin
Christian Graus27-Mar-07 3:48
protectorChristian Graus27-Mar-07 3:48 
GeneralRe: How could i dispose a windows form. Pin
Test27030727-Mar-07 4:06
Test27030727-Mar-07 4:06 
GeneralRe: How could i dispose a windows form. Pin
Christian Graus27-Mar-07 4:23
protectorChristian Graus27-Mar-07 4:23 
GeneralSending UDP packets Pin
V.27-Mar-07 3:40
professionalV.27-Mar-07 3:40 
QuestionWindows Forms Pin
7127-Mar-07 3:22
7127-Mar-07 3:22 
AnswerRe: Windows Forms Pin
Christian Graus27-Mar-07 3:35
protectorChristian Graus27-Mar-07 3:35 
GeneralRe: Windows Forms Pin
Martin#27-Mar-07 3:40
Martin#27-Mar-07 3:40 
AnswerRe: Windows Forms Pin
Martin#27-Mar-07 3:36
Martin#27-Mar-07 3:36 
QuestionLarge TXT files Pin
Sabry190527-Mar-07 3:04
Sabry190527-Mar-07 3:04 
AnswerRe: Large TXT files Pin
Christian Graus27-Mar-07 3:13
protectorChristian Graus27-Mar-07 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.