Click here to Skip to main content
15,903,385 members
Home / Discussions / C#
   

C#

 
GeneralRe: Decompiler for c# Pin
J. Dunlap19-Oct-03 10:40
J. Dunlap19-Oct-03 10:40 
GeneralI need a horizontal tree control Pin
MtnBiknGuy19-Oct-03 4:39
MtnBiknGuy19-Oct-03 4:39 
GeneralRe: I need a horizontal tree control Pin
Heath Stewart19-Oct-03 5:41
protectorHeath Stewart19-Oct-03 5:41 
GeneralRe: I need a horizontal tree control Pin
MtnBiknGuy19-Oct-03 10:14
MtnBiknGuy19-Oct-03 10:14 
GeneralRe: I need a horizontal tree control Pin
MtnBiknGuy19-Oct-03 10:33
MtnBiknGuy19-Oct-03 10:33 
QuestionHow to format text in a winform datagrid column Pin
Anonymous19-Oct-03 3:26
Anonymous19-Oct-03 3:26 
AnswerRe: How to format text in a winform datagrid column Pin
Mike Ellison19-Oct-03 8:54
Mike Ellison19-Oct-03 8:54 
GeneralE_NOINTERFACE Pin
Norman Fung18-Oct-03 19:30
Norman Fung18-Oct-03 19:30 
This code works in a "console" app, but when I place it in a COM+ serviced component, I got "E_NOINTERFACE" exception when I called OleDbAdapter.Fill(..)

public void AuthenticateUser(string username, string passwd, ref int retcode)
{ //AuthenticateUser

int count = -1;
string db_username;
string db_passwd;
int db_numlogin;
string connString;
OleDbConnection connUsers;
OleDbDataAdapter daUsers;
DataSet dsUsers;

EventLog log = new EventLog("Application");
log.Source = "AccessDbMaster";

try
{ //try block
retcode = -1;

connString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Program Files\AppAlgo\ComPlusServiceDemo\datasource\users.mdb; User ID=Admin; Password=";
connUsers = new OleDbConnection(connString);
daUsers = new OleDbDataAdapter("SELECT * FROM Users WHERE username='"+ username + "' AND passwd='" + passwd + "'", connUsers);
dsUsers = new DataSet();
daUsers.Fill(dsUsers, "Users");

count = dsUsers.Tables["Users"].Rows.Count;

if(count==0) {
log.WriteEntry("AccessDbMaster authentication failed. User not found");
return;
}

foreach(DataRow user in dsUsers.Tables["Users"].Rows)
{
db_username = user["username"].ToString();
db_passwd = user["passwd"].ToString();
db_numlogin = (int) user["numlogin"];

retcode = db_numlogin; //return value

//Increment number of login:
db_numlogin++;
user["numlogin"]=db_numlogin;
}

OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(daUsers);
daUsers.Update(dsUsers, "Users");

connUsers.Close();

} //try block
catch(Exception err)
{
log.WriteEntry("AccessDbMaster authentication failed. Info: " + err.Message);
retcode=-1;
}

return;
} //AuthenticateUser


Error message is not very descriptive: "No error information available: E_NOINTERFACE(0x80004002)."

I'm suspecting that it's got to do with COM+ security. I checked identity using COM+ Admin Tool. The application, and all COM+ apps in question, runs under SYSTEM account (Administrators). Impersonation level is "Impersonate" and "Packet"... Any idea? Thanks!

GeneralTransparent window within another transparent window Pin
David Forrester18-Oct-03 17:27
David Forrester18-Oct-03 17:27 
GeneralRe: Transparent window within another transparent window Pin
David Forrester18-Oct-03 22:39
David Forrester18-Oct-03 22:39 
QuestionCAN SOMEBODY PLEASEEEEEE... Pin
fadee18-Oct-03 8:53
fadee18-Oct-03 8:53 
AnswerRe: CAN SOMEBODY PLEASEEEEEE... Pin
Arjan Einbu18-Oct-03 10:04
Arjan Einbu18-Oct-03 10:04 
GeneralRe: CAN SOMEBODY PLEASEEEEEE... Pin
fadee18-Oct-03 20:55
fadee18-Oct-03 20:55 
GeneralRe: CAN SOMEBODY PLEASEEEEEE... Pin
eggie55-Dec-03 14:30
eggie55-Dec-03 14:30 
GeneralSmall IO help needed... Pin
eggie518-Oct-03 7:27
eggie518-Oct-03 7:27 
GeneralRe: Small IO help needed... Pin
je_gonzalez18-Oct-03 10:16
je_gonzalez18-Oct-03 10:16 
GeneralRe: Small IO help needed... Pin
eggie518-Oct-03 17:56
eggie518-Oct-03 17:56 
GeneralRe: Small IO help needed... Pin
eggie518-Oct-03 11:47
eggie518-Oct-03 11:47 
GeneralRe: Small IO help needed... Pin
je_gonzalez18-Oct-03 12:44
je_gonzalez18-Oct-03 12:44 
GeneralRe: Small IO help needed... Pin
eggie518-Oct-03 14:39
eggie518-Oct-03 14:39 
GeneralRe: Small IO help needed... Pin
je_gonzalez18-Oct-03 15:27
je_gonzalez18-Oct-03 15:27 
GeneralRe: Small IO help needed... Pin
eggie518-Oct-03 17:07
eggie518-Oct-03 17:07 
Generalopen external application Pin
JockerSoft18-Oct-03 6:50
JockerSoft18-Oct-03 6:50 
GeneralRe: open external application Pin
eggie518-Oct-03 6:57
eggie518-Oct-03 6:57 
GeneralRe: open external application Pin
Heath Stewart18-Oct-03 16:12
protectorHeath Stewart18-Oct-03 16:12 

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.