|
hazzem elrefai wrote:
b4
plz
thnx
This is not an SMS text message - you have more that 160 characters to play with. The use of these contractions make the text difficult to read.
Okay, I'll answer your question now.
For an e-commerce application I would ensure you use transactions. From the MySql manual: MySQL Server (version 3.23-max and all versions 4.0 and above) supports transactions with the InnoDB and BDB transactional storage engines.
So you need at least the above version plus, it would appear, one of the transactional plugins. (These may or may not be supplied with MySQL, I don't know)
The other thing that I think is important is Stored Procedures. From the MySQL manual: Stored procedures are implemented in MySQL version 5.0. For the benifits of Stored Procedures click here[^]
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
If you are using framework 1.0 you will need to download the mysql odbc 3.51 driver which you can get from the mysql website. It does already come with 1.1
|
|
|
|
|
Hi:
I think you need to use ODBC driver to connect to MySQL from ASP.NET. Either System.Data.Odbc (for 1.1 or higher) or Microsoft.Data.Odbc (for 1.0)
I have seen some managed providers for MySQL database but I think they are not free.
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Dear Friends,
I got a table in which the column of our interest is id . It is of type int and is an Identity column. As such whenever i insert any row, there is no need for me to provide the value of this column because it is identity column and it value is generated automatically by SQL server.
Now the problem is that there is some data in the table. The table is something like:
id country
==== =======
1 Algeria
2 Bangladesh
3 USA
i.e the frist id is 1, second is 2 and so on. What i want is to change the starting value of id from 1 to 101, in the existing records. How can i do so.
Imtiaz
|
|
|
|
|
In enterprise manager, change the column so it is not an identity then edit the id to run sequentially from 101 then change the column back to an identity with an identity seed of 100.
Thats how I've typically done it in the past although if someone can offer a better solution, please do.
SuzyB
If I had a better memory I would remember more.
|
|
|
|
|
Try:
SET IDENTITY INSERT <tablename> ON
UPDATE <tablename>
SET id = id + 100
SET IDENTITY INSERT <tablename> OFF
|
|
|
|
|
The principle of the procedure I have worked out may appear convoluted but it works.
--------------------------
I start with my table:
octx has:
1 India
2 Japan
3 Brazil
------------
xid xname
------------
xid: Primary Key
====================
I create a table:
octy which has:
---------------------
101 y1 1
102 y2 2
103 y3 3
yid yname Idx
--------------------
yid: Primary key
Now I update octy such that:
yname=xname [xname selected from octx such that
octx.xid=octy.Idx.]
-----------------------
This makes the octy as follows:
101 India 1
102 Japan 2
103 Brazil 3
--------------
Now I alter octy to drop the Idx column
-----------------------------
The transformation is complete.
A batch routine can be written to make this happen.
mysorian
|
|
|
|
|
with the following call
<br />
vtFld = m_pRecordset->Fields->GetItem(lpFieldName)->Value;<br />
where lpFieldName is type "memo", I am only getting the first 256 character returned to the variant variable vtFld. I am using MS Access as my database editor which in turn uses JET as the database. Might anyone know why I'm am only getting the first 256 characters returned? I checked all of the fields in vtFld and all the relavent ones contain the returned truncated string.
Thanks!
|
|
|
|
|
Do you use ODBC recordsets? I recently run into the same problem when working with DTL (uses ODBC under the hood), and found the solution here[^]
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I'm using ADO recordsets.
|
|
|
|
|
Did you use aggregate functions (SUM, AVG, MAX, COUNT, etc) in your sql statement?
Also a memo field will be truncated to 255 characters in a query that uses sorting (ORDER BY).
|
|
|
|
|
Well, I guess there are a couple things I am noticing. To answer the questions above, no, I am not using any aggregate functions and there isn't an ORDER BY in the statement. However, I have other memo fields in other tables which return more than 256 fields when called through ADO, which makes we wonder about the table itself. Does anyone know what might cause a single table to cause these issues? One thing that is different in this table is that there are relationships mapped to it.
thanks!
|
|
|
|
|
Well, some people also suggested that there's a bug when calling memo fields.
They recommend either getting a column for every 256 chars (using MID)
Others recommend calling the GetChunk() function. It takes a long as argument, so you should be able to get everything using it.
Here's a sample of the function called in ASP:
set rst = conn.execute("select job_title, job_descr from jobs")
strTitle = rst.Fields("job_title").value & ""
vChunk = rst.Fields("job_descr").GetChunk(4000)
strDescr = vChunk
Do Until IsNull(vChunk) = true
vChunk = rst.Fields("job_descr").GetChunk(4000)
vDescr = vDescr & vChunk
Loop
Hope it helps!
|
|
|
|
|
Hi!
I have a problem, query is : "SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SHEMA.COLUMNS", then result DATA_TYPE field is empty, why ?
OS:WIN CE
DEV:eVC++ ADOCE MSS
|
|
|
|
|
Hi,
I have a problem with sql:
ALTER PROCEDURE dbo.GetGuestbookData<br />
( <br />
@SortOrder varchar(64)<br />
)<br />
AS<br />
<br />
SELECT *<br />
FROM Guestbook INNER JOIN Users<br />
ON Guestbook.AuthorID = Users.RecordID<br />
ORDER BY Guestbook.RecordID +'@SortOrder'<br />
RETURN
I am trying how to write a proc. which retrieves two tables sorted in order which user wants (ASC/DESC) but I don't know how to write it in code according to the value of my variable
-
ORDER BY Guestbook.RecordID ASC/DESC
Thanks.
|
|
|
|
|
Oh, it was quite easy answer (and stupid question )
I made a if clause here:
<code>CREATE PROCEDURE dbo.GetGuestbookData
(
@SortOrder varchar(64)
)
AS
IF @SortOrder='ASC'
BEGIN
SELECT *
FROM Guestbook INNER JOIN Users
ON Guestbook.AuthorID = Users.RecordID
ORDER BY Guestbook.RecordID ASC
END
ELSE
BEGIN
SELECT *
FROM Guestbook INNER JOIN Users
ON Guestbook.AuthorID = Users.RecordID
ORDER BY Guestbook.RecordID DESC
END
RETURN </code>
|
|
|
|
|
Urgent! Please help!
Ok. Here is the situation:
Want to use ADO to work with MS Access, BUT!
I want to make ADO to use MS Access OLE DB provider instead of the ODBC. So I'm trying to use Open method of the conenction object in ADO but:
1. if I try to pass full connection string like so:
"PROVIDER=Microsoft.Jet.OLEDB.4.0;DSN=C:\mydb.mdb; UID=; PWD=";
I get "Could not find installable ISAM" error. Then I found MSDN article that says that connection string parameters weren't allowed at open time it has to be just the provider name. Set everything else after the initial success. Ok so I try :
2. to call Open method of Connection object with just "PROVIDER=Microsoft.Jet.OLEDB.4.0" and empty user name and password. Then I get "Authentication failed." But I do not have any authentication for that db set up. Even more - what Authentication if no db was provided yet?
When I was using OLE DB directly I had "Authentication failed" issue come up one but that was solved by NOT setting properties at all - skipping (I remember empty strings didn't help). But with ADO Open method requires those two parameters for user and password which I have no idea how to skip.
So!
How in the world do you connect to an MDB with ADO via OLEDB provider from C++ in VC 6?
Urgent! Please help!
Thank you very much!
|
|
|
|
|
|
I can't remember on the recordset.first which I had it in ASP.
When comes to ASP.NET, I can't find it.
Is there anyway to declare it?
|
|
|
|
|
I didn't get your doubt. Are u talking about Ado.Net or Ado ?
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I'm talking about ASP.NET.
Do they have this BOF and EOF?
|
|
|
|
|
ASP.NET doesn't handle databases. ASP = Active Server Pages. In other words it is a web application framework.
ADO.NET is the database interface technology in the .NET Framework.
DotNet wrote:
Do they have this BOF and EOF?
No. ADO.NET uses a different model for accessing the database.
You can access the database in one of two ways.
Using a DataAdapter with DataSets or (for forward & read only operations) you can use a DataReader
You might also want to read this article[^] on the differences and migration between classic ADO and ADO.NET
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
how can add a record into db
|
|
|
|
|
Well, this question is totally new topic.
So please post it to a new section.
Thanks.
|
|
|
|
|
Hi,
I have a problem with handling errors from accessing SQL database. When there is an error, SqlException returns a message, such as
"Violation of UNIQUE KEY constraint 'CK_Site_SiteName'. Cannot insert duplicate key in object 'Site'."
However, My application requires to know which type the error belongs to so that it can process properly. Example, if it catches the above error, it will notify user that "Choose another name."
Give me some ideas, thanks in advance.
be kunkun
kunkun
|
|
|
|