Click here to Skip to main content
15,897,704 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: SUM Pin
ESTAN17-Dec-09 11:05
ESTAN17-Dec-09 11:05 
GeneralRe: SUM Pin
MrRhodos17-Dec-09 23:13
MrRhodos17-Dec-09 23:13 
QuestionLocal Server Pin
sanforjackass17-Dec-09 8:29
sanforjackass17-Dec-09 8:29 
AnswerRe: Local Server Pin
David Mujica17-Dec-09 8:38
David Mujica17-Dec-09 8:38 
GeneralRe: Local Server Pin
sanforjackass17-Dec-09 8:44
sanforjackass17-Dec-09 8:44 
GeneralRe: Local Server Pin
ESTAN17-Dec-09 13:08
ESTAN17-Dec-09 13:08 
GeneralRe: Local Server Pin
shiva.kore17-Dec-09 19:38
shiva.kore17-Dec-09 19:38 
Questionado.net - DataRelation Vs InnerJoin Pin
Hanzaplast17-Dec-09 4:33
Hanzaplast17-Dec-09 4:33 
hi guys

i have developed for now several "middle-difficult" web applications. in short lines, they are all composed of custom controls inerhit from DataGrid or DetailsView, using sql queries to populate them with data. in some case their structure could be quite complex. my approach was this:

lets say we have somewhat complex query:
select 
	dip.id,
	satnica_obilazak,
	gg.naziv,
	t.naziv,
	klijenti,
iznos as dodatno,
    (
    select top 1 cijena_sata_rada_obilazak
        from klijenti_cijene
        where datum<=dip.datum and klijent_id=@klijent_id
        order by datum DESC, id
    ) as cijena_sata_rada,
klijent_id

from (((
            dnevni_izvjestaj_popis dip

            inner join dnevni_izvjestaj_trgovine dit
            on dit.izvjestaj_id=dip.id
        )
        left join dnevni_izvjestaj_troskovi ditr
        on ditr.izvjestaj_id=dip.id)
    
    inner join trgovine t 
    on t.id = dit.trgovina_id
    )
inner join grupacije_gradovi gg
on gg.id=dip.grad            

where 
    ditr.klijenti like ('%,'+@klijent_id+',%')
    and tip_troska<>1
    and tip_troska<>4
    and tip_troska<>6

this is copy-paste from my project...

i made "SqlAnalize" class which is accepting string "sql" as argument. in global, it goes character by character and populate ArrayList of table names from sql string compering to joins (inner join, left join, outer join...).
after that i use DataAdapter to populate DataSet with all (or some) tables from sql query. when this is done, algorithm can put DropDownList, CheckBoxList (or whatever i need) in DataGrid.

so here i have ClassLibrary with several controls which works this way...

recently i had to develop some simmilar class like above, but for Xml source. this is where i met "problem". using xml, DataAdapter fills DataSet very "nice"... "nice" would be best word.... and here i met DataRelation class.

i started to study some "DataRelation" tutorials, and find content interesting...

so my question is simple:

my approach in developing "smart" DataGrid(edit, delete, javascript confirm, dropdown list, uploads, wysiwyg, that kind of stuff inside) is using only sql queries. analize somewhat complex query, pass few values via some property, and finaly bind it.

am i doing this wrong way? this DataRelation seems quite interesting. should i change approach? anyone who was working on similiar projects, how did you designed DataSets, DataTable, queries and relation between em?

thanks in advance... and srry for bad english Sniff | :^)
AnswerRe: ado.net - DataRelation Vs InnerJoin Pin
Abhishek Sur17-Dec-09 5:16
professionalAbhishek Sur17-Dec-09 5:16 
GeneralRe: ado.net - DataRelation Vs InnerJoin Pin
Hanzaplast17-Dec-09 6:55
Hanzaplast17-Dec-09 6:55 
Questionchart in crystalreport Pin
ptvce17-Dec-09 1:15
ptvce17-Dec-09 1:15 
AnswerRe: chart in crystalreport Pin
Abhishek Sur17-Dec-09 5:08
professionalAbhishek Sur17-Dec-09 5:08 
QuestionDynamic updation after publishing Pin
SreejithKumar M16-Dec-09 23:45
SreejithKumar M16-Dec-09 23:45 
AnswerRe: Dynamic updation after publishing Pin
Arindam Tewary17-Dec-09 0:12
professionalArindam Tewary17-Dec-09 0:12 
QuestionWeb to Desktop! Pin
Sr...Frank16-Dec-09 23:42
Sr...Frank16-Dec-09 23:42 
AnswerCross post Pin
dan!sh 17-Dec-09 0:38
professional dan!sh 17-Dec-09 0:38 
AnswerRe: Web to Desktop! Pin
Abhishek Sur17-Dec-09 1:37
professionalAbhishek Sur17-Dec-09 1:37 
QuestionDelete a file Pin
Abbas_here16-Dec-09 23:39
Abbas_here16-Dec-09 23:39 
AnswerRe: Delete a file Pin
Arindam Tewary17-Dec-09 0:44
professionalArindam Tewary17-Dec-09 0:44 
GeneralRe: Delete a file Pin
Abbas_here17-Dec-09 1:16
Abbas_here17-Dec-09 1:16 
GeneralRe: Delete a file Pin
Arindam Tewary17-Dec-09 1:55
professionalArindam Tewary17-Dec-09 1:55 
QuestionModelDialog Window Vs Normal pop up dialog window Pin
kyreddy16-Dec-09 22:46
kyreddy16-Dec-09 22:46 
QuestionCool Iris .... Pin
Subin Mavunkal16-Dec-09 20:54
Subin Mavunkal16-Dec-09 20:54 
AnswerRe: Cool Iris .... Pin
John Bracey16-Dec-09 21:29
John Bracey16-Dec-09 21:29 
Questionwhen page refresh happen Fileupload control get cleared. Pin
chakran16-Dec-09 20:27
chakran16-Dec-09 20:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.