|
I'm working on a WPF app that has user profiles. The profile contains the user's picture. Any reason not to store the image in the Profiles table?
Never done this before. Suggestions/comments appreciated.
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
Kevin Marois wrote: Any reason not to store the image in the Profiles table?
I don't have any; that's what I'd do. If you're not already, you may want to resize the images to some standard before doing so.
|
|
|
|
|
Ok, thanks
Everything makes sense in someone's mind
|
|
|
|
|
If you were working on a webapp, then it'd be sweeter to have them on the server directly so that the browser can cache them.
Outside of that environment, I prefer to store those things in the database. That way you can backup all the data that belongs together in a single document.
Bastard Programmer from Hell
|
|
|
|
|
Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.
Everything makes sense in someone's mind
|
|
|
|
|
The problem I have with that is if someone replaces a file with one you don't expect.
|
|
|
|
|
PIEBALDconsult wrote: The problem I have with that is if someone replaces a file with one you don't expect.
What does that have to do with how they are stored?
|
|
|
|
|
The file system is less secure.
|
|
|
|
|
PIEBALDconsult wrote: The file system is less secure.
I doubt that is relevant in a system that needs to be secure.
If one does nothing but assume that a database is "more" secure than a file system with no other concern for security then they will have problems. And one a real security policy in place any real differences in implementation of systems at this level becomes much less significant allowing one the freedom to base decisions on other business needs.
|
|
|
|
|
I'll stick with the more secure solution regardless. It's like putting things in a bank vault rather than relying solely on the security guard at the door.
|
|
|
|
|
PIEBALDconsult wrote:
I'll stick with the more secure solution
regardless. It's like putting things in a bank vault rather than relying solely
on the security guard at the door.
Not at all. At least not at most banks, because your analogy is not a complete statement of the security policy in place at the bank.
For instance...how is the vault secure if the door to it is left open, the front door to the bank is left open and there is no active security monitoring system in place?
And note that several years ago one large study found that 90% of security problems with actual losses originated internally within the company.
|
|
|
|
|
jschell wrote: originated internally within the company.
Which is my point too. Generally, more people have access to the file system than to the database. A no-longer-gruntled sys admin could replace individual files, but not alter the contents of the database.
|
|
|
|
|
Kevin Marois wrote: Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.
I'd still store them in a database
You'll want a specific folder to store the user-pictures; you don't want to store them between "all other" pics like logo's and the like. This gives also the advantage that you can delete everything in this path and rebuild it with the info from the database, without touching other graphics.
Bastard Programmer from Hell
|
|
|
|
|
For small images database is probably best, simply because it is going to be easier to implement.
|
|
|
|
|
This may or may not be the right forum to ask this type of question. I haven't hung out in this database area to know. Please, let me know where to post this. I can add more detail if contacted.
I'm looking for a professional mysql database developer to perform a job/service for me. I have very little database experience and need either a consultant/expert type or someone who can answer questions (justify reasons and choices made) and design and develop a mysql database. I am a software developer and realize that I am out of my league in order to build a database (and PHP website) to handle potentially rapid growth so I am also interested in how things should be done and why.
|
|
|
|
|
Yup, you're right; this is not the right place to ask this. Trouble is, I'm not sure where the right place since the job board seems to have gone. Maybe the collaboration forum?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Thanks, for the suggestion...I was not confident about posting it in the collaborative area however I did a search on the google and found a neat website called elance. It looks like its setup for what I want to do. I haven't researched it too much so at first glance, though it may be unfair, I'm a little wary about what kind of talent pool is there, and I'm wondering if I could pay by the project based on an initial estimate or bid versus an hourly rate.
If anyone knows any pros or cons to sites like that one, please let me know.
TIA
|
|
|
|
|
JohnnyG wrote: a mysql database
JohnnyG wrote: to handle potentially rapid growth
I recommend SQL Server (Express).
|
|
|
|
|
I'm trying to return two ref cursors from a procedure and having a bit of trouble. What I'm trying to do is grab the info from the first cursor, select a few fields out of it and join to some other info and stick the result into a table variable... then select distinct items from that table into the second cursor. But I can't get this to compile. Can someone tell me what I'm doing wrong please?
type T_CURSOR is REF CURSOR
procedure FetchSL3Details_PRC
(
c_items out T_CURSOR,
c_identifiers out T_CURSOR,
p_niin in char
) as
v_idents IDENTIFIER_TABLE_TYPE:= IDENTIFIER_TABLE_TYPE();
BEGIN
open c_items for
select
its.item_set_id,
its.niin,
its.parent_niin,
its.commodity_id,
its.service_type,
its.sl3_type,
its.qty,
its.created_id,
its.created_dt,
its.modified_id,
its.modified_dt
from
item_set its
start with its.niin = p_niin
connect by prior its.niin = its.parent_niin;
for item in c_items
loop
v_idents.extend;
v_idents(v_idents.LAST) := identifier_row_type(item.commodity_id,
get_group_name_fun(item.commodity_id),
0);
v_idents.extend;
v_idents(v_idents.LAST) := identifier_row_type(item.created_id,
get_formatted_name_fun(item.created_id),
0);
v_idents.extend;
v_idents(v_idents.LAST) := identifier_row_type(item.modified_id,
get_formatted_name_fun(item.modified_id),
0);
end loop;
open c_identifiers for
select
distinct(v.id),
v.name,
v.type
from
v_idents v;
END FetchSL3Details_PRC;
|
|
|
|
|
I have a vb.net stock control app that is installed on about 10 workstations. They read/write data to an Access 2007 DB on a server. For all the database interactions, I use routines like the one below. If the function returns false, the I display the error.
The stock figures are getting all messed up. I have checked that all the transactions work correctly on my pc - no problems at all. The users ASSURE me that they have never seen any Error messages (I have also checked that should a function return false, that the error is displayed.)
My question:
1) What happens if two users try to access the same record at the same time?
2) Would the code below throw an exception if the database trasnaction failed?
Public Function UpdateRecord2(ByVal strUpdate As String, params() As String) As Boolean
Dim RecordsUpdated As Integer = 0
Dim cnStr As String = "Provider=" & Provider & "; Data source= " & _Database
Using cn As New OleDb.OleDbConnection(cnStr)
Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter
Dim cmd As OleDb.OleDbCommand
cmd = New OleDb.OleDbCommand(strUpdate, cn)
For i As Integer = 0 To params.Length - 1
If params(i) = Nothing Then params(i) = ""
cmd.Parameters.AddWithValue("?", params(i))
Next
da.InsertCommand = cmd
Try
cn.Open()
RecordsUpdated = da.InsertCommand.ExecuteNonQuery()
cn.Close()
Catch ex As Exception
frmMain.Err.DataMethod = "UpdateRecord"
frmMain.Err.DataErr = ex.Message
Return False
Finally
cn.Close()
End Try
End Using
If RecordsUpdated = 1 Then
Return True
Else
frmMain.Err.DataMethod = "UpdateRecord"
frmMain.Err.DataErr = "No Records updated"
Return False
End If
End Function
PS: I am trying to migrate the code to work on SQL Server 2008 Express...
|
|
|
|
|
Your PS indicates you are making the correct decision as to the future.
Access (used to) locks a "Page" of records when required, not sure the size of the page but it will include more than 1 record at the end of the table. Additional attempts to access the locked records will get an exception.
You need to insure that this is likely to be a real world problem, in the 90s I had the same environment and never had a contention issue in a number of years of operation (we went to SQL Server eventually).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for your reply. It seems from your answer that an exception would be thrown/caught in my code. I am leaning more towards the idea that MY CODE is causing the problem and has nothing to do with Access. I have to sort this out before I even think of SSE...
Let me visit Google and then possibly post another question on that...
|
|
|
|
|
Further to Mycroft's answer, IIRC Access supports more than page-level locking. At least some versions can also do record level locking (and maybe no locking at all, which would cause your problems.) I suggest a quick google/MSDN search on "access record lock".
[disclaimer: It's been so long since I played with Access that I've forgotten more than I ever knew.]
HTH
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I was not aware that they ever achieved record locking, we never had any contention issues so I forgot about it, it was after all the 90s and I suppose even Access has had some improvement since then!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
My memories are VERY dim, but I'm sure Mr G and Mr W know.
In Jet versions before version 4, a page locking model is used, and in Jet 4, a record locking model is employed. Can't remember how you set it up for locking or not.
Now for something that belongs in Coding Horrors, except it doesn't really qualify as coding:
The weirdest db corruption I ever had to fix was a shared dB4 database, using Codebase. In this setup, index files are "external", and some smartass self-appointed admin managed to have two of the six clients running from the shared db files on the server but with LOCAL C drive index files.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|