|
Hi Hema,
Shameel is quite correct you can store in web server it self. But in security concerns it will not quite good but you can achieve that also by providing a user and giving read/write permission for that user and use it while storing it in web server.
If you still want to use it please put (nolock) while you are retrieving information of image or any thing as you said same db is using for reporting.
|
|
|
|
|
Information like name, age, sex, etc. can be stored using appropriate data types like varchar, int, etc.
Photos can be stored using two ways:
One is to store the photo as binary information in an image column.
The other is to store the photos as jpeg images on the file system and store their paths in a varchar column.
Each of these approaches have advantages and disadvantages of their own, you may want to explore these options further and see what works for your situation.
|
|
|
|
|
once again thanks to you and shameel for your time in replying.
as you peoples mentioned i can save the file in the web server. But as i mentioned earlier i will be using the windows application to save the images and i will retriving the same in windows application.
In that case i need to share the folder (to all the machines ??? ) rt..it may cause security violation.. so there is only one way to store is database rt?
so i need to compromise the perfomance of the applcication...
|
|
|
|
|
Hema Bairavan wrote: In that case i need to share the folder (to all the machines ??? )
No, you don't have to and you should not.
You can build a web service that serves images. Google can help you find code samples to get you started.
|
|
|
|
|
thanks shameel.. i will check that case and get back to you..
thanks in advance
|
|
|
|
|
You may want to look into writing a Web Service (WCF) and access that from your clients.
I agree with putting the image in the database (I don't trust the file system), but you should only access it when you need it, not every time you access the record.
I also suggest you put the images in a separate table.
|
|
|
|
|
PIEBALDconsult wrote: I don't trust the file system
And where do you persist your database? Even if it is on a good old magtape, that still probably implies a file system of some kind.
|
|
|
|
|
|
Trusting it not to lose one big file is one thing, also trusting it not to lose many small ones is another.
(Easier to back up too.)
|
|
|
|
|
Hema Bairavan wrote: is it advisable to use the same? or is there any way to accomplish the same by using any other data types.. i tried usign varbinary (max) now the perfomance is little better than that.. but still slow.
It's slow because you're fetching a blob from the database. Host it on a webserver and store the path, you'll find that the browser simply caches the picture.
Bastard Programmer from Hell
|
|
|
|
|
|
If you chose to store the images in the database, you could improve performance by optimising your queries and also retrieving images only when needed e.g. user clicks some button to see/view image.
|
|
|
|
|
hi
i have same application with database installed in different cities, each one stand alone. the reason is network connectivity is very poor.
with this, i have to manage user access in all the above installations seperately.
i am facing delays / time waste with maintaining same access / password at all locoations.
any suggestion..
|
|
|
|
|
one of the solution is see is transactional replication with updatable subscriptions...but i can see microsoft is going to stop it in future
the problem with triggers is that the network link may not be up all the time
|
|
|
|
|
I'd say do the transactional replication for now. Then start planning for a more robust application e.g. one central database accessible over the web. Develop the web app such that very little data has to travel over the web at a given instant.
|
|
|
|
|
If you are using SQL Server 2008 policy based management might be a solution. But again I think this was something introduced in SQL 2008.
|
|
|
|
|
i am doing the school project. Now i face a problem, i need to record my data everyday, and one a new day comes, it will automatically create an new Excel file to record the data. Anyone can give me an example code? Thanks very much!!
|
|
|
|
|
Firstly, this is not a Database question, so should have been posted to the C# forum. However, this article[^] explains it all.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
(SORRY FOR MY BAD ENGLISH )
i have these :
cust_line (line_num,cust_id).
line_contact(contact_period,line_num).
i want to know the customer who the customer of the longest period contact
i think this is the quest
select max(cc),cust_line.line_num from cust_line JOIN (
select SUM(contact_period)as cc , line_num from line_contact group by line_num )As a
on cust_line.line_num=a.line_num
where cust_line.line_num=A.line_num
but it make a wrong results , please help me
ty
|
|
|
|
|
hi
hope below query will work for you,
select cust_id,max(contact_period) from line_contact,cust_line where line_contact.line_num = cust_line.line_num;
thanks
-amit
|
|
|
|
|
Please tell us what is the problem exactly your are facing. If you want data according to customerid just you can add customer id to the view.
|
|
|
|
|
I am having an issue with retrieving fields from MFC CRecordset.
I am using GetFieldValue( index, strText );
Works fine until the opened recordset contains only one record. Than I get the first field OK, but then I get an error saying basically that the field has already been retrieved.
Here it the error:
Error: GetFieldValue operation failed on field %d.
Data already fetched for this field.
It seem that the field index is not being advanced.I stepped thru the GetFieldValue,
but cannot find the actuall source for the error routine.
If I do MoveFirst on this one record record set , I get an error that I am attempting to move past the beginning of the recordset.That would be expected.
I am using VC 6.0 MFC with standard CRecordset and Access database with ODBC.
So far Google is no help.
Any pointers would be greatly appreciated.
Thanks for your help.
Vaclav
|
|
|
|
|
You should post this question under C/C++/MFC.
|
|
|
|
|
Are you advancing the index in the loop so that the loop will end if you have only on value? Also would it be possible to see the source for this.
|
|
|
|
|
I am sorry, I moved the question to MFC as suggested and did not even attempted to delete it here.
I think it cannot be deleted once discussion starts.
Yes, the field index is properly advanced and it works just fine with more than one record in the recordset - initially.
The key is that I get the first field OK, than it fails on next one.
I know the field is there because it retrives the record just fine when different SQL returns more records in recordset.
Here is the code snippet, I have removed my // comments for clarity, but it is pretty normal text retrieval loop.
pRecordset->AddNew(); fix , does not really adds anything
pRecordset->MoveFirst(); should not need this on initial Open recordset
short nFields = pRecordset->GetODBCFieldCount( );
while( !pRecordset->IsEOF( ) )
{
buffer = strText.GetBuffer(256);
// set item text
for( short index = 0; index < nFields; index++ )
{
pRecordset->GetFieldValue( index, strText );
buffer = strText.GetBuffer(256);
pList->SetItemText(iItem,index,buffer); this is where it fails
TRACE("\n item %i field %i buffer %s ",iItem , index , buffer );
}
pRecordset->MoveNext( );
iItem++;
}
I would like to get you opinions on this if you have time to work on it.
If so please switch to MFC forum.
Thanks
Vaclav
|
|
|
|