|
Is it possible to use a RowFilter on two fields??
ex: dataView.RowFilter = "Job ='7777' and status = '1'", or something like that.
I can't find anything that works.
thnxs,
|
|
|
|
|
hi,
check property builder
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi,
i've picked up this code (on syncfusion.com) to autosize the heights of a datagrid row.
<br />
public void AutoSizeGrid(DataGrid gridTasks) <br />
<br />
{ <br />
int numRows = ((DataTable)gridTasks.DataSource).Rows.Count; <br />
Graphics g = Graphics.FromHwnd(gridTasks.Handle); <br />
StringFormat sf = new StringFormat(StringFormat.GenericTypographic); <br />
SizeF size; <br />
<br />
MethodInfo mi = gridTasks.GetType().GetMethod("get_DataGridRows", <br />
BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance <br />
| BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); <br />
System.Array dgra = (System.Array)mi.Invoke(gridTasks,null); <br />
<br />
ArrayList DataGridRows = new ArrayList(); <br />
<br />
foreach (object dgrr in dgra) <br />
{ <br />
if (dgrr.ToString().EndsWith("DataGridRelationshipRow")==true) <br />
DataGridRows.Add(dgrr); <br />
} <br />
<br />
for (int i = 0; i < numRows; ++i) <br />
{ <br />
size = g.MeasureString(gridTasks[i,1].ToString(),gridTasks.Font,400,sf); <br />
int h = Convert.ToInt32(size.Height);<br />
h = h + 8; <br />
PropertyInfo pi = DataGridRows[i].GetType().GetProperty("Height"); <br />
pi.SetValue(DataGridRows[i],h,null); <br />
} <br />
g.Dispose(); <br />
}<br />
On the line "int numRows = ((DataTable)gridTasks.DataSource).Rows.Count;" I get the error: "Specified Cast is not valid.
I think there's problem with converting the datasource to a datatable??
I'm quite a beginner in programming. So probably it is something easy, but I can't find out what...
Thanks in advance,
Genius
Genius is 1% inspiration and 99% perspiration
|
|
|
|
|
I insert a TemplateColumn in a DataGrid(dgTest), and using "edit Template"to add a CheckBox,ID = cbx1 in "ItemTemplate" and also add a CheckBox ,ID=cbx2 in HeaderTemplate.
After that, I can use "((CheckBox)dgTest.Items[i].Cells[0].Controls[1]).Checked = true" to set the checked property of cbx1.
but how to set the checked property of cbx2???
I tried as follows,
"CheckBox cb=(CheckBox)dgTest.FindControl("cbx2");"
But it doesn't work.
Is there any other way to set this?
Thank you !
The future will not remember;
The past does not forget!
|
|
|
|
|
"((CheckBox)dgTest.Items[i].Cells[0].Controls[1])" is the cbx1?I think the cbx1 is the Controls[0] of the Cell.then cbx2 is the Controls[1].
or try the following Code:
CheckBox cb=(CheckBox)dgTest.Items[i].Cells[0].FindControl("cbx2");
|
|
|
|
|
I can get the CheckBox_cbx1 by using the following code:
CheckBox cb=(CheckBox)dgTest.Items[i].Cells[0].FindControl("cbx1");
But I can't get cbx2 in the same way.........
I think the key point is : cbx1 is in ItemTemplate ;well ,cbx2 is in HeaderTemplate. And dgTest.Item refers to the rows in DataGrid object but not refers to the Header .
So ,is there some other suggestion ?
The future will not remember;
The past does not forget!
|
|
|
|
|
Hi All,
I have a user Control derived from "System.Windows.Forms.UserControl"
I want to Serialize this but when i try to Serialize it,exception occurs
which reads:
"The type System.Windows.Forms.UserControl in Assembly System.Windows.Forms
...............
is not marked as serializable."
Is it not allowed to serialize UserControl,or is there any other way??
Thanks
TusharM.
|
|
|
|
|
Hello,
Now I am developing a application
1.COM+ have a fuction calling procedure(insert record)2.XMLWEBService have a function calling COM+.
3.The client call XMLWebService to update database.
I would like to the following situation.
-----------------------------------------------------
This client call a method of XMLWebService several times.
This method insert record to database (via COM+).
In this time, database transaction don't commit.
After calling, this call another method of XMLWebService at once.
This method have a roll "commit".
At last, this transaction finished.
-----------------------------------------------------
The transaction attribute of the method called procedure in COM+ set false, and in XMLWebService, I issued ContextUtil.SetComplete(); but transaction was disable.
This case, "As 1 session of XMLWebService several transaction of COM+" is OK by MTS(COM+).
but "As several session of XMLWebService, several transaction of COM+ and 1 commit" is not OK.
If you have some idea, please tell me.
best regards,
yu-yu
|
|
|
|
|
Hi!
I have created one class library in C# with some overloaded functions like,
public void AddColumn(string val){};
public void AddColumn(string val, bool PK){};
I am taking referance of this C# classlibrary in to Visual basic project. Everything is workign fine except, I am able to call only the first overloaded method. If I will try to call the second overloaded method, I am getting run time error like "Invalid procedure call or argument".
Is there any way from which I can call the second overloaded method?
|
|
|
|
|
Hi!
I have created one class library in C# with some overloaded functions like,
public void AddColumn(string val){};
public void AddColumn(string val, bool PK){};
I am taking referance of this C# classlibrary in to Visual basic project. Everything is workign fine except, I am able to call only the first overloaded method. If I will try to call the second overloaded method, I am getting run time error like "Invalid procedure call or argument".
Is there any way from which I can call the second overloaded method?
|
|
|
|
|
I have this long process I'm doing in my application. On my GUI I have a pause button. Now, by problem is, how to make my app just sit there, and not do anything. I've tried these...
while (true)
{
}
while (true)
{
Application.DoEvents();
}
But, they eat up the processor (100%).... Any idea how I can make my app pause where it is??? short of Thread.Sleep(), because this is a single threaded app.
/\ |_ E X E GG
|
|
|
|
|
Why not make a new thread and join it on the main UI thread? You can tell that thread to pause and resume by using Suspend and Resume .
|
|
|
|
|
Oh, the Suspend and Resume look like they work good. But, but calling join on my GUI thread to wait for my worker thread, makes my gui crash out.....
/\ |_ E X E GG
|
|
|
|
|
Make a member variable in this class which can be marked true or false from the Pause button click event.
Your long process would be a series of function calls or calculations. At each logical step check whether bPauseFlag is true, if yes enter a infine loop which does
while(bPauseFlag==true)
{
Thread.Sleep(100);
}
Thread.Sleep is important because unless you do that, the UI paint event processing would hang. You can use Thread.Sleep in single thresded apps. Let me know your feedback.
|
|
|
|
|
I am considering the converting of an existing application to C# but have been a little reserved due to the issue of being able de-compile the code so easily. There are several funtions/algorithms in my existing app that I would like to prevent the competition from being able to reverse engineer.
I have read some on using obfuscators, but I am uncertain if this is the best or only way to secure my code. Even thou the code is made harder to read/research, it appears that the logic, if ... loop ... etc can still be seen. Even if the code is obfuscated, can it be decompiled? Is obfuscation secure enough?
I had also seen where it was recommended to put the code that needs to be the most secure into an unmanaged DLL and then call it from C#. Is this the better approach?
I thought I had heard that Microsoft was going to address the issue of reverse engineering of the code with the release of Visual Studio 2005. If this is true, can someone provide a link for more information.
Also, I know that it is not best practice to place passwords within the compiled code (in any language, especially one that can be de-compile so easily) but if you have a database that is encrypted and shared with several users, what would be recommendations of using a password protected database but not store the password in the compiled code?
I am just trying to get as much information as possible as to what are the best practices. I know that it has been said that no code if 100% safe from being reversed (with enough time and money) but it seems too easy with the available de-compilers.
|
|
|
|
|
Right now, the technology to obfuscate code uses techniques such as name mangling to make it less human readable but still valid IL and therefore same execution. You can still reverse engineer such obfuscation...it just takes another program and a methodology/pattern to turn it back into something more human readible.
For things like passwords and other authentication information you are right. You shouldn't hard code them into the application directly. What you should do is make them a configuration setting or prompt the user at runtime. Hard coding passwords in any runtime environment is like putting your creditials on a sticky note on your monitor. Put that stuff somewhere else.
Beyond all of this, why are you so concerned about reverse engineering? My personal feelings on obfuscation: Don't bother. The .Net Framework is not meant to be a "code obscured" execution platform so don't bother trying. Even "unmanaged" runtimes like C/C++ can be disassembled back into human readable code chunks.
Software is to dynamic and has an incredibly short lifespan. Any commerical application you write today will get dramatically changed to the point of a near re-write in less than a year. Why hold onto old useless code?
|
|
|
|
|
One concern is the scoring routines we use for our product. This is probably the portion of the code that is most concerning.
If I create unmanaged runtimes (Win32 - Delphi) then use a encryption/compression utility, shouldn't it be more secure?
|
|
|
|
|
Then why on earth do them in C# if you already have it in some other form? sounds to me you have too much time on your hands :p
top secret xacc-ide 0.0.1
|
|
|
|
|
Hi friends
Im having a problem regarding the debugging of my Web Based .NET Application.
I want to debug my application on my system (the application is on the server and the VS.NET is also on the server).
Currently i can build it but for running i have to just run in the browser.
F5 or debugging is not working in this case.
On server side all the remote debugging rights have been given and i have been put in Debugger user group.
Please help me in this as im having a great problem in my Web Application.
Any help or pointer is most appreciated
Naveen
|
|
|
|
|
while writing customized control that inherits .Net control (e.g. Treeview control) what is the advantage/disadvantage of having default
constructor and parameterized constructor both?
can we avoid/delete default constructor if everything can be done with parameterized constructor?
Please guide.
|
|
|
|
|
Your basic problem is that the IDE isn't going to generate any code for you that uses a constructor, and if you go changing the code it generates for you to use that constructor, it's likely to delete your code for you. I'd suggest sticking with a default constructor and an initialise method you can call.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
public class ExRichTextBox : System.Windows.Forms.RichTextBox
{
// variable declarations
private ExRichTextBox() : base()
{
// some logic
}
public ExRichTextBox(string _lang, string _projName) : this()
{
// some logic
}
// public and private methods
}
is it advisable?
please guide
|
|
|
|
|
Yes, but as Christian said, it wont work in the designer anymore... (does any real coder use the designer anyways? )
top secret xacc-ide 0.0.1
|
|
|
|
|
leppie wrote:
does any real coder use the designer anyways?
LOL - do you lay out GUI's by trial and error ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
LOL - do you lay out GUI's by trial and error ?
No, I normally think about it 1st...
top secret xacc-ide 0.0.1
|
|
|
|