|
Hi All,
Can any one tell that how do we get the HostedControl of cell, for example in case of DataGridViewButtonColumn
for example i want to get
of (DataGridViewButtonColumn)dxDataGridView1.CurrentCell.HostedControl
is there anything like HostedControl???
Thanx
sorry for my bad English.
|
|
|
|
|
when i use oledb connection with following connectionstring, i can connect to SQL SERVER named DOCTOR
"Provider=SQLOLEDB.1ersist Security Info=False;User ID=SA;Initial Catalog=LASEREPI;Data Source=DOCTOR"
but when i use SQLCLIENT.SQLCONNECTION with following string, i cant connect what is missing?:S
This string works on Server client.but Doesnt work at remote clients.
"Persist Security Info=False;User ID=SA;Initial Catalog=LASEREPI;Data Source=DOCTOR"
-- modified at 9:08 Friday 25th August, 2006
|
|
|
|
|
It's difficult to compare teh two strings because you have so many typos and missing elements.
only two letters away from being an asset
|
|
|
|
|
|
For example?!? Look at your posting, are they both complete connection strings? Can you copy and paste them and actually get them to work?
only two letters away from being an asset
|
|
|
|
|
How do I add columns names to a data grid in c#?
Thanks
|
|
|
|
|
this.dataGridView1.Columns.Add("ColumnName", "ColumnHeaderTitle");
|
|
|
|
|
Do using of so many try-catch block in a project degrade the performance of Project. To be clearer do try catch consume more memory.
Vipin
|
|
|
|
|
Yes, Try catch is expensive in memmory usage, especially if used frequently.
|
|
|
|
|
Do you know some article which gives a bit details in this regard?
Best Regards,
Apurva Kaushal
|
|
|
|
|
|
Thanks man..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Using a try-catch block is not expensive, but when an exception is raised, there is a performance hit.
Use try-catch for anything that potentially can go wrong, but don't use it for normal program flow. If you for an example have a string that sometimes contains a number, it's better to check the contents of the string before converting it than to use a try-catch to handle the times when it doesn't contain a number.
---
b { font-weight: normal; }
|
|
|
|
|
Thank u so much for the information.
Vipin
|
|
|
|
|
Guffa wrote: If you for an example have a string that sometimes contains a number, it's better to check the contents of the string before converting it than to use a try-catch to handle the times when it doesn't contain a number.
In these cases, you should really look at the TryParse methods. .NET 1.1 only had a few of these, but they have been expanded in .NET 2.0 to be included in more of the basic data types.
|
|
|
|
|
Using try/catch, try/finally, and try/catch/finally blocks are only expensive when an exception occurs. At that point, the runtime has to take a lot of steps to unwind all of the catch handlers to see who should respond to the exception.
Exceptions should only be thrown when something goes wrong, not to help control program flow. If you use them to try and control program flow, then it gets expensive (not to mention it's just bad practice).
Incidentally, if you have any using blocks
using (MemoryStream stream = new MemoryStream())
{
// do some work here
}
you are implicitly using a try/finally block. The C# compiler will automatically turn this into
MemoryStream stream = new MemoryStream();
try
{
// do some work here
}
finally
{
if (stream != null)
{
((IDisposable)stream).Dispose();
}
}
|
|
|
|
|
I would like to know how to loop the values of int of a single column of a datagrid (windows forms) and sum them. C#
|
|
|
|
|
Hope that this will help.
CurrencyManager cm = (CurrencyManager)grid.BindingContext[grid.DataSource,grid.DataMember];<br />
int numRows = cm.Count ;<br />
DataView dv = (DataView)cm.List ;<br />
<br />
string cols=string.Empty ;<br />
for(int i = 0 ; i < cm.Count ; i++)<br />
{<br />
<br />
}
sorry for my bad English.
|
|
|
|
|
I've managed to do it myself but anyway thanks very much
P.S. sorry for my English too.
choopie
|
|
|
|
|
You are welcome.
sorry for my bad English.
|
|
|
|
|
Hello,
i'm working on a program to test the access of a certain user on a folder.
I user an existing class that i found on this site but i need to give an object of the WindowsIdentity class. I can test it on my own as logged in user but i need also be able to check on other users. Is there a way to make WindowsIdentity objects by the name or SID of the user (or NtAccount)? Or any other way to make a WindowsIdentity object for a user?
I'm already searching for this for a long time for this but have not found a solution yet.
Kind regards,
Frederik
Hope someone could help me
|
|
|
|
|
I think there is only one way. Read this:
http://support.microsoft.com/kb/180548/
Just compile it and use it in C# using DllImport.
|
|
|
|
|
The extract of my previous question: how to set read-only properties of the Outklook.PostItem object, exactly SenderName and ReceivedTime? (I devdelop outlook 2003 add-in in c#)
I found one way - http://www.outlookcode.com/codedetail.aspx?id=1112, but ot works incorrectly when i'm trying to set PR_SENDER_NAME.
May be other PR_ properties? Or, maybe, over way at all?
|
|
|
|
|
hello every one,
well I'm working on making a master detail form here. I've binded the data correctly and now I want to add the update, del, and insert new record functionality to the detail form. I'm using .net 2.0 C# and I'm working in windows Forms. I've used DataGridView class to display the detail data information.
For saving the record, I wanted to cast the datasource of DataGridView into a datatable first and then use it to iterate thru the data but it returns a null so I get the nullreferenceException. Plz tell me how to iterate thru the detail table here.
I actually deleted a few columns from the detail table ;like the PK columns and Foreign Key columns coz the user doesnt need to see those. But I do wanna have access to those esp when updatin the record. So what can I do.
if its possible plz give me a sample code or application if u can.
thanks in advance...
Rocky
|
|
|
|
|
You have to add both the tables in a dataset and then add realtionship to the priamry and foreign keys of these tables in DataSet.Relations.
2nd thing, dont delete those colunms, just make them invisble to user or make them read only.
sorry for my bad English.
|
|
|
|