Click here to Skip to main content
15,902,939 members
Home / Discussions / C#
   

C#

 
Questionown Printer service on c#.net Pin
balu1234530-Jul-08 7:30
balu1234530-Jul-08 7:30 
AnswerRe: own Printer service on c#.net Pin
vikas amin30-Jul-08 10:50
vikas amin30-Jul-08 10:50 
GeneralRe: own Printer service on c#.net Pin
vikas amin30-Jul-08 10:52
vikas amin30-Jul-08 10:52 
GeneralRe: own Printer service on c#.net Pin
balu1234530-Jul-08 23:31
balu1234530-Jul-08 23:31 
GeneralRe: own Printer service on c#.net Pin
vikas amin1-Aug-08 5:37
vikas amin1-Aug-08 5:37 
GeneralRe: own Printer service on c#.net Pin
vikas amin1-Aug-08 6:15
vikas amin1-Aug-08 6:15 
GeneralRe: own Printer service on c#.net Pin
vikas amin19-Aug-08 5:41
vikas amin19-Aug-08 5:41 
QuestionArrayList ....Where is problem? Pin
zeeShan anSari30-Jul-08 6:30
zeeShan anSari30-Jul-08 6:30 
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:
AnswerRe: ArrayList ....Where is problem? Pin
Wendelius30-Jul-08 6:44
mentorWendelius30-Jul-08 6:44 
GeneralRe: ArrayList ....Where is problem? Pin
zeeShan anSari30-Jul-08 6:52
zeeShan anSari30-Jul-08 6:52 
QuestionRe: ArrayList ....Where is problem? Pin
Wendelius30-Jul-08 6:54
mentorWendelius30-Jul-08 6:54 
AnswerRe: ArrayList ....Where is problem? Pin
zeeShan anSari30-Jul-08 7:09
zeeShan anSari30-Jul-08 7:09 
GeneralRe: ArrayList ....Where is problem? Pin
Wendelius30-Jul-08 7:22
mentorWendelius30-Jul-08 7:22 
GeneralRe: ArrayList ....Where is problem? Pin
Alaric_30-Jul-08 7:31
professionalAlaric_30-Jul-08 7:31 
GeneralRe: ArrayList ....Where is problem? Pin
zeeShan anSari30-Jul-08 7:47
zeeShan anSari30-Jul-08 7:47 
GeneralRe: ArrayList ....Where is problem? Pin
Wendelius30-Jul-08 7:58
mentorWendelius30-Jul-08 7:58 
QuestionInvisible Form Labels [modified] Pin
#realJSOP30-Jul-08 6:12
professional#realJSOP30-Jul-08 6:12 
QuestionRe: Invisible Form Labels Pin
Wendelius30-Jul-08 7:07
mentorWendelius30-Jul-08 7:07 
AnswerRe: Invisible Form Labels Pin
#realJSOP30-Jul-08 7:28
professional#realJSOP30-Jul-08 7:28 
GeneralRe: Invisible Form Labels [modified] Pin
Wendelius30-Jul-08 7:39
mentorWendelius30-Jul-08 7:39 
GeneralRe: Invisible Form Labels Pin
#realJSOP30-Jul-08 7:47
professional#realJSOP30-Jul-08 7:47 
GeneralRe: Invisible Form Labels Pin
Wendelius30-Jul-08 8:09
mentorWendelius30-Jul-08 8:09 
AnswerRe: Invisible Form Labels Pin
DaveyM6930-Jul-08 9:35
professionalDaveyM6930-Jul-08 9:35 
GeneralRe: Invisible Form Labels Pin
#realJSOP30-Jul-08 10:43
professional#realJSOP30-Jul-08 10:43 
GeneralRe: Invisible Form Labels Pin
DaveyM6930-Jul-08 11:45
professionalDaveyM6930-Jul-08 11:45 

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.