Click here to Skip to main content
15,888,113 members
Home / Discussions / C#
   

C#

 
Questioncall Oracle function which returns a REF CURSOR - tutorial? Pin
devvvy6-May-09 2:59
devvvy6-May-09 2:59 
AnswerRe: call Oracle function which returns a REF CURSOR - tutorial? Pin
TweakBird28-Dec-10 22:09
TweakBird28-Dec-10 22:09 
Questionsource code for video cutter Pin
twinkle116-May-09 2:58
twinkle116-May-09 2:58 
AnswerRe: source code for video cutter Pin
dheeraj.mittal3-Jun-10 19:35
dheeraj.mittal3-Jun-10 19:35 
QuestionLaunch Condition for crystal report in c#.net 3.5 Setup project. Pin
Narendra Reddy Vajrala6-May-09 2:18
Narendra Reddy Vajrala6-May-09 2:18 
AnswerRe: Launch Condition for crystal report in c#.net 3.5 Setup project. Pin
bhaumikdv25-May-09 22:46
bhaumikdv25-May-09 22:46 
GeneralRe: Launch Condition for crystal report in c#.net 3.5 Setup project. Pin
Narendra Reddy Vajrala12-Jun-09 5:54
Narendra Reddy Vajrala12-Jun-09 5:54 
QuestionListView SelectedIndexChanged exception Pin
piticcotoc6-May-09 2:06
piticcotoc6-May-09 2:06 
Hello. I have a listview where I load data from sql database. ListView has two columns (name, surname) where data is loaded. On the selectedindexchanged event, when an item from the listview is selected it gets the other data from the database, based on selection, and writes it to several textboxes... basicly a phonebook. If I select someone from the list the info is displayed in the txtboxes, but if i click smeone a second time i get an exception "NullRefferenceException" "Object reference not set to an instance of an object."


private void lvNameList_SelectedIndexChanged(object sender, EventArgs e)
        {
            ClearSearch();
            select = "SELECT * FROM agenda_telefonica WHERE nume = '" + lvNameList.FocusedItem.Text + "' AND prenume = '" + lvNameList.FocusedItem.SubItems[1].Text + "'"; 
            SqlDataReader dr = realSql.Select(select);
            if (!dr.HasRows)
            {
                MessageBox.Show("Information not found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                while (dr.Read())
                {
                    tbName.Text = dr[1].ToString().Trim() + " " + dr[2].ToString().Trim();
                    tbPhoneNumber1.Text = dr[3].ToString().Trim();
                    tbPhoneNumber2.Text = dr[4].ToString().Trim();
                    tbPhoneNumber3.Text = dr[5].ToString().Trim();
                    tbFaxNumber.Text = dr[6].ToString().Trim();
                    tbEmail.Text = dr[7].ToString().Trim();
                    tbCompany.Text = dr[8].ToString().Trim();
                    tbService.Text = dr[9].ToString().Trim();
                    tbEquipment.Text = dr[10].ToString().Trim();
                }
            }
            dr.Close();
            realSql.Close();
        }
    }


The exception is raised the second time i click an item in the list and points to the select string. Does it have something to do with the FocusedItem?
AnswerRe: ListView SelectedIndexChanged exception Pin
Druuler6-May-09 2:20
Druuler6-May-09 2:20 
GeneralRe: ListView SelectedIndexChanged exception Pin
piticcotoc6-May-09 2:22
piticcotoc6-May-09 2:22 
AnswerRe: ListView SelectedIndexChanged exception Pin
Henry Minute6-May-09 2:48
Henry Minute6-May-09 2:48 
GeneralRe: ListView SelectedIndexChanged exception Pin
piticcotoc6-May-09 18:25
piticcotoc6-May-09 18:25 
Questionprinting problem? Pin
maifs6-May-09 1:59
maifs6-May-09 1:59 
AnswerRe: printing problem? Pin
OriginalGriff6-May-09 2:24
mveOriginalGriff6-May-09 2:24 
AnswerRe: printing problem? Pin
Henry Minute6-May-09 2:53
Henry Minute6-May-09 2:53 
GeneralRe: printing problem? Pin
maifs6-May-09 4:50
maifs6-May-09 4:50 
GeneralRe: printing problem? Pin
Henry Minute6-May-09 5:43
Henry Minute6-May-09 5:43 
QuestionCompile/decompile CHM files in C# Pin
marca2926-May-09 1:26
marca2926-May-09 1:26 
AnswerRe: Compile/decompile CHM files in C# Pin
Member 1624358015-Apr-24 0:18
Member 1624358015-Apr-24 0:18 
GeneralRe: Compile/decompile CHM files in C# Pin
trønderen15-Apr-24 3:19
trønderen15-Apr-24 3:19 
QuestionValidate emailaddress Pin
hitesh.kalra5-May-09 23:54
hitesh.kalra5-May-09 23:54 
AnswerRe: Validate emailaddress Pin
Pete O'Hanlon6-May-09 0:02
mvePete O'Hanlon6-May-09 0:02 
AnswerRe: Validate emailaddress Pin
MumbleB6-May-09 0:02
MumbleB6-May-09 0:02 
AnswerRe: Validate emailaddress Pin
OriginalGriff6-May-09 0:05
mveOriginalGriff6-May-09 0:05 
GeneralRe: Validate emailaddress Pin
Pete O'Hanlon6-May-09 0:16
mvePete O'Hanlon6-May-09 0:16 

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.