Click here to Skip to main content
15,892,746 members
Home / Discussions / Database
   

Database

 
AnswerRe: in a stored procedure, can I directly write some lines to a txt file? Pin
goodideadave30-Jul-08 13:10
goodideadave30-Jul-08 13:10 
AnswerRe: in a stored procedure, can I directly write some lines to a txt file? Pin
SimulationofSai30-Jul-08 19:24
SimulationofSai30-Jul-08 19:24 
AnswerRe: in a stored procedure, can I directly write some lines to a txt file? Pin
Vimalsoft(Pty) Ltd30-Jul-08 20:59
professionalVimalsoft(Pty) Ltd30-Jul-08 20:59 
Questionhow to use bulk insert to import a data file with this format? Please help Pin
alexyxj30-Jul-08 9:09
alexyxj30-Jul-08 9:09 
AnswerRe: how to use bulk insert to import a data file with this format? Please help Pin
Wendelius30-Jul-08 9:48
mentorWendelius30-Jul-08 9:48 
GeneralRe: how to use bulk insert to import a data file with this format? Please help Pin
alexyxj30-Jul-08 11:23
alexyxj30-Jul-08 11:23 
GeneralRe: how to use bulk insert to import a data file with this format? Please help Pin
Wendelius30-Jul-08 11:55
mentorWendelius30-Jul-08 11:55 
Questionhow to ArrayList store whole records? Pin
zeeShan anSari30-Jul-08 6:32
zeeShan anSari30-Jul-08 6:32 
hi all,
i write the following code for extract the data from a database, data also retrieved but there is a problem ...code is here

OracleConnection dataConnection = new OracleConnection();
ArrayList objList = new ArrayList();
try
{
dataConnection.ConnectionString = "Data Source=orc;Persist Security  Info=True;User ID=scott;Password=tiger;Unicode=True";
dataConnection.Open();
 OracleCommand datacommand = new OracleCommand("SELECT * FROM DEPT", dataConnection);

OracleDataReader datareader = datacommand.ExecuteReader();
      Dept d = new Dept();
               while (datareader.Read())
               {

                   d.DNAME = datareader["DNAME"].ToString();
                   d.DEPTNO = datareader["DEPTNO"].ToString();
                   d.LOC = datareader["LOC"].ToString();
                   objList.Add(d);

               }

               datareader.Close();


           }
           catch (Exception ex)
           {
               MessageBox.Show(ex.Message);
           }
           finally
           {
               dataConnection.Close();
           }

           try
           {
               cmbDname.DataSource = objList;
               cmbDname.DisplayMember = "DNAME";
           }
           catch (Exception ex)
           {
               MessageBox.Show(ex.Message);
           }


but i amazed ......all filled data of combobox is same i.e DNAME
like : OPERATIONS (which is last row of DEPT table)

because
objList
store only last data (OPERATIONS)........

but when i replace
objList.Add(d);
with
objList.Add(d.DNAME);
then objList store different DNAME..........but this time objList has only one colum <dname>....

my problem is that how can i store whole row in objList Confused | :confused:
AnswerCross-post Pin
Wendelius30-Jul-08 6:48
mentorWendelius30-Jul-08 6:48 
Questionpossible database fields Pin
dream_liner_7e730-Jul-08 4:03
dream_liner_7e730-Jul-08 4:03 
AnswerRe: possible database fields Pin
SimulationofSai30-Jul-08 5:28
SimulationofSai30-Jul-08 5:28 
GeneralRe: possible database fields Pin
Paul Conrad30-Jul-08 7:13
professionalPaul Conrad30-Jul-08 7:13 
AnswerRe: possible database fields Pin
Vimalsoft(Pty) Ltd30-Jul-08 21:02
professionalVimalsoft(Pty) Ltd30-Jul-08 21:02 
Questionretrieve more than one row in one row Pin
obarahmeh29-Jul-08 23:16
obarahmeh29-Jul-08 23:16 
AnswerRe: retrieve more than one row in one row Pin
Declan Bright30-Jul-08 3:56
Declan Bright30-Jul-08 3:56 
AnswerRe: retrieve more than one row in one row Pin
leoinfo30-Jul-08 4:26
leoinfo30-Jul-08 4:26 
GeneralRe: retrieve more than one row in one row [modified] Pin
PIEBALDconsult31-Jul-08 4:36
mvePIEBALDconsult31-Jul-08 4:36 
JokeRe: retrieve more than one row in one row Pin
leoinfo31-Jul-08 8:56
leoinfo31-Jul-08 8:56 
GeneralRe: retrieve more than one row in one row Pin
PIEBALDconsult31-Jul-08 10:16
mvePIEBALDconsult31-Jul-08 10:16 
AnswerRe: retrieve more than one row in one row Pin
PIEBALDconsult30-Jul-08 20:25
mvePIEBALDconsult30-Jul-08 20:25 
JokeRe: retrieve more than one row in one row Pin
leoinfo31-Jul-08 2:35
leoinfo31-Jul-08 2:35 
GeneralRe: retrieve more than one row in one row Pin
PIEBALDconsult31-Jul-08 3:38
mvePIEBALDconsult31-Jul-08 3:38 
QuestionReporting Services - Subreport cannot be viewed. Pin
Rashmi Deshpande29-Jul-08 20:10
Rashmi Deshpande29-Jul-08 20:10 
QuestionCommon Stored procedure for insert update and delete. Pin
santosh04229-Jul-08 19:58
santosh04229-Jul-08 19:58 
AnswerRe: Common Stored procedure for insert update and delete. Pin
Vimalsoft(Pty) Ltd29-Jul-08 23:19
professionalVimalsoft(Pty) Ltd29-Jul-08 23:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.