string username1 = Session["SessionName"] != null ? Session["SessionName"].ToString() : null;
if (IsPostBack != true)
{
string constr4 = ConfigurationManager.ConnectionStrings["IntranetDB"].ConnectionString;
SqlConnection con4 = new SqlConnection(constr4);
con4.Open();
SqlDataAdapter adpt4 = new SqlDataAdapter("select * from ReleaseNotes", con4);
DataTable dt4 = new DataTable();
adpt4.Fill(dt4);
List<String> RteReleaseNotes3 = new List<String>();
RteReleaseNotes3 = dt4.AsEnumerable()
.Select(r => r.Field<string>("contentarea"))
.ToList();
rteReleaseNotes.Value = RteReleaseNotes3[0];//set value for RTE from DB.
string constr5 = ConfigurationManager.ConnectionStrings["IntranetDB"].ConnectionString;
SqlConnection con5 = new SqlConnection(constr5);
con5.Open();
SqlDataAdapter adpt5 = new SqlDataAdapter("select * from Links", con5);
DataTable dt5 = new DataTable();
adpt5.Fill(dt5);
List<String> quickLinks3 = new List<String>();
quickLinks3 = dt5.AsEnumerable()
.Select(r => r.Field<string>("quicklinks"))
.ToList();
quickLinks.Value = quickLinks3[0];//set value for RTE from DB.
}
I keep getting the error on the last line: quickLinks.Value = quickLinks3[0];//set value for RTE from DB.
I'm helping a company with their intranet. There are multiple pages, and sql servers, and im a noob to this because this is just an internship. I'm to use existing code to make something that is already pretty similar to whats been done, but I keep getting the error:
An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
I'm using a sql database(with no data in it yet) if that helps