|
I realy dont know where to find some help ....
|
|
|
|
|
I'm new to Active Directory and Directory services and thought I try something simple to begin with. I have the following code:
using System;
using System.Collections;
using System.DirectoryServices;
namespace ConsoleApplication1
{
///
/// Summary description for Class1.
///
class Class1
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
DirectoryEntry de = new DirectoryEntry();
Console.WriteLine(de.Path);
DirectoryEntries des = de.Children;
foreach(DirectoryEntry entry in des)
{
Console.WriteLine(" Child: " + entry.Name);
}
}
}
}
which sometimes generates the required output and other time gives me the following error:-
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in system.directoryservices.dll
Additional Information: The specified domain either does not exist or could not be contacted.
Has anyone any clues as to what is causing this intermittent error and how to fix it.
|
|
|
|
|
Hello,
You have to set the Path Property by yourself.
For this reason you can use the Constructor with string Parameter.
string path = @"C:\";
DirectoryEntry de = new DirectoryEntry(path);
All the best,
Martin
|
|
|
|
|
I am trying to set the height and width of my main form programaticaly. What is the syntax for doing this?
|
|
|
|
|
Form1 f = new Form1();
f.Size = new Size(100,200);
or
f.height = 200;
f.width = 100;
|
|
|
|
|
this.Size = new System.Drawing.Size(xxx, yyy);
All the best,
Martin
|
|
|
|
|
Thank you very much. This syntax works perfectly.
|
|
|
|
|
|
public Answers GetAnswers()<br />
{<br />
return Search(Question);<br />
}<br />
|
|
|
|
|
|
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
|
|
|
|
|
Thats not my homework I am trying to learn web services but unable to understand it and even not able to execute it thats why u asked for help.
|
|
|
|
|
Hi,
I'm using the DataGridView in c#.NET 2.0 The DataSource is a Generic List
of a custom class0: lstMyPersonnes = New List(Of clsPersonne).
When I add a new clsPersonne to lstMyPersonnes, and rebind the
lstMyPersonnes to my DataGridView.dataSource, it shows the new record in
the DataGridView as it should be.
But when I click on a cell of that row, I suddenly got this error: "Index -1
does not have a value"...
Does anybody has any idea how to get around this problem?
Thanks a lot in advance,
john
|
|
|
|
|
Firstly ,did you add event this datagridview?For example,if you add a combobox colomn and add an event ,whenever you click a button or any cell in this row and then event will be occur.when you click cell header ,this event return -1 .If you describe your fault in detay ,anybody can help you about your problem...
|
|
|
|
|
I am re-writting a powerbuilder application in C#. I need a code that perform FTP. Where can I get it.
|
|
|
|
|
Please at least try to use the search function: ftp[^].
|
|
|
|
|
If you are working in .Net 2.0 then see FtpClient class in MSDN. It's very easy to work with a few lines
Cheers!!!
|
|
|
|
|
the company I work wants to use NHibernate as a OR mapper. I know nothing about it. The application will be a rewrite of a web solution using C#.
I've read that there is not much good documentation. Is this true?
Where could I get a simple sample app?
Any help suggestions is apprecriated!
|
|
|
|
|
Google is your friend.
The second hit in this search[^] will help you.
|
|
|
|
|
Hi guys,
I have an application that uses a few tables and a few store procedure for it's functioning. Is there any way I can automate creation of these tables and store procedures within my application by directing it to a certain database on SQL server?
Please advice.
sasa
|
|
|
|
|
If the database already exists you can always connect to it and run your table and stored proc creation scripts with ExecuteNonQuery.
|
|
|
|
|
Got it, thank you very much
sasa
|
|
|
|
|
say you have
create procedure dbo.GetUsers
@Enabled bit
as
select * from tUsers where enabled = @Enabled
now that above code can be set as the command text and which ever database you set as the intial db will have this code executed and a stored procedure call GetUsers will be created.
So if you create a function that loads an .Sql file and reads it, then tells the sqlcommand to execute the code returned from the sql file, which ever database you set as the intial database will have a new table or stored procedure.
Gav
|
|
|
|
|
Hi.i am try to write update statement using classes but it always gives me an error and use this on my form.i did something like this.
public class Update
{
string empname = "";
public Update()
{
//
// TODO: Add constructor logic here
//
}
public void updateEmployee(string empname1)
{
empname = empname1;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "integrated security=SSPI;initial catalog=Employee;server = za211149;persist security info=False";
conn.Open();
try
{
SqlCommand UpdateEmp = new SqlCommand();
UpdateEmp.Connection = conn;
UpdateEmp.CommandText = "UPDATE jakes";
UpdateEmp.Parameters.Add(new SqlParameter("@empname",System.Data.SqlDbType.VarChar,50,empname));
UpdateEmp.Parameters["@empname"].Value = this.empname.ToString();
if(UpdateEmp.ExecuteNonQuery()==1)
{
MessageBox.Show("record updated");
}
else
{
MessageBox.Show("record not updated");
}
}
catch
{
MessageBox.Show("o a gafa");
}
finally
{
conn.Close();
}
}
-- modified at 9:03 Wednesday 19th July, 2006
|
|
|
|
|
You don't have a proper UPDATE statement. It should be in the form
UPDATE jakes SET [field_name] = @empname
Remember to have a where clause also, unless you want all records updated with this value.
WHERE id = @id
|
|
|
|