|
|
thank you abhijit for ur earliest response.I will go thorugh it.
|
|
|
|
|
thanks, and if u will get any another solu~n let me know
Happy Programming
-----
Abhijit
|
|
|
|
|
Hello,
I am having one private field which is encapsulated in public property.
As i can modify the field using the variable itself with in the class and through property outside the class.
Here the question is how should i modify the field....????
1)Through the property always, within the class or outside the class.
OR
2)Field within the class and use property outside the class.
I am agree with the 1st point because it increase the developers readabilty and easy to maintain.
Other side is the performance.. If i directly modify the variable, i am reducing one call which might give better efficiency.
So what is the better way???
|
|
|
|
|
What if u have million and million of code
at run time when u want to set/get value from inside u'll pass THRU the Property
(why go THRU a baypass) where u can go directly.
inside the class use the private field THUS escaping the :
get { return myVale };
this is a code line u escape in run time
the return itslef has it's own code like (go to the value ....)
kobkob
|
|
|
|
|
If you want to access the internal value, use the variable. If you want to access the value as it would be accessed outside the class, use the property.
gajesh wrote: If i directly modify the variable, i am reducing one call which might give better efficiency.
If the code for the property is simple, it will be inlined where you use it, and optimised down to just accessing the internal variable. So in most cases there is no difference in performance between using the property and using the variable.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
HI,
i'm looking for some sort of template that goes like this :
when my app start's :
private void Form1_Load(object sender, EventArgs e)
{
1.load data from "dData.mdb" (using odbc)
2. store data in some sort of a Collection (DataSet, ArrayList...
what ever it does not make any diff)
}
That's all (i know it's not simple)
if any one can give me alink, maybe a pdf toturial, etc..
THNKS in advance
kobkob, Have A Wonderfull Day
|
|
|
|
|
|
first THNKS
but, can i escape the : DbCommand.CommandText = "SELECT * FROM NATION"; ?
i want it load each and every table from the db
kobkob
|
|
|
|
|
using CommandText you have to speccify the command that you want to execute.
If u dont want to use CommadText , then while creating command you have to pass the query as argument
e.g
Sqlcommand cmd=new Sqlcommand(yourQstring,connection)
and if you want to read all table at time, u can use join operation
like select * from nation,state where nation.id=state.id
[ asume those id are equal]
Happy Programming
-----
Abhijit
|
|
|
|
|
what i ment was that i have like 50 tables, O.K?
and i want them all using a for or foreach.
and automaticlly store them to a dataSet or any kind of Object i've created.
kobkob
|
|
|
|
|
Then try to read the all table name and pass as argument to the query
e.g
string s= select * from + tablename ;
dbcommand.Text=s;
create a object of database and read the table !!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
hey,
check ur latest post in this forum and let me know when done !!!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
any reason why you use ODBC and not OleDb?
V.
No hurries, no worries
|
|
|
|
|
Yes
What if i move the file?
the string of the path is not valid any more.
ODBC is a driver it knows "where" the file is.
kobkob
|
|
|
|
|
Why would you 'move' the file?
And besides, I could be wrong on this one, I never work with ODBC if I can avoid it, don't you need to add the database in the ODBC datasources of windows? In fact, your DSN is nothing more then a name corresponding to a path.
kobibi wrote: ODBC is a driver
And what is OleDb you think? A fluffy bunny rabbit ?? (lol, it was joke ), seriously OleDb is much faster then ODBC.
Note: There is nothing wrong with ODBC..., it's just old
|
|
|
|
|
O.K
So if i'll use the OleDb how can i get all of my tables from ".mdb"?
and the important thing is maybe some IDIOT will move the file
how can i handle that?
kobkob
|
|
|
|
|
Same principle as ODBC, you need a connection string:
This[^] might be helpful?
You can check if the file exists, I think with the File or FileObject classes, which has a property or method FileExists...
good luck.
|
|
|
|
|
and another Q
if i'm using the bindingSource
will it the do the work for me???
kobkob
|
|
|
|
|
kobibi wrote: bindingSource
The what now?
|
|
|
|
|
Never mind
Last Q cause "i'm going slitly mad" (not angry but nutty )
i realy did not get how to read 50 tables from a datbase
i've got this :
OdbcConnection dbCon = new OdbcConnection("DSN=myData");
dbCon.Open();
now what?
it goes somthing like this ?
OdbcCommand dbcom = new OdbcCommand("",dbCon);
but OdbcCommand("",dbCon);
OdbcDataReader dbRdr = dbcom.ExecuteReader();
while (dbRdr.Read())
{
}
OdbcCommand("",dbCon); needs SQL Query
and i do not want to write any SQL Q only to build a DataSet
and to fiil it with all of the tables from the file
maybe if can give me code in OleBd would be fine too
sorry for confusing u, i'm still learning
kobkob
|
|
|
|
|
i have post ur sollution , check it
Happy Programming
-----
Abhijit
|
|
|
|
|
I'm not sure if it is possible to do selects without select statements.
like the OdbcConnection there is a class OleDbConnection, look it up in MSDN.
First you open up the connection and pass a SQL to the OleDbDataAdapter that can fill a DataSet or DataReader .
There are plenty of examples on the net.
Seeing your questions I actually advice you to buy a good book though. I also tried to learn ADO.Net via the internet, but it wasn't until I read a book I got a more or less clear view of it.
good luck.
|
|
|
|
|
I dont have any clue about sending attacments, i refer MSDN & its having help for asp via internet, but i am not using internet as medium.
Does it depends on medium to send attachments?
I want to send files as attachments over wireless & in LAN thru s/w.
files can be of any extension.
So plz tell me what should i do or follow.
thanks & regards,
humdum.
|
|
|
|
|
Hi, I have to copy data from acces database to sql2000 database.
i declare access connection,adpator,dataset,table in loedb. now what evere data comes into dataset of particular table , i want that table value should update into sql2000 db. i made all db in sql. if any one has solution pls reply.
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|