|
Hi Friend,
Can you change the line as follows.
.Parameters.Add("@percentage", 100)
- I think 'Add' Method is enough here.
With Regards,
Pandian S
|
|
|
|
|
THOUSANDS OF PARDONS to all the friends who tried to help. The problem was something different.
As a matter of fact, all the changes I was making had been commencing in the LOCAL COPY of my database. For this reason, my changes did not reflect in the result set.
I again aplogize everybody.
With gread regards.
|
|
|
|
|
sqlmanager.exe - Application Error
The instruction at "0x780104ac" referenced memory at "0x009e00af".The memory could not be "read".
|
|
|
|
|
You're best reporting that to Microsoft.
|
|
|
|
|
hi there,
I've got a table with
ID int [primary key]
TypeID int
PATH varchar(25)
now I'd like to do something like "select the ID of a random record with TYPEID = 1".
is this possible in TSQL? If so, can somebody drop a hint?
thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
|
Is school back already ??? Oh well there goes summer.
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
Well I am trying to make an admin section to allow my other admins of my site able to add content to my mysql database without giving them phpmyadmin access and without teaching them out to use it as well. So I am trying to make a form that they can use to fill in a few simple fields and then it create the tables in the database and then insert a row in a seperate table that is already made.
Here is how I want it to work...
Name:
Filename:
Category:
Header Image:
"Name" would be used for the print output saying that "NameHere has been added to the database" and also be used in inserting a value in a table that has already been created called "pageheaders".
The Filename will be used many times...this will be the from portion of the names of the tables as well as part of the insert into pageheaders.
Category will just be part of the insert into pageheaders.
Header Image is also just part of the insert.
Here is the form portion of what I am trying to do...the action is calling to another page where the sql stuff is because that is the only way I knew to do it but if you know a better way to have them in the same file then I am more than happy to use that.
Form Code:
<form action="tablesandinsert.php" method="post"><br />
Name: <input type="text" name="name"><br><br />
Filename: <input type="text" name="filename"><br><br />
Category: <input type="text" name="category"><br><br />
Header Image: <input type="text" name="headerimage"><br><br />
<input type="submit" value="Submit"><br />
</form>
And here is the sql code that is used for inserting and creating sql stuff...it doesnt actually insert anything or create the tables so I obviously did something wrong.
SQL Stuff:
$name=$_POST['name'];<br />
$filename=$_POST['filename'];<br />
$category=$_POST['category'];<br />
$headerimage=$_POST['headerimage'];<br />
<br />
$query="CREATE TABLE `$filename_fins` (<br />
`gif_id` mediumint(9) NOT NULL auto_increment,<br />
`fingifurl` text NOT NULL,<br />
PRIMARY KEY (`gif_id`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br />
<br />
CREATE TABLE `$filename_trons` (<br />
`gif_id` mediumint(9) NOT NULL auto_increment,<br />
`trongifurl` text NOT NULL,<br />
PRIMARY KEY (`gif_id`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br />
<br />
CREATE TABLE `$filename_misc` (<br />
`gif_id` mediumint(9) NOT NULL auto_increment,<br />
`miscgifurl` text NOT NULL,<br />
PRIMARY KEY (`gif_id`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br />
<br />
INSERT INTO `pageheaders` VALUES ('$name', '$filename', '$headerimage', '$category/$filename/index');";<br />
$result=mysql_query($query);<br />
Print "$name has been successfully added to the database.";<br />
?>
so any help on where I went wrong?
|
|
|
|
|
Hi,
I am trying to use C# to execute the following procedure.
call RESOURCE_DEVELOPMENT.PHILIPS_REPORTS.ConfirmUDFExists('COM_X');
The error is:
ORA-12154: TNS:could not resolve service name
This is the c# code that I am using.
please note that the above procedure works fine in oracle.
objConn = DatabaseConnection.GetConnection(objContext);
objConn.Open();
objCmd = new OracleCommand(strSQL, objConn);
objCmd.CommandText = strSQL;
objCmd.CommandType = CommandType.Text;
objCmd.ExecuteNonQuery();
|
|
|
|
|
You do not show anywhere how the variable 'objContext' was instantiated or initialized. There probably needs to be some database name, user name and user password in that variable.
Chris Meech
I am Canadian. [heard in a local bar]
Nobody likes jerks. [espeir]
|
|
|
|
|
You will have to check your "tnsnames.ora" file contains an entry for the database you are trying to connect to.
A few more details would help though.
|
|
|
|
|
hi all,
We are requesting for data from SQL Server which is in a server(it is in London).The requested stored Procedure has TWO DateTime Variables.(@startdate DATETIME,@enddate DATETIME)
So when we doing request with StartDate='23/09/2006' AND EndDate='29/09/2006' , startdate is converted to '24/09/2006' and enddate is converted to '30/09/2006'. Then request result is completed wrong.
Can anyone please tell me why it happens?
I do not change datetime when processing.It is happen automatically.
thanks in advance.
|
|
|
|
|
select getutcdate()
select getdate()
|
|
|
|
|
i create application by using vb.net2005 i add sqldataadapter to my project when i try to configure dataadapter to connect to database this error apear
*************************
an error has occurred while establishing a connection to the server.when connecting to sql server 2005 this failure may be caused by the fact that under the default setting sql server does not allow remote connection (provider:sql network interfaces,error:26-error location server/instance specificed)
**************************
i need to solve this error to end my project
plz answer me very quickly
thanks
ma_refay
|
|
|
|
|
The message suggests that your SQL Server on a different machine. Or, that it is local, but you refer to it using a network identifier.
So, where is the SQL Server, and what is your connection string?
|
|
|
|
|
hi,
i just want to know is it possible to get a row by its number in SQL like rowid in oracle.if it is there some one please help me.
like i want to get the values of 10 th row.
with regards,
susa
|
|
|
|
|
SELECT TOP 1 * FROM (SELECT TOP 10 * FROM tablex ORDER BY columnx DESC) AS aliasx ORDER BY columnx ASC
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
|
Hi Friend,
If U want to get the 10th Row:
------------------------------
SELECT TOP 1 * FROM
(SELECT top 10 * FROM TABLENAME ORDER BY NUMERICCOLUM) AS SUBS
order by NUMERICCOLUM desc
If U want to get the 12th Row:
------------------------------
SELECT TOP 1 * FROM
(SELECT top 12 * FROM TABLENAME ORDER BY NUMERICCOLUM) AS SUBS
order by NUMERICCOLUM desc
With Regards,
Pandian S
|
|
|
|
|
Hello. I have 2 table. I wrote below codes but after delete command parent row have been deleted but chid rows haven't been deleted from "B" table. Is there any wrong thing for relation or delete automation?
Thanks a lot.
fkc = new ForeignKeyConstraint("FKC", ds.Tables["A"].Columns["A2"], ds.Tables["B"].Columns["B2"]);
ds.Tables["B"].Constraints.Add(fkc);
fkc.AcceptRejectRule = AcceptRejectRule.None;
fkc.DeleteRule = Rule.Cascade;
fkc.UpdateRule = Rule.Cascade;
ds.EnforceConstraints = true;
ds.Relations.Add("REL", ds.Tables["A"].Columns["A2"], ds.Tables["B"].Columns["B2"]);
|
|
|
|
|
Hi guy -
I think you have several problems here. (I just went through some of this stuff myself.)
1. AcceptRejectRule.None means that when you call ParentRow.AcceptChanges() it will not be propagated (passed on) to the child table. You ARE calling ParentRow.AcceptChanges() at some point, right?
I think what you want is AcceptRejectRule.Cascade
Either that or you will just have to call AcceptChanges() on the child table explicitly.
2. pirogramci wrote: ds.Relations.Add("REL", ds.Tables["A"].Columns["A2"], ds.Tables["B"].Columns["B2"]);
This format of the statement automatically creates a foreign key constraint named the same as the relation, with potentially conflicting rules from the ForeignKeyConstraint "FKC" you explicitly created. (I don't remember what the defaults are, but I think it's None.)
Use this instead: ds.Relations.Add("REL", ds.Tables["A"].Columns["A2"], ds.Tables["B"].Columns["B2"] ,FALSE);
so that it will not create the additional FK constraint and conflict with the one you already created.
I think that *should* fix it... Good luck.
|
|
|
|
|
Got a simple table in the database which has two columns:
TableName: nchar(30) [Primary Key]
Index : int
The contents of this table are temporarily stored in a Dictionary<string, int> object during the program where some modifications are made, later on they are updated back to the database. All goes well apart from two rows of the 37 which some characters are lost. E.g. the two in question are:
MajorNonConformityReport -> MajorNonConformityRe
GoodsInwardThroughput -> GoodsInwardThroughpu
Any ideas on why this is happening, the update code which is a simple UPDATE T-SQL command has the TableName and Index inserted via parameters, by stepping through the code the parameters are input correctly.
Any ideas on what may be causing this? Before you ask, I don't have access to SQL Profiler, I have been given a workstation with VS2005 and access to the database on the server (running SQL 2005 WorkGroup edition).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
That looks remarkably like somthing somewhere is treating the table name as nChar(20), not nChar(30), since they are both being truncated.
Are you sure that the parameters are declared correctly?
Steve S
Developer for hire
|
|
|
|
|
Yes parameters are being declared properly, I double checked all of that but I will double check it tomorrow when I get back (in case I fell asleep at the computer and dreamed it).
It might be that since it appears to be happening "randomly".
I've got a work around at the moment, I've abbreviated the names which is quite apt since "GoodsInwardThroughput" has been abbreviated to "GIT" .
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Hey I am using TripleDES encryption 192bit key algorithm to encrypt my data...Now i have got a doubt like if my password datatype length is only 10 chars. Then how much space or length do i need to allocate in database table for this field when i am using 192bit alogrithm...
Please help.
|
|
|
|