|
The credential cache has to be cleared, and I'm not sure you have any control over this. The default expiration time is around 15 minutes. This is a function of Windows and not .NET.
The best solution is to not emulate users but to - if possible - log in as a user with administrative rights (or enough privileges to enumerate group membership) and query the groups for a user. This would require only 1 login and would allow you to query as many users as you want. This is the way that most programs (including the management tools in Windows) work.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Now, I don't now anything about encoding... Now lets take this text for example. It's "regular" encoding, correct? Now take this @ for example. Is the @ sign something special?
/\ |_ E X E GG
|
|
|
|
|
yeah, it's big and bold. Perhaps you need to reword your question ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I don't understand...
/\ |_ E X E GG
|
|
|
|
|
The @ is 'special' in that it's been made larger and bold. Your question was somewhat enigmatic. That's why I suggested you reword it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
ok, thank you.
/\ |_ E X E GG
|
|
|
|
|
Encoding refers to the way that bits are translated to characters. What you refer to as "regular encoding" is ASCII, which is a 7 bit encoding allowing a total of only 128 characters. Unicode encodings (UTF7, UTF8, UTF16) are more flexible, and can represent far more characters. The numbers in the UTF codes refer to the minimum number of bits that are used to represent a single character.
|
|
|
|
|
Encoding is important when working with file streams. For a good article on encoding, read The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)[^].
The '@' character is a literal character (no escapes necessary), and as with everything else, you can read more about it in the C# language documentation. Read the documentation[^] on the string type for more information about @-quoted strings.
For example, "Hello, \"world\"" == @"Hello, ""world""" , and
"Hello,\nworld!" == @"Hello,
world!" (line break intentional)
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
�
So, is that character above (U+FFFD) not showing because it is unicode, and this webpage is ASCII?
/\ |_ E X E GG
|
|
|
|
|
Hi,
I have a column that is calculated (from other columns in the DataSet):
myDataTable.Columns.Add("ItemSubTotal", typeof(decimal), "ItemPrice * ItemQuantity");
When I try and save the DataSet to file with this Parameter:
myDataAdapter.InsertCommand.Parameters.Add("@ItemSubTotal", OleDbType.Decimal, 100, "ItemSubTotal");
I get this error:
The column mapping from SourceColumn 'ItemSubTotal' failed because the DataColumn 'ItemSubTotal' is a computed column.
Is there a way to save a computed column?
Thanks,
Ron
|
|
|
|
|
No, because it's a Computed Column. There's nothing to save. When you query against that column, you'll get the result of the column. Why would you want to save it again? If you want to save the value, you'll have to save it into another column in your existing table, or a different one if you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi again Dave,
Sorry new to programming...
I'm having difficulty finding the code to save the computed column values to the other column (2nd column not viewed as expression). Can you show me an example?
Thanks,
Ron
|
|
|
|
|
Hi everyone.
I am working on an application which will rely heavily upon the DirectoryServices namespace. Specifically, I will be using the ADSI provider to manipulate and configure IIS.
Lately I've become a little concerned with Windows version compatibility. The application will be used extensively on Windows 2000 Server, along with several Windows 2003 Server boxes. The problem is that on a number of MSDN pages, I see notes that indicate various features of the DirectoryServices ADSI provider require Windows 2003 Server.
However, my limited tests appear to indicate otherwise. So far, I've not had a problem with any of my Windows 2000 Server boxes.
Here is one such example -- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/iis/adding_metabase_properties_to_a_collection_using_system_directoryservices.asp
The above page notes that the Virtual Directory sample requires Windows 2003 Server, however the sample compiles (after fixing the obvious source code errors) and runs without issue on at three Windows 2000 Server boxes I've tested.
So what is the issue here? Anyone run into this? Can I count on this work on Windows 2000 Server? Where can I find the definitive answer on this?
Thanks!
|
|
|
|
|
I haven't run into this, but if you want to make sure your app is going to work on all of your platforms, Test, Test, Test, Test, and Test some more, until YOU'RE happy with the functionality. Then hand it to a couple of beta testers and see if THEY'RE happy with the product on the platforms your suspicious of.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi, anyone know about that kind of error?
Thanks
|
|
|
|
|
It would help if you posted the code where the error occurs!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks David,
i close the Visual Studio and reopen,
everything's just fine then,
sounds weird though..
Thanks
But i have another question, i wanna apply column style to one of the columns in my table, i wanna hide one column but setting its width to zero, i have five datacolumn object, but i only have one gridcolumnstyle with mapping name set to one of the column name i wanna hide.
but the style doesn't apply, the column is not hidden.
how am i goin to hide it?
|
|
|
|
|
You hide the column by setting it's width to 0, but since you haven't supplied any code, I can't tell you what your doing wrong. So, here's an example:
private void HideColumnOfDataSet()
{
System.Data.DataTable points = new System.Data.DataTable("Points");
points.Columns.Add(new DataColumn("X", typeof(int)));
points.Columns.Add(new DataColumn("Y", typeof(int)));
points.Rows.Add(new object[]{1, 2});
points.Rows.Add(new object[]{3, 5});
dataGrid1.DataSource = points;
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName = "Points";
dataGrid1.TableStyles.Add(tableStyle);
dataGrid1.TableStyles["Points"].GridColumnStyles["X"].Width = 0;
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i get null reference exception in this line
this.dataGrid1.TableStyles["Students"].GridColumnStyles["Password"].Width = 0;
how?
|
|
|
|
|
I can't tell without seeing the rest of your code in that block. Most likely, you're missing a 'new' somewhere.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave,
found it,
i did it inside the initialize component(using designer)
and indeed the designer define the table style before adding column.
i replace the order, add column first, then it's fine.
Thanks
|
|
|
|
|
Accessing indexes requires that an object at that index (or with that index keyword, like the table style or column style name above) exists. If it doesn't, null is returned from the index property. When you try to call a method or access a property on null, you get a NullReferenceException .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I sometimes see it in a perfectly valid line of code. I simply cut and re-paste the line and the compiler is then happy!
|
|
|
|
|
Hi,
How does one enumerate the groups a user belongs to using the WinNT:// provider (not LDAP) ??
TIA,
Matt
|
|
|
|
|