Listbox

  • Thread starter Thread starter kerfunkle3
  • Start date Start date
K

kerfunkle3

When i create a listbox and run the program the text options that i
entered as strings are not visible but i can still click on the
options as if they were there... what exactly is going on?
 
kerfunkle3,

Three questions:

Have you set the listbox's ForeColor the same as the BackColor?
What version of Visual Basic?
Are you running a McAfee virus checker?

Kerry Moorman
 
kerfunkle3,

Three questions:

Have you set the listbox's ForeColor the same as the BackColor?
What version of Visual Basic?
Are you running a McAfee virus checker?

Kerry Moorman

no, i'm not sure at the moment, yes i am
 
kerfunkle3,

If you are running McAfee(R) VirusScan(R) EnterpriseVersion 8.0i, then this
is a known bug.

McAfee has a patch at their site, but I don't have any of the details. I
know that Patch 9 fixed the problem for me a couple of years ago.

Kerry Moorman
 
hi i'm neeraja
i'm new to Dotnet subject nd i'm getting one exception while running
one ASP Pgm
pls rectify the problem and what actually is.... help me out
here is my pgm:


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace WebApplication2
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Button Button1;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void Button1_Click(object sender, System.EventArgs e)
{
SqlConnection conn=new SqlConnection("uid=sa; pwd=;database=pubs");
SqlCommand comm;
SqlDataReader dr;
comm=new SqlCommand(TextBox1.Text,conn);
conn.Open();
dr=comm.ExecuteReader();
while(dr.Read())
{
for(int i=0; i<dr.FieldCount;i++)
{
TextBox2.Text+=dr.ToString();
}
TextBox2.Text+="\n";
}
dr.Close();
conn.Close();

}
}
}

after running this one when i click the button then i'm getting this
error page:........


Server Error in '/WebApplication2' Application.
--------------------------------------------------------------------------------

ExecuteReader: CommandText property has not been initialized
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: ExecuteReader:
CommandText property has not been initialized

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.

Stack Trace:


[InvalidOperationException: ExecuteReader: CommandText property has
not been initialized]
System.Data.SqlClient.SqlCommand.ValidateCommand(String method,
Boolean executing)
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteReader()
WebApplication2.WebForm1.Button1_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
 
Back
Top