|
hi...
what your thinking is rite.....
If the DataRow that is passed as a parameter is in a detached state, it is ignored, and no exception is thrown while importing the datarow...
Regards,
Sandeep Kumar.V
|
|
|
|
|
okay... then how do i get my desired result?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
I think instead of using
DataRow[] filteredRowsArray = table.Select(filterString);
and adding the above row to another table. You should use
DataView objdv = table.DefaultView;
and then Use objdv.RowFilter = filterstring.
It is more easy and fast compared to your above steps.
You can get more example on codeproject and google on it.
I think it will help u and may solve ur problem.
Sarvesh Upadhyay
Senior Software Engineer
Birlasoft India Ltd.
Microsoft Certified Professional Developer in Dotnet 2.0 Enterprise Application
|
|
|
|
|
Hey sarvesh
i came across the DataView class just after i posted my messages and did infact use it the way you just said and it worked
im gona try and use multiple conditions in the filterstring today, ill leave a post if i get stuck again
thanx for the reply...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hello,
Do someone can tell me what are the inconvenients of the method Application.DoEvents()
regards,
dghdfghdfghdfghdgh
|
|
|
|
|
It works well if your application only does one thing, but for more complex situations you may need the application to handle more than one operation at a time.
If you for example have two buttons in your application, and each button starts some kind of job and waits for the result, it doesn't work properly if you use a loop to wait for each job to finish with a DoEvents in the loop.
You can start both jobs, but when you start the second job, the waiting loop for the first job is paused, as the waiting loop for the second job is running in an event handler started by the DoEvents call inside the first loop. Therefore you will not see the result of the first job before the second job finishes.
A situation like that is typically handled using a timer instead.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
While debugging a c#.net project in vs2003, i am making changes in code but its not reflecting in application.
So, i delete the contents of debug & release folder presents inside bin folder.I read about this in this from few weeks back, to delete those contents.
Now after doing this when i rebuild the solution its giving error "post build event failed". So i checked with previous copy of solution And copies AfterBuild.Bat & PostBuildEvent.bat files from there, & it runs.
My question is:
->what information these files have in them?
->If VS builds them, then why files not get rebuild if i deleted them?
->Is copieng thme from previous solution is good idea?
|
|
|
|
|
I start a service on logon(written in C#.net). This service starts another process. My application has an interface with allows administrators to restart the service. However, when this service is restarted, it kills the child process launched from it. I want the child process to be alive even when the service is stopped on windows 2000. This issue exists only on windows 2000 by design.
Can any one help me out in this?
|
|
|
|
|
pranu_13 wrote: This issue exists only on windows 2000 by design.
That's the answer. If it's by design, I think it's not possible to work-around it.
|
|
|
|
|
public class a
{
public int i = 0;
}
public class b:a
{
public int i = 2;
b bb = new b();
// bb.i is 2
how should i access the value of i of class a through object b
}
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Are you not getting a warning when you build the code?
You can access variable i of class a using
base.i
|
|
|
|
|
You can use as , for instance
bb = new b();
Console.Writeln((bb as a).i);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks for the Reply...
how can i use the bixing concept in this case ?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
As usual.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
This has nothing to do with late binding. Late binding is when you create an object where the class of the object is determined at runtime.
To properly declare a member that hides the member in the base class, you use the new keyword:
public class a {
public int i = 0;
}
public class b : a {
public new int i = 2;
}
The new keyword tells the compiler that the hiding was intentional, so that it doesn't produce a warning.
To access the hidden member, you just have to cast the reference into the class a:
b bb = new b();
a aa = bb;
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i'm looking for some articles for editing gpedit.msc. i looking for much detailed articles
thank you...
|
|
|
|
|
|
Using .NET v. 1.1. Trying to implement a method that would insert rows from DataSet.Table[0] to an exsisting, empty database table which has identical structure. In my case the data of DataSet is fetched from SqlServer and inserted to SolidServer. With the following code the job gets done, but i'm wondering whether there is a more efficient way to do it?
With the code listed below, inserting e.g. 10 000 rows takes about 30 seconds and that's too slow for my purposes.
public void UpdateData(OdbcConnection connConnection, DataSet dsTmp, string strTable) {
OdbcCommandBuilder CommandBuilder = null;
OdbcDataAdapter daAdapter = null;
OdbcTransaction trans = null;
try {
trans = connConnection.BeginTransaction(IsolationLevel.Serializable);
daAdapter = new OdbcDataAdapter();
daAdapter.SelectCommand = new OdbcCommand("SELECT * FROM " + strTable, connConnection, trans);
CommandBuilder = new OdbcCommandBuilder(daAdapter);
daAdapter.UpdateCommand = CommandBuilder.GetInsertCommand();
daAdapter.Update(dsTmp);
trans.Commit();
}
catch (System.Exception ex) {
throw ex;
}
}
|
|
|
|
|
Unless you can find an ADO.Net driver for SolidServer, you're stuck with ODBC. I did a quick search for it and didn't find anything. Mind you, I've never worked with SolidServer.
Depending on your application, you might just want to fire off a background thread to process the database update so the user doesn't sit and wait (the assumption being that it's a UI app update).
|
|
|
|
|
hello,
I'm dying here, trying to implement an ITemplate class. What I'm after is to dynamically build a listview itemtemplate with a number of labels. Has anyone managed to do this?
Best,
Morten
|
|
|
|
|
Hi,
I am having one content page, Menu on Masterpage and details on content page. Menu strings will be taken from database. Now what happens whenever I click any menu, automatically my master page get loaded and the menu string also taken from database. I don't want it to be taken up always from database, I need some way to preserve it in master page itself.
Any Luck.
Be simple and Be sample.
|
|
|
|
|
You should look into caching the data from the database. Take a look a the caching page directive. If you're referring to the page refresh, you could look into ajax to avoid unnecessary page refreshing.
|
|
|
|
|
Hi, I need to use a PropertyGrid to display various properties and allow the user to change the values.
The first problem is that I've never worked with a PropertyGrid before and after searching for tutorials and experimenting on my own, I still have no clue.
Almost all tutorials I found were about modified versions of the PropertyGrid that require you to already know how to use the standard version, which obviously doesn't help me.
The second problem is that at runtime I don't know anything about the attibutes.
I neither know the name, the type, the category, the description nor the value.
Is there a way to dynamically add a collection of properties to a PropertyGrid and have it determine the necessary attributes (such as category and name) at runtime?
Thanks in advance.
|
|
|
|
|
Megidolaon,
Just assign:
propertyGrid1.SelectedObject = theClassYouWantToView
MSDN[^]
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
It's not that simple.
I have a class called Task which has List of TaskParameter objects.
Each TaskParameter object has the properties "Name", "Type" and "Value".
"Name" should be displayed as the name of a property in the grid, "Type" I want to use to validate the user input and "Value" is the value of Parameter.
The amount of Parameters, their names, types, values, categories and description must be dynamiccally assignable because they change from Task to Task and the Tasks (the Tasks are also subject to change at runtime so I can't just create a different class for each Task).
Is there a way to create a class that allows me to dynamically assign names, types, values, categories and description (readonly and browsable are secondary, it's assumed all properties that are in the TaskParameter collection are browsable and assignable by the user) for a property at runtime and also displays a whole collection of them at once?
So far the only noteworthy results I had when using only a single TaskParameter object and when I used an array created from the TaskParameter List of the Task class, it only displays the "Name", "Type" and "Value" properties but without any descriptions, defaults or anything else.
|
|
|
|