Click here to Skip to main content
16,019,140 members

Comments by wirec aaht (Top 13 by date)

wirec aaht 11-Aug-13 12:46pm View    
thanks really works, but why did it work before without skiping first column?
wirec aaht 7-Aug-13 13:16pm View    
sorry first time I forgot to save it. There it is http://jsfiddle.net/EAEKc/319/
wirec aaht 7-Aug-13 12:24pm View    
sorry first time I forgot to save it. There it is http://jsfiddle.net/EAEKc/319/
wirec aaht 5-Aug-13 18:05pm View    
I updated it to this :
@{Layout="_Layout.cshtml";
var authenticated= WebSecurity.IsAuthenticated;
Array userData;
if(authenticated)
{
var db = Database.Open("Cosa Nostra Tips");
var user = db.QuerySingle("SELECT * FROM UserProfile WHERE UserId=@0",WebSecurity.CurrentUserId);
userData = File.ReadAllLines(Server.MapPath("~/App_Data/"+user.Group));
}
}



@if(authenticated)
{
foreach (string dataLine in userData)
{
foreach (string dataItem in dataLine.Split(','))
{@dataItem <text> }
<br />

}
}
but it gives me error :
Compiler Error Message: CS0165: Use of unassigned local variable 'userData'

Source Error:


Line 14: @if(authenticated)
Line 15: {
Line 16: foreach (string dataLine in userData)
Line 17: {

which I dont understand is if condition is true userData should have value and also code should perfrom if its not than not.
wirec aaht 5-Aug-13 17:48pm View    
under variable user it is