Note that there are some explanatory texts on larger screens.

plurals
  1. POIntellisense not helping
    primarykey
    data
    text
    <p>I am writing some code for a Windows application and things are going alright except for the IntelliSense doesn't give me options in some click event scope. Surprisingly, when I code it without its help, it doesn't give me any red squiggly on that line of code, so I am assuming the scope thing is OK. </p> <p>I have two forms, <code>FormA</code> and <code>FormB</code>, a button click event on <code>FormA</code> should trigger <code>FormB</code> with its textboxes filled with the information it received after running the logic attached. How I am doing is</p> <pre><code>formSrchResult.txtSearchFirstName.Text = searchedInfo.FirstName; formSrchResult.txtSearchLastName.Text = searchedInfo.LastName; formSrchResult.txtSearchUsername.Text = searchedInfo.UserName; formSrchResult.txtSearchEmail.Text = searchedInfo.Email; </code></pre> <p><code>formSearchResult</code> is an object of a <code>FormSearch(FormB)</code> and <code>searchedInfo</code> is an object of a class which have the properties storing data, which I want the textboxes in <code>FormSearch</code> to display. Both the <code>FormSearch</code> and <code>searchedInfo</code> are declared public, yet when I start typing </p> <blockquote> <p>"formSrchResult." + "ctrl + space" </p> </blockquote> <p>IntelliSense gives me no list with the names of textboxes and properties. So, I was wondering if anyone would have any idea on what might be causing this, I would love to know. Btw, its Visual Studio 2012.</p> <p>Thanks.</p> <pre><code>public class UserInfo { public int UserID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Email { get; set; } public string UserName { get; set; } } </code></pre> <p>That is the class which would store the searched info and below is the code for search method...</p> <pre><code>public UserInfo Search(string email) { UserInfo searchUserInfo = new UserInfo(); try { conn.Open(); SqlCommand cmd = new SqlCommand("spListEverything", conn); cmd.CommandText = "spListEverything"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Email", email); SqlDataReader rdrSearch = cmd.ExecuteReader(); if (rdrSearch.Read()) { //why do we need to convert the first name, last name etc to ToString //when they are defined, in the database, as a string itself? searchUserInfo.UserID = Convert.ToInt32(rdrSearch["UserID"]); searchUserInfo.FirstName = rdrSearch["FirstName"].ToString(); searchUserInfo.LastName = rdrSearch["LastName"].ToString(); searchUserInfo.UserName = rdrSearch["UserName"].ToString(); searchUserInfo.Email = rdrSearch["Email"].ToString(); } else { // "Sorry, no match found"; } } catch (Exception ex) { } finally { conn.Close(); } return searchUserInfo; } </code></pre> <p>Below is my coding for the btnClick event where the Intellisense did not help</p> <pre><code>private void btnSearch_Click(object sender, EventArgs e) { string email = txtSearchEmail.Text.ToString(); Manage myManage = new Manage(); //to call the search function FormSearchResult formSrchResult = new FormSearchResult();//to put the vlaues in the textboxes in that form UserInfo searchedInfo = myManage.Search(email); //the search function is not working properly. No value is returned to be stored //in the userInfo object //Here for some reason my intellisense is not providing options. formSrchResult.txtSearchFirstName.Text = searchedInfo.FirstName; formSrchResult.txtSearchLastName.Text = searchedInfo.LastName; formSrchResult.txtSearchUsername.Text = searchedInfo.UserName; formSrchResult.txtSearchEmail.Text = searchedInfo.Email; txtSearchFirstName.Enabled = false; formSrchResult.ShowDialog(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload