|
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddl_CircularType != 'Send to Individual')
{
ddl_Department.Enabled = true;
}
else if (ddl_CircularType !='Send to Particular Department')
{
ddl_Department.Enabled = true;
ddl_EmployeeID.Enabled=true;
ddl_EmployeeName.Enabled=true;
}
else if (ddl_CircularType = 'Send to All Employee')
{
ddl_Department.Enabled = true;
ddl_EmployeeID.Enabled=true;
ddl_EmployeeName.Enabled=true;
}
}
|
|
|
|
|
You have asked this also here[^]. Please do not repost.
|
|
|
|
|
sorry for that i am new on this website
ando i dont get answer then i post again
|
|
|
|
|
You have to have patience. Also it's important that the question is clear and well explained. This helps people to understand your problem and give good answers. I see OG has already given you a suggestion so I hope that helps
|
|
|
|
|
|
hari om singh wrote: i dont get answer then i post again
No, don't. It won't help you, it will just annoy people: we don't like duplicated work. And annoying people you want help from is normally counterproductive.
Bear in mind it is a weekend, so most of the Western world is not at work today - this understandably slows responses...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
i say sorry for that i dont remembre wekend
|
|
|
|
|
OriginalGriff wrote: Bear in mind it is a weekend, so most of the Western world is not at work today
This kind of activity doesn't count?
|
|
|
|
|
Well, Nagy is in bed hungover, DD is scheming to get his hands on the planning applications committee, and everybody else is being forced to do what their Significant Other has planned for the day...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Sounds like a weekend
|
|
|
|
|
After beat a button in webbrowser's page,a confirm window popup,I can't see it's infomation in ie's source code.How can I get this window's infomation?Thank you.
|
|
|
|
|
What does this have to do with C#?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
oh,let me explain,I want to use Webpage automation operation to deal with my page,so I select c# to do this job with the webbrowser control.
|
|
|
|
|
|
Hi,
I have executed Exchange 2007 commands inside of c sharp code before, but have not attempted to do so with 2013 until now. There are no management tools installed on the machines this app will run on, so I believe I have to open up a remote PSsession to an Exchange 2013 server which is something else I have not done.
I was wondering if any one had an example of doing this with an Exchange 2013 specific cmdlet?
Thank you
|
|
|
|
|
I found this
$session = new-pssession -configurationname microsoft.exchange -connectionuri http://exchangeserver.domain.com/powershell -auth kerberos -credential (get-credential)
import-psession $session
And I can at least see the commands in the powershell session now, so this is a start
|
|
|
|
|
This is telling me the "State of runspace is not valid for this operation" at line 1082, which is the var results2 = powerShell.Invoke(); line.
Any ideas?
using (PowerShell powerShell = PowerShell.Create())
{
powerShell.Runspace = runspace;
string un = @"domain\username";
System.Security.SecureString pw = new System.Security.SecureString();
string password = "password";
foreach (char ch in password)
{
pw.AppendChar(ch);
}
PSCredential cred = new PSCredential(un, pw);
string CONNECTION_URI = @"http://exchangeserver.com/powershell";
PSCommand psSession = new PSCommand();
psSession.AddCommand("$session = New-PSSession");
psSession.AddParameter("ConfigurationName", "Microsoft.Exchange");
psSession.AddParameter("ConnectionUri", new Uri(CONNECTION_URI));
psSession.AddParameter("Kerberos");
psSession.AddParameter("Credential", cred);
psSession.AddParameter("AllowRedirection");
psSession.AddCommand("Import-PSSession");
psSession.AddParameter("$session");
psSession.AddCommand("Get-MailboxDatabaseCopyStatus");
psSession.AddParameter("databasename");
powerShell.Commands = psSession;
var results2 = powerShell.Invoke();
foreach (var item in results2)
{
MessageBox.Show(item.Members.ToString());
}
}
|
|
|
|
|
In case someone comes across this in a search
string un = @"domain\username";
System.Security.SecureString pw = new System.Security.SecureString();
string password = "password";
string databaseName = "databasename";
string exchangeServerName = "http://exchangeserver.com/powershell";
string microsoftSchemaName = "http://schemas.microsoft.com/powershell/Microsoft.Exchange";
foreach (char ch in password)
{
pw.AppendChar(ch);
}
PSCredential cred = new PSCredential(un, pw);
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri(exchangeServerName), microsoftSchemaName, cred);
connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Kerberos;
using (Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo))
{
using (PowerShell powershell = PowerShell.Create())
{
powershell.AddCommand("Get-Mailboxdatabasecopystatus");
powershell.AddParameter("identity", databaseName);
powershell.AddCommand("select-object");
var props = new string[] { "name", "status" };
powershell.AddParameter("property", props);
runspace.Open();
powershell.Runspace = runspace;
Collection<PSObject> results = powershell.Invoke();
foreach (PSObject result in results)
{
MessageBox.Show(result.ToString());
}
}
}
|
|
|
|
|
Question: How can I have multiple datareaders writing data in a loop?
Example:
For (int i=0; i<column.count;i++)
{
Step 1:
Run the following query to get datareader values:
select [] Column[i], count(Column[i]) AS COUNT
from <Table Name>
group by [] Column[i]
Step 2:
From the first row of datareader create a string.
}
Expected output when DataReader1 returns 3 rows and DataReader returns 3 rows:
Sample:
--> Row#1 from first dataReader
--> Row#1 from second dataReader
--> Row#2 from first dataReader
--> Row#2 from second dataReader
--> Row#3 from first dataReader
--> Row#3 from second dataReader
modified 16-Jan-15 11:42am.
|
|
|
|
|
If you want multiple DataReaders you will need multiple Commands and Connections as well -- a Connection can have only one active Command executing against it at one time.
|
|
|
|
|
Thanks for your reply.
Can I have a list of SqlConnection, SqlDataReader & SqlCommand?
Eg: List<SqlConnection> SQLConnections = new <SqlConnection>();
|
|
|
|
|
Sure you can, but I recommend making a class that holds a Connection, a Command, and a DataReader -- then make a list of those.
|
|
|
|
|
Thanks a ton..
|
|
|
|
|
I think you're trying to solve a problem that doesn't exist. The DataReader portion of the code is very fast (assuming you aren't overusing .ToString() . The expense is executing the query itself and getting the data back over the wire.
If you want to process the data in different threads, thats a different story. Use ONE DataReader and dump the data into a List. Then use Parallel.ForEach on the List.
|
|
|
|
|
Thanks for the information. If I am not wrong, this command is available for .NET 4 and above.
If yes, then it might not work for me as I am working on 3.5.
Please Advise.
-- modified 16-Jan-15 13:00pm.
|
|
|
|