Showing posts with label datas. Show all posts
Showing posts with label datas. Show all posts

Friday, March 9, 2012

How To Retrive Data If There Are Large No. Of Datas In Table(by Minimum Time Conusum]

I Have One Module , In Which I Have To Find Perticular Person's Data .
It Is Easily To Get But Here Large No. Of Data I Have, I Know That It Is Possible But It Is Very Much Time Conusuming, So, Any Other Way To Retrive Value By Minimum Time Consuming

Reply As Soon As Possible
Thanks,
Rahul

Rahul_nadiad@.yahoo.com

Quote:

Originally Posted by RAHULPRAJAPATI

I Have One Module , In Which I Have To Find Perticular Person's Data .
It Is Easily To Get But Here Large No. Of Data I Have, I Know That It Is Possible But It Is Very Much Time Conusuming, So, Any Other Way To Retrive Value By Minimum Time Consuming

Reply As Soon As Possible
Thanks,
Rahul

Rahul_nadiad@.yahoo.com


Hi Rahul,
What is the module? How is the data stored ie what is the structure?|||

Quote:

Originally Posted by RAHULPRAJAPATI

I Have One Module , In Which I Have To Find Perticular Person's Data .
It Is Easily To Get But Here Large No. Of Data I Have, I Know That It Is Possible But It Is Very Much Time Conusuming, So, Any Other Way To Retrive Value By Minimum Time Consuming

Reply As Soon As Possible
Thanks,
Rahul

Rahul_nadiad@.yahoo.com


Hi there,

Please give a simple & clearer problem statement as it would ease in providing solution. Take care.

