softweb001
-
Posts
21 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by softweb001
-
-
Hi..
I want to arrange the output of my code like this
Maths Eng
Student1 40 60
Student2 40 60
buh am having a problem doing it.......
here is my code
using System;class WorkFile{private string[] studentsarray;private string[] subjectsarray;private int[,] studentiesarray;public string CourseName {get; set; }public string[] students{get{return studentsarray;}set{studentsarray = value;}}public string[] subjects{get{return subjectsarray;}set{subjectsarray = value;}}public WorkFile( string name, int[ , ] studenties, string[] students, string[] subjects ){CourseName = name;studentiesarray = studenties;studentsarray=students;subjectsarray=subjects;}public void DisplayMessage(){Console.WriteLine( "Welcome to the grade book forn{0}!n",CourseName );}public void processgrades(){outputgrades();}public int getaverage(int Row){int total = 0;for (int column = 0; column < studentiesarray.GetLength(1); ++column)total += studentiesarray[Row, column];int over= (int)total/studentiesarray.GetLength(1);return over;}public void outputgrades(){Console.WriteLine("The grades are");Console.Write(" ");for (int test = 0; test < subjects.Length; ++test){Console.Write("{0} ",subjects[test]);}Console.WriteLine("Average");for (int Row = 0; Row < studentiesarray.GetLength(0); ++Row){Console.WriteLine(students[Row]);for (int grade = 0; grade < studentiesarray.GetLength(1); ++grade){Console.Write("{0, 8}", studentiesarray[Row, grade]);}Console.WriteLine("{0,9:F}", getaverage(Row));}}}And the classusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace StudentScores{class Program{static void Main(string[] args){string[] students = new string[2];string[] subjects = { "Maths", "English", "Biology", "Chemistry", "Physics", "Economics", "Geography", "Agriculture" };int[,] studenties = new int[2, 8];WorkFile myworkfile = new WorkFile("Welcome to the main man", studenties, subjects, students );for (int request = 0; request < students.Length; ++request){Console.Write("Input the name of the student: ");students[request] =Convert.ToString(Console.ReadLine());for (int scores = 0; scores < subjects.Length; ++scores){Console.Write("input his {0} score: ", subjects[scores]);studenties[request, scores] = Convert.ToInt32( Console.ReadLine());}}myworkfile.processgrades();Console.ReadKey();}}}pls help....Thanks... -
This is d code behind
===================
void LoadProject() { FormsIdentity objTicket; objTicket = (FormsIdentity)User.Identity; string sUser = objTicket.Ticket.Name; string staffID = Session["Owner"].ToString(); sql = "Select * From Project_List Where Staff_ID=@staID And Status=@sTatus"; try { using (con = new SqlConnection(conString)) { con.Open(); cmd = new SqlCommand(sql, con); cmd.Parameters.Add("@staID", SqlDbType.VarChar).Value = staffID; cmd.Parameters.Add("@sTatus", SqlDbType.VarChar).Value = "Started"; SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = cmd; sda.TableMappings.Add("Table", "recs"); DataSet set = new DataSet(); sda.Fill(set); int total = Convert.ToInt32(set.Tables[0].Rows.Count); if (total > 0) { SqlDataReader dtaReader = cmd.ExecuteReader(); dtlOngoing.DataSource = dtaReader; dtlOngoing.DataBind(); dtaReader.Close(); } else { lblMsg.Text = "No New project for this user!!!"; } } } catch (Exception ex) { lblMsg.Text = ex.Message.ToString(); } finally { con.Close(); } }
and this is the Design
===================
<asp:DataList CssClass="par2" ID="dtlOngoing" runat="server" OnCancelCommand="dl_Cancel" OnEditCommand="dl_Edit" OnUpdateCommand="dl_Update" DataKeyField="Project_ID"> <ItemStyle Font-Names="Times New Roman" Font-Size="10pt" ForeColor="Black" /> <AlternatingItemStyle BackColor="Red" /> <ItemTemplate> <p> Project Name:<strong> <%# DataBinder.Eval(Container.DataItem, "Project_Title") %> </strong><br /> </p> <p> Description:<strong> <%# DataBinder.Eval(Container.DataItem, "Description") %> </strong><br /> </p> <p> Status:<strong> <%# DataBinder.Eval(Container.DataItem, "Status") %> </strong> </p> <p> <asp:LinkButton ID="lbEdit" runat="server" Text="Edit" CommandName="Edit"></asp:LinkButton> </p> </ItemTemplate> <EditItemTemplate> <p> Project Name:<strong> <%# DataBinder.Eval(Container.DataItem, "Project_Title") %> </strong><br /> </p> <p> Description:<strong> <%# DataBinder.Eval(Container.DataItem, "Description") %> </strong><br /> </p> <p> Status: <asp:DropDownList ID="ddlStatus" runat="server"> <asp:ListItem Value="Started" Text="Started">Started</asp:ListItem> <asp:ListItem Value="Finished" Text="Finished">Finished</asp:ListItem> </asp:DropDownList><br /> <asp:LinkButton ID="lbCancel" runat="server" Text="Cancel" CommandName="Cancel"></asp:LinkButton>| <asp:LinkButton ID="lbUpdate" runat="server" Text="Update" CommandName="Update"></asp:LinkButton> </p> </EditItemTemplate> <SeparatorTemplate> <hr style=" border:5px solid double;" /> </SeparatorTemplate> </asp:DataList>
Thanks.....
-
ii have retrieved the data using a datalist but am getting an error about my with the OnCancelCommand attribute
-
i want to display data on a page and i want it to be inside a div tag
-
Thanks very much it was helpfull
-
Hi......
I want to display the content of my database on a page in a div that will group them one by one and i want it to iterate through
somthing like this in php
while($row=mysql_fetch_assoc(#sql)){
echo "<div class='cont'>";
echo "$row['Names']";
echo "</div>";
}
i want to do this in c# .NET
Please help me out
Thanks...........
-
Hi, I am a new asp .net programmer and i want to update my database...please help me out
thanks..
-
Closing Tags
in .NET
Thanks........
-
hi guyz...i started asp .net few weeks ago and now i want to connect to sql server, so from my research most people write the connection string on each page but i want to write mine in a class so that i can justcall it anytime can someone please help me out please.
Thanks...
-
Closing Tags
in .NET
hi guyz........just having a little doubt about this two closing tags for ASP .NET form elements
which of this is correct
<asp:PlaceHolder>...</asp:PlaceHolder>
or
<asp:PlaceHolder />
and is it applicable for all tags
Thanks
-
alright....thanks
-
-
i am using windows 7 and i already have wamp server installed before installing IIS and when i launch it on my browser the IIS is shown to me only as a picture.then i uninstalled wamp and re-installed IIS i still have thesame problem...
and i have another problem which has to do with creating a web c# .net page..thanks
-
hi....I am a beginer in asp.net c# but i had to stop becaue i was unable to install iis on my system please help me out.thanks
-
sorry this is the full code
#container{
width: 900px;
height: auto;
margin: 0 auto;
background-color: #FFF;
}
#inner{
width: 50px;
height: 150px;
float: left;
background-color: #000;
}
in my html page
<div id="container">
<div id="inner">
</div>
</div>
i expect the container height to increase automatically base on the content i put inside it that is why i have that inner div but it is not increasing please help me out.......thanks
-
-
-
Hi guyz........am having a problem withthe opacity property. what i want is to make a dive transparent and the text on it should be black and visile...the div is already transparent but the text is not visible and i have tried setting the font-weight property but i still have thesame problem...help me out please.thanks
-
please am new in this forum and i dont understand or know how to start a thread can you expalin better or give me a link to guide me through..............thanks
-
hi guyz..please i want to hide my .php extension but i couldn't can you please help me out
Accessing Files and Folders
in .NET
Posted
Hi Guyz,
I am developing an application to list all the files and folders in a particular directory, i have successfully done that but ther problem is that i cant view the file or navigate the folders.
Eg if i have a mytext.txt file...when i click on it i cant view it...Please help...thanks