|
First guess is user credentials - check to see what user it is running under in com+, then check if that user is allowed to use the db.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Don't know, but you may find my article helpful.
You should see a transaction go in when you register the component for the first time, then for each time you commit the root object that has RequiresNew agaist it.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
Thank you all for your help. It turns out that the COM+ component couldn't find the database DLL. According to the trace in Debug Viewer it attempted to download the DLL from the System32 directory. I copied the file into that directory and it's now working perfectly.
Thanks again!
Graham
|
|
|
|
|
I have a datatable, with two columns. I want to find out how it is possible to count all the values in the 1st column. I want to be able to see which row has the highest number. There is a reason for me doing it this way, rather than making a query do the same thing. Thanks in advance.
|
|
|
|
|
sum()
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
This may seem a bit stupid replying to my own answer, but as I found out what it is, I thought I might share it.
Ok, this is bad code, but you get the idea:
int test1 = 0;
int test2 = 0;
foreach(DataRow myRow in myTable.Rows)
{
test1 = System.Int32.Parse(myRow[0].ToString());
if (test2 <= test1)
{
test2 = test1 + 1;
}
}
|
|
|
|
|
Hi,
I have created a datagrid having source as one table. but the column style I have specified separately for each column of the table some of which are DataGridComboboxColumn. Things till now are working fine - I am able to view all the foreing table entries properly in combobox. The code is as shown below..
UserComboTextCol.MappingName = obTableVerboseInfo.ColumnName;
UserComboTextCol.HeaderText = obTableVerboseInfo.ColHeaderName;
UserComboTextCol.Width = 120;
UserComboTextCol.ColumnComboBox.DataSource = dsRefTreeSelected.Tables[obTableVerboseInfo.RefTableName].DefaultView;
UserComboTextCol.ColumnComboBox.DisplayMember = obTableVerboseInfo.DisplayColumn;
UserComboTextCol.ColumnComboBox.ValueMember = obTableVerboseInfo.RefColumnName;
Do not worry about the values on right side of =.
But now I want this datagrid for update purpose as well. i.e. if user makes some modifications to the combo control, I should get the foreign key value of the new selected member. All that I get is the display column which can be duplicate in table !! Once the user has updated the datagrid, how do I put the values back to the table by converting them to the actual values from display column ? Can anyone help me ?
Thanks.
Rohit
|
|
|
|
|
I say this, not as a criticism so much as a way to help you; you've really got to try to phrase your questions a little clearer. Here's how I would have asked what I think you're trying to ask:
"I have a datagrid on a form I use to display a single table. The datagrid was originally intended for display only, but I now want to use it to update records as well. I have converted one of the columns so it now displays a combo box with a list of selections. I just don't understand, when I click my update button, how I can get the foreign key of the current record. Can someone point me in the right direction?"
The problem is that I don't know if you even have an update button. I had to assume you have some sort of handler to call update. It is also unclear, though the context seems to reveal it a bit, whether you are talking about updating a single record or many records at a time.
If I've missed your point, I apologize, I just think you should try to re-phrase it a bit to make it very clear what the problem is. You'll be a lot more likely to get a response that helps you fix the problem if you do.
Best Regards.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Sorry ! I typed that message in such a hurry that I could not re-read it even once. But yes what you have understood is correct. I have an update button and I want to update one row at a time when User clicks on Update. Is there a way in which you can get the foreign key in this case?
Another question I had is, when you have a table with composit primary key (3 columns in my case) and you have that as a foreign key in another table, how do you replace those (foreign key) composite columns by a combo box which will hold values for some other column from the primary key table ?
Thanks
- Rohit
|
|
|
|
|
Hi,
Has anybody used WM_PRINTCLIENT message?
I m using the following SendMessage call.....
SendMessage(hWnd, WM_PRINTCLIENT, (WPARAM) hDCMem, PRF_CLIENT | PRF_ERASEBKGND | PRF_CHILDREN );
but this returns a black window.
Any clues?
Thanks,
Puneet.
|
|
|
|
|
Hi all.
We are currently working on some software, that'll be distributed to a lot of customers - of our customer.
We need to show pdf files and make batch printing of them.
Anyone out there with a solution or knowledge of a component, that's capable of this?
It's important that it's royalty-free.
Thanks in advance!
Greetings,
Brian Dam
Tricon data A/S
Denmark
|
|
|
|
|
|
I have an array...
private void Page_Load(object sender, System.EventArgs e)
{
string [] dirs = Directory.GetDirectories(@"c:\inetpub\wwwroot\shares\folder\", "b*");
labelPath.Text=dirs.ToString();
}
as you can see it's value is assigned to the string "dirs"
now I want it to show up thought he label "labelPath", but when I compile the page it shows "System.String[]" ....
I need it to show the names of folders that start with "b", I can make it work as a consle application, but not a aspx page...
can somebody please help...???
/\ |_ E X E GG
|
|
|
|
|
|
string [] dirs = Directory.GetDirectories(@"c:\inetpub\wwwroot\shares\folder\", "b*");
I tried the Join Method but I can't get it to turn the above array "dirs" into a regular string that I can show though a label....
can you show me?
/\ |_ E X E GG
|
|
|
|
|
|
|
try
Console.WriteLine(String.Join('\n', dirs));
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
foreach(string x in Dirs)
{
labelPath.Text = labelPath.Text + x + "\n";
}
\\the "\n" is for newline! if you want a new line!
Leon v Wyk
|
|
|
|
|
Hi,
I'm looking for a (simple) way to write outlook plugins in c#. Unfortunatly I wasn't able to find any articles here on codeproject (even though I thought there was a competition in may/june).
Would be nice if someone could point me to the right direction!
TIA,
Daniel
--
SharpPrivacy - A free OpenPGP implementation in c#
http://www.sharpprivacy.net[^]
|
|
|
|
|
|
Can I send data through the parallel port in C#?
/\ |_ E X E GG
|
|
|
|
|
Hi there,
I would like to notify my app if a socketconnection is broken.
I tried to use a self created event, with wich i want to notify an upper class in such a case.
The problem is i receive a unhandled exception of type 'System.MissingMethodException'...
Why? What Am i doing wrong and what means this error?
Thanks a lot,
stonee
internal delegate void ConnectionHandler(SocketException se);<br />
............<br />
<br />
public class Control<br />
{<br />
<br />
<br />
internal event ConnectionHandler OnConnectionProblem;<br />
<br />
................<br />
<br />
<br />
public Control() <br />
{<br />
OnConnectionProblem+=new ConnectionHandler(ESControl_OnConnectionProblem);<br />
....................<br />
<br />
<br />
catch(SocketException se)<br />
{<br />
/<br />
MessageBox.Show (se.Message );<br />
try<br />
{<br />
OnConnectionProblem(se);<br />
}<br />
catch(MissingMethodException mme)<br />
{<br />
MessageBox.Show(mme.Message+"::"+mme.InnerException);<br />
}
|
|
|
|
|
Here's the problem:
stonee74 wrote:
OnConnectionProblem+=new ConnectionHandler(ESControl_OnConnectionProblem);
There's no method ESControl_OnConnectionProblem
Here's how I would do it:
public delegate void ConnectionHandler(object sender, SocketException se);
public class ConnectionProblemEventArgs
{
private SocketException m_SocketException;
public ConnectionProblemEventArgs(SocketException se)
{
SocketException = se;
}
public SocketException SocketException
{
get
{ return m_SocketException; }
}
}
public class EsControl
{
public event ConnectionHandler ConnectionProblem;
public virtual void OnConnectionProblem(SocketException se)
{
if (ConnectionProblem != null)
ConnectionProblem (this, new ConnectionProblemEventArgs (se));
}
private DoSomethingWithSocket()
{
try
{
...
}
catch(SocketException se)
{
OnConnectionProblem (se);
}
}
}
public class EventListner
{
public EventListner(EsControl esControl)
{
EsControl.ConnectionProblem += new ConnectionHandler (ESControl_ConnectionProblem);
}
private void ESControl_ConnectionProblem(object sender, ConnectionProblemEventArgs e)
{
}
}
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
thanks,
I'm sure this will work.
I have in my original class a method definition.
I still cannot understand the errormessage..
private void ESControl_OnConnectionProblem()<br />
{<br />
<br />
}
thanks for all inputs.
regards,
stonee
|
|
|
|