|
Hello,
How you solve the problem, or if you solve it at all is just a matter of preference. It is indeed tedious to write and it obfuscates your statements. My advice is to create a wrapper class that wraps a row of your database. This can be a simple replacement around the long prefex:
public class SomeWrapper
{
public object GetCol(string colName)
{ return ObjDataSet.Tables[0].Rows[index]["SomeCol"]; }
}
Or the wrapper can be a more sophisticated using properties and the like. You can use the wrapper the following way:
SomeWrapper row = new SomeWrapper(ObjDataSet.Tables[0].Rows[index]);
if( row.GetCol("column...").Equals("SomeValue) )
{
// your logic
}
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
There is definitely more than one way to skin the proverbial cat.
My take is create a named data set. The when you fill the adapter you are referring to a table and row such as MyTable.AccountNumber[i] instead of Tables[0].Rows[....]
If you have signaficant converion between the dataset and the deseried representation in variables then a custom data set make not fit so well. You might be better off dealing with the generic data set.
But again I would rather define an Interface with the constants you need to manage the generic data set. Then you can refer to logical index names instead the hard coded table, row or column names.
Finally when should you copy the data set to a private data store? Well if the data set is humongous and you are only using a small portion that has to be converted and used by other .CS classes and modules, then it makes sense. Particularly if
If you are copying the data set and using the variables all with one class the need is dubious. It is definitely "overhead" to copy a bunch of variables so if you can find a way to directly operate on the data perhaps via a Named Data Set or through an Interface, then your app can drive directly off the data w/o the intermmediate cyles.
Good Luck
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
How can I Show/Hide Quick Launch Toolbar from my C# Application. If someone have written the code for it then Please send me.
-- modified at 2:43 Wednesday 22nd March, 2006
|
|
|
|
|
|
BUt I just want to show/hide Quick Launch bar as it happens in
TaskBar(Right Click)-->Toobar-->Quick LaunchBar.
Id you have some idea about that then please mail me.
|
|
|
|
|
I'm trying something new...
I'm using Visual Studio 2005 and I have an application that uses a combo box, a datagrid and a report viewer. Here's my brain fart...
I want to use the combobox to select a company and from that selection, the datagrid populates with only the details from an sql database that is linked to the company id field in the combobox.
Problem: How do I build the datagrid that allows me to select certain rows to send to a report. I know this may seem like a tall order but I'm just have a major creative block! Any help would be greatly appreciated.
Regards.
JB
|
|
|
|
|
I am developing windows application to add "Outlook Contacts" to data base. I need to provide option for choosing contacts folder.
I need sample code (or idea ) for displaying outlook contacts folders and extracting contacts from selected folder
Thanks in advance
Ram
|
|
|
|
|
Hello I am writing a program that contains a class, the class needs to determine the directory of the program in order to save a file in the same directory as the .exe file. what do i need to do to get put the file im writing in the same directory as the exe.
|
|
|
|
|
Use Application.StatupPath;
|
|
|
|
|
Use Application.StartupPath Property - the property returns the path for the executable file that started the application, not including the executable name.
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hello fellows.
I'm using NHibernate for the first time. I'm trying to create a new NHibernate.Cfg.Configuration object, and it is throwing me a FileNotFoundException. Why would that be? Don't get it...
The code I'm writing is within a DLL, and hence does not have an app.config file. I was hoping to use an ADO connection rather than the app.config file. Any suggestions, comments?
Thanks in advance, any suggestion will be really appreciated.
Regards,
Fernando.
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
|
|
|
|
|
can i access Nokia 3330 by the help of C#,if yes what are the steps?
rana zeeshan
|
|
|
|
|
The 3330 is a low end, 2G phone with no frills per se. It does not support Java or Bluetooth it definitely rules out C#. About the only thing you could hope to do is read the event stream when you plug in the USB adapter (provided it has one for Outlook synchronization). Even there C# would not be a good choice, you would be working primarily in unmanaged code.
What is it you are trying to accomplish anyway?
Mike Luster
CTI/IVR/Telephony SME
|
|
|
|
|
hello,
I thought Visual C# Express 2005 was the only editor for C# windows development. But today I found Borland also has C# editor, and moreover Visual Studio 2005 professional is also another option. Can anyone tell me, which one is the most developer friendly and much rich featured !!
|
|
|
|
|
I've never used borlands, but VS05 Pro+ are all a "shinyer" version of the editor in 05Express.
|
|
|
|
|
hi,
thanks for the reply. Can u show me a link where it describes the extra features of Visual Studio 2005 Pro which is not available in Express version !
|
|
|
|
|
emran834 wrote: Can u show me a link where it describes the extra features of Visual Studio 2005 Pro which is not available in Express version !
You'll find it somewhere on MSDN[^].
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
SharpDevelop[^]
You might give SharpDevelop a try. It is an excellent IDE.
|
|
|
|
|
Why would sharp develop be a popular IDE when C# express is free? Are there some features it has that it has that C# Express does not?
|
|
|
|
|
Sean89 wrote:
Why would sharp develop be a popular IDE when C# express is free? Are there some features it has that it has that C# Express does not?
Two words: source code[^].
Share and enjoy.
Sean
|
|
|
|
|
Go Borland it is the one and only finest IDE in the Globe !!!!
Ahmad Shaban
|
|
|
|
|
|
|
How can i get the message which was send by another computer. (netsend)
This message is always shown in such a terrible looking screen. How can I put the arrival message into a myself programmed screen??
Richie
-- modified at 14:37 Tuesday 21st March, 2006
|
|
|
|
|
hi, can any body help me out for serial communication using rs232 standard in c#
|
|
|
|