|
There is a reason why you are getting limited help on this subject, very few experienced devs will use the table adapters. They are one of the worst things MS has inflicted on us, they allow a new developer to get data to the UI with almost no knowledge of how it was achieved.
Look into buiding or implementing a data access layer DAL. This will give you much greater knowledge and therefore control over your data.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: worst things MS has inflicted on us, they allow a new developer to get data to the UI with almost no knowledge of how it was achieved.
And this is a bad thing why?
Anyway, the problem is not that I don't know what I'm doing. I know exactly what it should look like, and know that if I can get the screen to look like this, it will work as expected. The internals of the Table Adapter are not the problem; the problem is the Designer changing parameters without my permission.
If you don't know how to convince the UI to not drop data, man up and confess your ignorance rather than using it as an excuse to make yourself sound like an elitist snob. That does nobody any good, and makes you look stupid.
Allow me to demonstrate:
Bad: HAHAHAHA!!!! LOSER!!!! ONLY N000BS USE M$ COMPONENTS!!!! ROLL YOUR OWN N0000B!!!!1111ONEONE
Good: Oooh, sorry, I never use TableAdapters, I've never had anything but problems with them, and in my experience, most people around here feel the same. Have you considered making your own or implementing one from somewhere else? It always seems to work out easier for me in the long run.
You see the difference? They both offer the same advice, but the second one actually comes across as advice rather than an elitist slam.
----
All ranting aside, I do appreciate your advice, and while it doesn't look like implementing some other solution is an immediately viable solution (I'm not the only person in this code, and the senior programmer who originally implemented this would seem to take offense at the idea that he has no idea what he's doing), I will keep it in mind should I come across database needs more complex than can be solved through whatever it takes to get this UI in line (which looks like my only option might be to let VS destroy my Parameters and then manually rewrite them all.... sigh....)
|
|
|
|
|
Trevortni wrote: man up and confess your ignorance rather than using it as an excuse to make yourself sound like an elitist snob.
I thought it was rather obvious that I didn't have the answer, the reason I waited to see if somone else had come up with something more constructive.
Trevortni wrote: senior programmer who originally implemented this
I'm astonished a senior dev would be using table adaptors, I would not allow that on any project I was involved in and would question the devs claim to seniority.
Also this probably would have got a better response in the C#/VB forum as it really is the UI code misbehaving.
Do take a look at some of the articles here as there are some excellent DALs available in them.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: it really is the UI code misbehaving
I doubt that very much. It's the DataAdapter and CommandBuilder (and probably Clippy) trying to be helpful.
|
|
|
|
|
PIEBALDconsult wrote: It's the DataAdapter and CommandBuilder
Sure but they are in the UI and in C#/VB rather than the database.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
They have nothing to do with the UI; there are no visible parts, they do the same thing when I write a library with a text editor.
|
|
|
|
|
I am trying to run the following query on a MS SQL Server 2005 Express.
SELECT * FROM
(
SELECT * FROM vuWeighTicketReport
WHERE [TicketDate] >= '2010-09-10'
) AS TicketData PIVOT (
SUM(ProductWeight) FOR ProductCode IN (
[Blood],[Bonecake],[Carcass],[CFat],[Desiel],[DMeal],[Feather],[FMeal],
[Greaves],[Head],[Misc],[Offal],[PBlend],[PFB],[PMeal],[Skin],[Slurry],
[Tail],[Tallow],[TBottom],[Thigh],[TMeal],[Wash]
)
)
SQL Managment Studio tells me there is an error near ')'
I know the error is after the PIVOT statement, but what the actual problem is, I don't know.
I would be very grateful if someone could point my mistake out to me.
Thanks
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
SELECT *
FROM vuWeighTicketReport
WHERE [TicketDate] >= '2010-09-10'
AS TicketData PIVOT
(
SUM(ProductWeight) FOR ProductCode IN ([Blood],[Bonecake],[Carcass],[CFat],[Desiel],[DMeal],[Feather],FMeal],[Greaves],[Head],[Misc],[Offal],[PBlend],[PFB],[PMeal],[Skin],[Slurry],[Tail],[Tallow],TBottom],[Thigh],[TMeal],[Wash])
)
try that
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
Thanks for the reply, but your suggestion did not work.
I have now resolved the problem, and my final SELECT query now looks like this :-
SELECT * FROM
(
SELECT * FROM vuWeighTicketReport
WHERE [TicketDate] >= '2010-09-10'
) AS Tickets PIVOT
(
SUM(ProductWeight) FOR ProductCode IN
(
[Blood],[Bonecake],[Carcass],[CFat],[Desiel],[DMeal],[Feather],
[FMeal],[Greaves],[Head],[Misc],[Offal],[PBlend],[PFB],[PMeal],
[Skin],[Slurry],[Tail],[Tallow],[TBottom],[Thigh],[TMeal],[Wash]
)
) AS TicketProductWeights
The only difference to the original is that I have added AS TicketProductWeights to the end.
Typically, the problem was stiring me in the face, and I couldn't see it.
Thanks again.
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
I need to develop a query that identifies all of the records from one table that are not contained within another table. Inner Joins will not work. I know that there is an approach that will do this but I do not remember it.
|
|
|
|
|
try
SELECT * FROM table1 WHERE field1 NOT IN (SELECT field2 FROM table2 WHERE ...)
|
|
|
|
|
|
select * from table1 a left outer join table2 b
on a.id=b.id
where b.id is null
This will give you all records in table1 that aren't in table2, assuming id is the common key.
|
|
|
|
|
There was a thread on here a few weeks ago about the merits of exists versus in versus outer join. I can't remember what the conclusion was and I can't find the thread now.
|
|
|
|
|
|
Yes, I took part. I prefer outer join -- because of portability and such.
|
|
|
|
|
Hi,
look im going to configure sql express 2008 for accepting remote connection, BUT, automically ... I mean the enduser will not set anything, after installing sql express it whould be configured for network connections and etc.
actually i need sql scripts for this...
|
|
|
|
|
As in a local Sql Express database that you just installed? Enabling is explained here[^], but a word of warning though; it allows Sql Express to receive commands that originate from another computr - and that might be someone with malicious intent.
If someone could get into the server without permission, chances are that they could execute scripts. That could include scripts that modify the filesystem and/or the registry!
Next point to consider; even if you install Sql Express with the option to allow remote connections to be made, there might still be a firewall disallowing it.
I are Troll
|
|
|
|
|
|
|
Hi guys, I have an old SSIS file which needs editing now. The problem is that the person who developed it has left and unfortunetly he used "User Key encryption".
Does anyone have any idea on how (if possible) can I get it back? I would really appreciate any type of help.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Hi,
I am creating one table and it has field like DetailInfo. Since the user can insert short or long details, I am wondering which particular datatype with maximum size to be used ? Well nvarchar has max 5000 but is there anyway i can use more than that size ? So shall I use nText or nvarchar in this case ?
thanks in advance
suchita
|
|
|
|
|
Which database?
If Sql Server, look into nvarchar(max).
|
|
|
|
|
|
Note that nText is going away in future SQL server releases. The nvarchar(max) should do what you want.
|
|
|
|
|