Showing posts with label requirement. Show all posts
Showing posts with label requirement. Show all posts

Wednesday, March 21, 2012

Hi Need Help

I have an application in c#. Which is intended to give student with highest marks in each class.

There are 10 classes

The requirement is to find top student of each class and display it in columnwise like below

Class Student Name

Can anyone help me on that.

Thanks in advance

Hi,

Prepare the SQL Query which returns the Top 10 values from each class vise..

Select Top 10 Stud-ID,Stud_Name from StudentTable where StudentClass = UserParameter;

Write the C# Method which accept the One Parameter from the User and return the result set.

public DataSet GetTopTen(string strClassParam)
{
ds = new DataSet();
if (ObjCon.State == ConnectionState.Open) ObjCon.Close();
ObjCon.Open();
string strQuery = "Select Top 10 Stud-ID,Stud_Name from StudentTable where StudentClass ="+strClassParam; (Change the Query according to your need..)
sc = new SqlCommand(strQuery, ObjCon);
sda = new SqlDataAdapter(sc);
sda.Fill(ds);
ObjCon.Close();
return ds;
}

Biind the Result Set to the DataGrid or Gridview to show it.

That is it.

|||

hi,

i assume that u r geeting yr data from sql qury. if so, then u can get ur data by firing such query

selectdistinct class,studentnamefrom studenttablewhere mark=(selectmax(mark)from studenttable)

you can getthis by declaring dataset.u can bind gridview withclass and studentname bounded columns and assigning datasource to it like

gridview1.datasource = ds.tables[0].defaultview;

gridview1.databind();

Friday, February 24, 2012

HELP: Physical Database Design

Hello to all.

I'm having trouble translating this requirement into physical DB tables:

- Information about users in general are:

- Username and Password

- Users belong to a group which have different roles

- (e.g. Customers, Administrators)

- Users can only belong to one group

- Information about groups are:

- GroupID, GroupName, Roles

- Customers and Administrators have different fields

- Customers : (CustomerID, CompanyName, BillingAddress, ShippingAddress, etc.)

- Administrators: (AdministratorID, AdministratorName)

- The system must be able to do the following:

- Ban a group

- Ban a specific user

- Information about a user must be based on the group that he/she is in. (e.g. Customer info must be queried from the Customers table) with the username as the only provided information initially.

- Add a new user type in the future

Any comments and suggestions will do. Thanks in advance.

- Raymond

Here is a good resource for classwork design problems such as this.

If you review some of the designs listed at this site, you will have a better idea of how to accomplish your assignment. (Note: the models and designs at this site are only a suggestion and should be used with caution -but they are better than nothing...)

http://www.databaseanswers.org/data_models/index.htm