|
You need to learn SQL first. Once you've done that, you can write a database, and then you can connect to it, and learn how to execute SQL and deal with the results. I'd buy a SQL book and read it, first.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Yeah, I'd suggest a book, can't recommend any though.
|
|
|
|
|
install a mssql,then use it,it's better to practice,
|
|
|
|
|
if you read ADO.Net for comprehensively than automatically u will learn SQL
|
|
|
|
|
Is there a way to find the difference between the two. I see in ADSI EDIT there is a group type, but is that it?
Here is my code which gets ALL the groups.. Which by the way, this works TONS faster than using the AccountManagement from 3.5 way.
Here is the code to get the groups from a single user:
RegistryAccess reg = new RegistryAccess();
PrincipalContext adPrincipalContext;
if (reg.LDAPauth) adPrincipalContext = new PrincipalContext(ContextType.Domain, reg.LDAPpath, reg.LDAPusername, reg.LDAPpassword);
else adPrincipalContext = new PrincipalContext(ContextType.Domain, reg.LDAPpath);
UserPrincipal user = UserPrincipal.FindByIdentity(adPrincipalContext, this.UserName);
PrincipalSearchResult<Principal> results = user.GetAuthorizationGroups();
foreach (Principal result in results)
{
AddListBoxCurrent(result.Name);
}
Now that only returns like 5 for a single user, but using this to get ALL of the groups is faster.. i mean it finishes populating the entire AD groups before populating the listbox with the groups for jsut that user:
try
{
using (DirectoryEntry root = new DirectoryEntry())
{
RegistryAccess reg = new RegistryAccess();
root.Path = "LDAP://" + reg.LDAPpath;
if (reg.LDAPauth)
{
root.Username = reg.LDAPusername;
root.Password = reg.LDAPpassword;
}
using (DirectorySearcher searcher = new DirectorySearcher())
{
searcher.SearchRoot = root;
searcher.SearchScope = SearchScope.Subtree;
searcher.Filter = "(ObjectCategory=group)";
searcher.PropertiesToLoad.Add("name");
searcher.PropertiesToLoad.Add("grouptype");
SearchResultCollection results = searcher.FindAll();
if (results != null)
{
int count = results.Count;
foreach (SearchResult result in results)
{
ResultPropertyCollection props = result.Properties;
foreach (string propName in result.Properties.PropertyNames)
{
if (propName == "name") AddListBoxAvail(props[propName][0].ToString());
}
}
}
searcher.Dispose();
root.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
So my first question is, how do I just get security groups, then just get distribution groups. What I am trying to do is populate a listbox on the left that "The user belongs to" and populate a listbox on the right that has "available security groups". So you can click a button to add or remove groups to that user. But how do I just get "Security groups" for this part, then I'll have another part for Distribution groups?
|
|
|
|
|
hi,
i have a program that receiving inforamtion from a port (SerialPort object).
i am reading the port's information(Stream) from another object by StreamReader like this:
SerialPort port=new SerialPort(.....);
port.NewLine= "\r";
StreamReader sr=new StreamReader(port.BaseStream);
while reading the the stream to the end:
while (!sr.endOfFile)
{
line= sr.readLine();
}
this Method stucks on the last line on the stream.it reads all the Stream except the last line.
But after adding information (Strings) to the stream (from the port).. it continues reading the last line with the new information...
do you know how to solve it?
thank you..
P.S
Maybe..is it something with the sr.NewLine argument?
|
|
|
|
|
Try sr.ReadLine != null in while loop condition.
जय हिंद
|
|
|
|
|
it stucks on readLine. i mean, the processor arrives to this line (line= sr.readline()) and just stop.
even if i add another line to while:
while(!sr.endOffile)
{
line= sr.readline(); <------------it stops here------
messageBox.show("Just string"); the processor do not arrive to this line
}
the processor stops working even if the Stream is not endOfFile. Why?!
P.S
i changed !sr.endofFile to line!=null it is still not working...
|
|
|
|
|
ReadLine doesn't terminate until it encounters a NewLine; try a different method.
|
|
|
|
|
hi all
My Problem is In form1 i have submit button and when i click submit button its open form2 . In form2 i want hide three textboxes , how can i hide three text boxes .but here another problem when i want open form2 i want to three textboxes should be visible , its how ?
Its form 1 link to form2
In form1 button1click
button_click (or) some control
{
this.visible=false;
form2 f2=new form2();
f2.showdialog();
form2.btnclick.visible=false;//this is myproblem cont hide btnclck in form2
this.close();
}
In form2 I cont seting property visile =false any Button.
when i particuar form2 open it should visible button true
pls send me code and ur sugestions .
thanks so much.
modified on Sunday, March 22, 2009 3:07 PM
|
|
|
|
|
pramod2517 wrote: In form2 i want hide three textboxes
pramod2517 wrote: form2 i want to three textboxes should be visible
You want to hide and show the textboxes? Do you think it is possible to show and hide something at same time?
pramod2517 wrote: pls send me code.
No.
pramod2517 wrote: sugestions
1. Rephrase your question. Clearer this time.
2. Try something yourself.
3. Use google.
जय हिंद
|
|
|
|
|
Do you mean that if the form is shown via the Submit Button then the TextBoxes should be hidden, otherwise they should be shown?
If so, add a method to Form2, maybe
public void HideTextBoxes()
{
textBox1.Visible = false;
} and call that method after instanciation but before Show() in your submit button's handler.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
form2 i added this code
public void HideTextBoxes()
{
textBox1.Visible = false;
}
this function can i call in form1
my problem is when i form1 to form2 i want hide form2 buttons or textboxes .
if separate i open form2 textboxes or buttons should visible
i code apply in form1 in submitbutton
form2.textbox1.visible=false;
but here when i click form1 to form2 , in form2 textbox1 visible .
|
|
|
|
|
Use delegates to create communication between forms, then an event in one form, can cause a method to be called in another.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Multiply ways to do this...
-in form2 declare a variable and decide on it's value
set it's value through constructor
-declare properties and user them
|
|
|
|
|
Hey,
I have a device for which I have to install the drivers. For this, I have the required .sys files as also the .inf file.
I wish to have the drivers installed before I plug in my device so that the "Found New Hardware" wizard can be avoided i.e. the device when plugged in for the very first time is recognised by windows and drivers are found installed.
Can anybody please guide me as I have not worked on device drivers earlier ?
Thanking you in anticipation.....
Regards,
modified on Sunday, March 22, 2009 2:30 PM
|
|
|
|
|
If the instructions for the device do not tell you how to do this, I would suggest that you are likely to encounter problems.
Why not just follow the instructions?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i am having a text file of 10*10 integer datas...i am reading and writing into another textfile using readline method...but in this program i did some mistake...i couldn't get the output file with datas...here is the program
private void button1_Click(object sender, EventArgs e)
{
try
{
string path = "c:\\Vicky\\DATAS\\matrix.txt";
string path2 = "c:\\Vicky\\DATAS\\copy.txt";
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
FileStream fs1 = new FileStream(path2, FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs1);
string line;
while ((line = sr.ReadLine()) != null)
{
sw.WriteLine(line);
}
fs.Close();
sr.Close();
fs1.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
" Ella Pugalum iraivan oruvanukkae-A R Rahman "
|
|
|
|
|
That looks like File.Copy("c:\\Vicky\\DATAS\\matrix.txt", "c:\\Vicky\\DATAS\\copy.txt");
Anyway, you're closing the first stream twice. Remove sr.Close();
|
|
|
|
|
|
what is the format of the file?
|
|
|
|
|
.txt format..with full of image intensity values from 0 to 16000
" Ella Pugalum iraivan oruvanukkae-A R Rahman "
|
|
|
|
|
Ok, that's not helping though, what is the actual format?
Something like:
(({decimal string}; )+{newline})*
what does it look like
Seriously, this could be important.. Last modified: 49mins after originally posted --
|
|
|
|
|
You need to close your StreamWriter:
fs.Close();
sr.Close();
fs1.Close();
to:
fs.Close();
sr.Close();
sw.Close();
fs1.Close();
|
|
|
|
|
thanks man....i got it....
" Ella Pugalum iraivan oruvanukkae-A R Rahman "
|
|
|
|