|
Please tell me the difference of...OLEDB vs SQLClient..which one is better and why?
Sujit
|
|
|
|
|
SqlClient is optimized for SQL Server, so if you're using SQL Server (and you should) use SqlClient.
Use OleDb if you're using Access (you shouldn't).
MySql, Oracle, and Ingres (and others?) have their own classes, use them as appropriate.
Now stop cross-posting.
|
|
|
|
|
plz tell why i will use SQLClient..what is the advantage of SQLClient..i want to know ths?
Thanks in advance.
Sujit
|
|
|
|
|
HI Friends,
I am trying to match the value from database with checkbox list items and if matched I want to check the checkbox:
if(chklstGroups.Items[i].ToString() == objGroups.Title)
{
chklstGroups.SetItemChecked(i,true); // Method 1 -- Generates Error
chklstGroups.SelectedValue = i; // Method 2 -- No Error but no result.
chklstGroups.SetSelected(i,true); // Method 3 -- No Error but no result.
break;
}
Please help me if you know the solution.
Regards,
Sushant Duggal.
|
|
|
|
|
Wouldn't it be something like:
chklstGroups.Items[i].Checked=true; ?
The day has been too long, I've spent frittered too much time on here today, I need sleep.
-- modified at 2:25 Thursday 3rd May, 2007
This worked for me:
this.checkedListBox1.SetItemChecked(0,true) ;
|
|
|
|
|
Sushant Duggal wrote: chklstGroups.SetItemChecked(i,true); // Method 1 -- Generates Error
What sort of error?
-- modified at 2:41 Thursday 3rd May, 2007
More information required.
|
|
|
|
|
Object reference not set.
Sushant Duggal.
|
|
|
|
|
Then I suppose your chklstGroups hasn't been set.
Show more of the code.
|
|
|
|
|
Use debugger to check whether the "if" statement evaluates to true
by creating breakpoint at a line inside the if block.
Regards,
Arun Kumar.A
|
|
|
|
|
I no longer use CheckedListBox es, I use TreeView s that look like CheckedListBox es; they're much more advanced.
|
|
|
|
|
try this:
if( (objGroups.Title != null || objGroups.Title != DBNull) && chklstGroups.Items[i].ToString() == objGroups.Title.ToString())
{
chklstGroups.SetItemChecked(i,true); // Method 1 -- Generates Error
chklstGroups.SelectedValue = i; // Method 2 -- No Error but no result.
chklstGroups.SetSelected(i,true); // Method 3 -- No Error but no result.
break;
}
Hope it helps...
|
|
|
|
|
Hi,
For a folder i have to set the permission as full control by programmatically,im using C#.Net 2003,How can i accomplish this one,plz help me..
Rgrds
Kanna..
|
|
|
|
|
Try the following.
//Add these namespaces to your page.
using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;
//Put this code in either Page_Load or any other function
string DirectoryName = @"C:\Test"; //Make sure the directory exists.
string Account = @"Domain\username"; //Replace it with your Domain Name and User Name.
DirectoryInfo dInfo = new DirectoryInfo(DirectoryName);
DirectorySecurity dSecurity = dInfo.GetAccessControl();
dSecurity.AddAccessRule(new FileSystemAccessRule(Account, FileSystemRights.FullControl, AccessControlType.Allow));
dInfo.SetAccessControl(dSecurity);
Hope it helps!
Pranav
|
|
|
|
|
Hi,
Thanks for your reply..But i couln't get this namespace
using System.Security.AccessControl;
Is i want to refer any namespaces for this one?im using framework version is 1.1.4322,for this which namespaces i have to refer..plz tell me..
rgrds
Kanna..
|
|
|
|
|
This namespace is specific to .Net 2.0
I will try to write code which works for 1.1.
Thanks,
Pranav
|
|
|
|
|
Thanks for your reply,im searching this code for last one weekbut i couldn't get it,if u give means it will be very helpfull to me..
regards
Kanna..
|
|
|
|
|
Hi,
How can i limit the bandwidth for a webrequest using Httpwebrequst.
If i am having network connection say 100Mbps, if i want to limit the
bandwidth to 75MBPs, How can i do this in WebRequest.
With Thanks,
Sakthi.
|
|
|
|
|
You can't. There is no facility to do this anywhere in the .NET Framework. You'd have to write your own network stack to control this, or use a proxy server that offers this functionality.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
It is Possible to Call Windows API Functions in C#. If yes, Please Post some examples
Mohan Balal
|
|
|
|
|
www.pinvoke.net[^]
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi CLRers,
I have one doubt regarding usage of the reflection to get the
private member variables. In one of my assembly through reflection
i am getting private member variables in the same assembly classes.Client can change the Code Access policy to restrict the private member variable right?
Client can only restrict to accessing only private members or any members can restrict?.
if yes than what is the use of reflection...
So usage of reflection in projects how much safe .......? and Reflection is usefull in Unit test drivers only or wht?
Please help in this regard ....
Urs ..
Kiran Kumar Singani
The Dream is not what you see in sleep........Dream is the thing which does not let you sleep
|
|
|
|
|
Have look at NUnit source code 
|
|
|
|
|
Still it is not answered my question...
Through reflection how much safe to access private members ?
It is violating OOPs concepts..
Regards,
Kiran Kumar Singani
|
|
|
|
|
It is not safe because you try to access methods at run time using "reflection".
Use SecurityPermissionAttributes on your private methods for which you want to access.
What is the reason behind accessing a private mthod. Do it public then.
As a design rule, make things non-punlic if you don't neeed them or if you want to secure them.
Have alook at .NET Reflector tool which disassembles any .NET assembly to it's original source code using reflection including of course the private ones. Which means you can access but this tool also shows how unsecure your private methods are. To call these methods, I've not tried actually but as I said, try to make them internal or private and add SecurityAttributes to ptotect.
Hope this helps...
|
|
|
|
|
How can i create a object of a class....if the constructor of that class is private??
Thanks
|
|
|
|