How To Retrive Data If There Are Large No. Of Datas In Table(by Minimum Time Conusum

MY PROJECT IS HOSPITAL MANAGEMENT SYSTEM
AND THERE ARE ABOUT 700 PATIENT DAILY VISIT THE HOSPITAL/ ADDING NEW PATIENT(LARGE HOSPITAL).
SO, LARGE NUMBER OF PATIENTS ARE THERE. NOW SUPPOSE AFTER FEW YEARS THERE ARE ABOUT 70000000 PATIENTS RECORDS IN DATABASE , THEN TO FETCHNIG SOME PATIENT'S DETAILS IS VERY TIME CONSUMING [ BY SELECT * FROM PATIENT]
THEN WHAT SHOULD I DO? ANY ONE HAVE ANY IDEA?

AND ONE MORE THING I WOULD LIKE TO KNOW THAT HOW THE IMAGES WILL STORE IN DATABASE ACCESS?
PLS REPLY SOON

RAHUL PRAJAPATI
rahul_nadiad@.yahoo.com

Quote:

Originally Posted by RAHULPRAJAPATI

MY PROJECT IS HOSPITAL MANAGEMENT SYSTEM
AND THERE ARE ABOUT 700 PATIENT DAILY VISIT THE HOSPITAL/ ADDING NEW PATIENT(LARGE HOSPITAL).
SO, LARGE NUMBER OF PATIENTS ARE THERE. NOW SUPPOSE AFTER FEW YEARS THERE ARE ABOUT 70000000 PATIENTS RECORDS IN DATABASE , THEN TO FETCHNIG SOME PATIENT'S DETAILS IS VERY TIME CONSUMING [ BY SELECT * FROM PATIENT]
THEN WHAT SHOULD I DO? ANY ONE HAVE ANY IDEA?

AND ONE MORE THING I WOULD LIKE TO KNOW THAT HOW THE IMAGES WILL STORE IN DATABASE ACCESS?
PLS REPLY SOON

RAHUL PRAJAPATI
rahul_nadiad@.yahoo.com


Hi there,

The structure of the database isteslf can play a major role is enabling fast access, heard of database normalization? Why not use database normalization to restructure your current database.

In relational database theory, normalization is the process of restructuring the logical data model of a database to eliminate redundancy, organize data efficiently, reduce repeating data and to reduce the potential for anomalies during data operations. Data normalization also may improve data consistency and simplify future extension of the logical data model. The formal classifications used for describing a relational database's level of normalization are called normal forms

Kindly refer to below link for further reading & understanding, hope it helps.

http://en.wikipedia.org/wiki/Database_normalization
You can use Binary large object (BLOB technique in order to be able to safe graphics and other related material in database.

Good luck & Take care.|||Hi Sashi,
I am also a newbie to these things.
My understanding is that, data normalization eases the adding the data and managing the constraints.
But normalisation results in more number of tables than without (or lower level of) normalisation.
So doesnt it mean that it slows the data access as it requires to join more number of tables.

Please correct me if I am wrong.

-Subhash.

Quote:

Originally Posted by sashi

Hi there,

The structure of the database isteslf can play a major role is enabling fast access, heard of database normalization? Why not use database normalization to restructure your current database.

In relational database theory, normalization is the process of restructuring the logical data model of a database to eliminate redundancy, organize data efficiently, reduce repeating data and to reduce the potential for anomalies during data operations. Data normalization also may improve data consistency and simplify future extension of the logical data model. The formal classifications used for describing a relational database's level of normalization are called normal forms

Kindly refer to below link for further reading & understanding, hope it helps.

http://en.wikipedia.org/wiki/Database_normalization
You can use Binary large object (BLOB technique in order to be able to safe graphics and other related material in database.

Good luck & Take care.

Friday, February 24, 2012

how to retrieve datas from a SqlDataSource

Hi! I'm a novice in asp .net

I've a SqlDataSource component on an Aspx page.
In the associated C# file, I would like to use datas from the query stored in the SqlDataSource component.

How to do this?

Thanxs :)

An example

<%@.PageLanguage="C#" %>

<%@.ImportNamespace="System.Data" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

protected void Page_Load(object sender, EventArgs e)

{

DataView dv = (DataView)SqlDataSource1.Select(new DataSourceSelectArguments());

DataTable dt = dv.Table;

// display table

bool pagesToDo = true;

int index = 0;

while (pagesToDo)

{

Table t = GetDisplayTable(dt);

t.CssClass = "PageBreakStyle";

Controls.Add(t);

int nextPageEndsAt = index + 10;

while (index < nextPageEndsAt && pagesToDo)

{

TableRow tr = new TableRow();

t.Rows.Add(tr);

foreach (DataColumn dc in dt.Columns)

{

TableCell tc = new TableCell();

tr.Cells.Add(tc);

tc.Text = dt.Rows[index][dc.ColumnName].ToString();

}

index++;

if (index == dt.Rows.Count)

{

pagesToDo = false;

break;

}

}

}

}

Table GetDisplayTable(DataTable dt)

{

Table t =newTable();

TableHeaderRow thr =newTableHeaderRow();

t.Rows.Add(thr);

foreach (DataColumn dcin dt.Columns)

{

TableHeaderCell thc =newTableHeaderCell();

thc.Text = dc.ColumnName;

thr.Cells.Add(thc);

}

return t;

}

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

<styletype="text/css">

.PageBreakStyle

{

page-break-after:always;

}

</style>

</head>

<body>

<formid="form1"runat="server">

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

SelectCommand="SELECT [ProductID], [ProductName] FROM [Products]"></asp:SqlDataSource>

</form>

</body>

</html>

|||

Thanks, it works!

very cool man ^^

How to retreive set of rows from stored procedure

hi,

i am new to SQL. i have created a stored procedure which gets a input parameter "Category" and it selects datas which falls under this category. when i run this procedure it returns only the last row. it doesnt retreive the entire set of rows. which method should i follow to solve my problem.. i want all the rows which comes under the category to be returned ....

MY PROCEDURE

CREATE PROCEDURE [dbo].[Items_Category_sorted]

(

@.Category varchar(10),

@.ProductID Char(10) OUTPUT,

@.Name Char(50) OUTPUT,

@.UnitPrice Numeric(9) OUTPUT,

@.Stock Numeric(9) OUTPUT

)

AS

BEGIN

SET NOCOUNT ON;

SELECT @.ProductID=ProductID,

@.Name=Name,

@.UnitPrice=UnitPrice,

@.Stock =Stock

From

ProductDetails

Where

Category=@.Category

END

As you're using output parameters, you can only have one value per parameter and this will be set to values in the last row returned by your query.

To return a recordset of multiple values, try:

CREATE PROCEDURE [dbo].[Items_Category_sorted]

(

@.Category varchar(10)

)

AS

BEGIN

SET NOCOUNT ON;

SELECT ProductID,

Name,

UnitPrice,

Stock

From

ProductDetails

Where

Category=@.Category

END

Hope this helps!