|
I'd have to agree that storing the paths in the database would be the best apporach. At this point you should probably think of a way to programatically grab the paths and file names and insert them in the table you have.
-Ra
There are 10 types of people in the world: Those who understand binary, and those who don't...
|
|
|
|
|
Based on the responses I received I am planning to use Filesystem to store files and store paths into database.But I wonder why would someone want to store images in database.One reason anyone can think of is security but than there are ways to secure files also and if I am getting performance hit I better take care of link brakage and use filesystem.(FYI even though I have over million images only 200-2000 will be accessed at a time.)
:-:-:-:
Everything happens for a reason, but not that everything that happens has a reason.(I don't know what I am talking about, do you ? )
|
|
|
|
|
Hi all,
Can someone tell me how to declare a variable and in the WHERE clause say field > variable.
The variable must be in the form 12:25 i.e. time format.
Also the variable is user input from a form in a .asp page.
Here is the query:
Statement=request.form("input1")
Sql = "SELECT First.Time FROM First WHERE First.Time > 'Statement%'";
"Statement" accepts the variable fine but when I use it in the Sql statement it will not work. I really don't know how to use variables in Sql statements.
Please help me
Damien Lynch
|
|
|
|
|
Damien,
You are almost there. Try:
Sql = "SELECT First.Time FROM First WHERE First.Time > '" + Statement + "%'";
- Paul
|
|
|
|
|
Hi,
I want to know if its possible, with the same SqlCommand, first execute a ExecuteNonQuery(), and then change the SqlCommand.Text and execute an ExecuteReader().... because it doesn´t work.
When I try to do the same, but with two different SqlCommand objects, it doen´s work again. The ExecuteReader trhows an exeption.... what should I do? Do I have to close the connection and then open it again?
Many thanks in advance!
|
|
|
|
|
simon29 wrote:
Do I have to close the connection and then open it again?
Should not have to, I have re-used SqlCommand objects before.
Post your code, then we can help.
Paul Watson Bluegrass Cape Town, South Africa Christopher Duncan wrote:
Which explains why when Santa asked, "And what do you want for Christmas, little boy?" I said, "A life." (Accesories sold separately)
|
|
|
|
|
hello @all,
i connected my mfc program and an access database with ODBC.
<br />
CDatabase db;<br />
db.Open(_T( "MyDatabase" ), FALSE,<br />
FALSE, _T( "ODBC"));
the ODBC driver of my database is called 'MyDatabase'. but when i use this code, the database is not selected. i must select it myself!
what must i change to select my odbc driver from the program (i have to do nothing, after i start the program)?
thanks
mfc
|
|
|
|
|
Greetings,
I have been trying to use the "sp_tables" procedure from ADO, and it seems to return a recordset with the count of "0". I am working with
the VC++ .Net studio under windows 2000.
I am connected to the sql server with "no" intial catolog using ADO.
I have a database within the system called "MyTestDB", and I tried
to access the tables from within the database but I get a recordset
of "0" count.
I can however use the "SQL Enterprise Manager" to send the command
and get a listing of my tables, but for some reason ADO just isn't
working correctly.
Here is a sample of the sql code I am using.
----------------------------------------
USE MyTestDB EXEC sp_tables
Any ideas, or suggestions?
Thanks in advance for any help!
|
|
|
|
|
rather do this (C# but should be readable)
sqlConnection.Open();
sqlConnection.ChangeDatabase("MyTestDB");
then setup a SqlCommand to handle the stored procedure like you did in the sp_databases run it while the connection is open. I dont think a dataadapter will work here. Just loop thru the SqlDataReader...or fixed the connection string
Cheers
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|
|
Hello,
Thanks for your response.
It seems that the current database interface that I am using is ADO 2.6, and I can't use "ChangeDatabase"
which is not in that interface.
Is there a way to do this in the older versions of ADO?
|
|
|
|
|
|
Try EXEC MyTestDB.dbo.sp_tables
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello,
The "EXEC MyTestDB.dbo.sp_tables" WORKED!!!
Thanks that is exactly what I needed.
|
|
|
|
|
Hi *.*!
I don't seem to figure out how to store an Image in the database. I have thumbnail-sized images (up to 5k) and need to store them. What db-datatype should I use? How can I effectively read and write the value?
Thanks in advance!
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
http://codeproject.com/cs/database/albumviewer.asp[^]
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Thanks!
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
Hi, ALL. There is a small problem. A have two tables in master-detail relationships (farther-child). Master table is bound to DataView object. How can I apply filtering conditions on the child table. In other words, how can I refer to child table within RowFilter string.
|
|
|
|
|
Hello,
I was wondering what the best way to check if a database exists, so it can be created if it doesn't in SQL server?
Right now I just use a try catch block, and see if it fails, but is there a better way since the "_com_error &e" try catch shows the same hresult on all sql errors when using Visual C++ .Net.
Thanks in advance for any help!!
|
|
|
|
|
|
Excellant that is exactly what I needed!! Thanks, it worked great!
Thanks again!!!
|
|
|
|
|
Hi all,
I am trying to create a table in an MS Access DB, from my app. I want to set the "AllowZeroLength" property of a field in the new table to "yes". How can i specify that in the "Create table" statement ? Or atleast in an "Alter table" statement ?
Thanks
Smitha
It's easy to sit there and say you'd like to have more money. And I guess that's what I like about it. It's easy. Just sitting there, rocking back and forth, wanting that money.
|
|
|
|
|
I have an table like this:
Date | Priority | PrimaryKey
====== ========= ======
12/2/2002 101 1
12/3/2002 101 2
12/4/2002 101 3
12/5/2002 101 4
12/6/2002 111 5
12/11/2002 111 6
12/12/2002 111 7
12/13/2002 111 8
12/4/2002 121 9
12/14/2002 121 10
12/15/2002 121 12
12/16/2002 121 13
I want to make query command to get ONLY PRIMARYKEY of minimum date for each group of prirority:
12/2/2002 101 1
12/6/2002 111 5
12/4/2002 121 9
If I use this command:
select min(Date),PrimaaryKey from table3 where (Date< GetDate() ) group by Priority
I'll get two column but I have to only get PrimaryKey column because I want to use in WHERE of UPDATE command.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
What database are you using? SQL Server 7.0, SQL Server 2000, MS Access, Oracle, etc...
If you are using SQL Server then you could do something like this:
Select a.Date, a.Priority, a.PrimaryKey
From table as a INNER JOIN
(Select Priority, Min(Date) as Date
From table
Group by Priority) as b
on a.Priority = b.Priority
and a.Date = b.date
Let me know if this doesn't work or if you are using a different database.
Jeremy Oldham
|
|
|
|
|
Thanks for reply.
joldham wrote:
What database are you using?
SQLServer 2000.
I'm not at my desk to test your command but I got the point from it.Thanks again.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I am playing around with a DataSet and a relational database. The following code does work...
MessageBox.Show (profileSet.Tables["Profiles"].Rows[0]["TextureID"].ToString());
My questions are:
Does the DataSet contain a table with the Text value for the TextureID key?
If yes, what would the code look like to access it?
Thanks
Paul
|
|
|
|