|
Weird!! thats really weird!
SInce you can't show the code, its really difficult to say anything for sure. but may be there is some problem with ur code when it refreshes the data in whatever control your using to display the data. Perhaps try emptying the datatable and then filling it again after an update opration and see what it does
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Hi
I have to upload PDF files in database. I am uploading PDFs as stream and inserting into a column of varbinary(max) type. A column also to store file type.
So my database Table looks like
docs(PDFStream,filetype).
Here "PDFStream" is varbinary(max)
"filetype" is varchar(10)
I have the Full Text Index created on the table "docs".
my problem is when I execute the following
SELECT PDFStream
FROM Docs
WHERE FREETEXT (PDFStream, 'EQUIPMENT')
Does not fetch any result. But I have uploaded the PDF file with a line '........EQUIPMENT SALE AGREEMENT ......' ( dots here are just indicates other texts )
Any idea where I am going wrong ???
Any help will be appreciated.
Thanks,
Arindam D Tewary
|
|
|
|
|
I would guess that WHERE FREETEXT (PDFStream, 'EQUIPMENT') does not work because of the encoding maybe. Does WHERE FREETEXT (CAST(PDFStream as nvarchar(max)), 'EQUIPMENT') work.
//I have never used varbinary and freetext so this advice comes with no warranty.
Dave Evans
|
|
|
|
|
Hi,
I am updating (not inserting) certain Excel sheet data to my SQL Server database. So I have Excel as source file & SQLServer 2000 as my destiination.
In the Transformation tab of "Transform Data Task" properties window I have written my customised logic to update excel sheet data to a particular table.
When I test my logic (by clicking the Test button of ActiveXScript window of "Transform Data Task"), the data gets updated without any error. But when I try executing this package, it gives me following error : "Cannot insert NULL value in column 'TestID', table 'TestTable'; column doesnot allow NULLS. Insert fails".
I really cant get hold of this weird DTS error as I am just updating a particular column of a particular table.
Additional Information:
1) 'TestID' column's Identity property has been set to No
2) There is no trigger written for that particular table
Kindly let me wat might be the reason behind this problem
Regards,
Vipul Mehta
Sr. Software Engineer
Accenture Services Pvt Ltd
|
|
|
|
|
Hi,
Further to my issue I found out that if I update 100 records from excel sheet to SQL DB table (by writing customise logic in ActiveXScript), after updating the proper fields it then inserts that 100 records in to that table.
Why does that try to insert again all the 100 records of my excel sheet to the SQL table?
Regards,
Vipul Mehta
Sr. Software Engineer
Accenture Services Pvt Ltd
|
|
|
|
|
i have username and password fields in my table,
i jus want to write a query to check whether the given details of user matches with the database.
please gimme the query
|
|
|
|
|
Something like (this may not be the best way, but a quick answer to say the least):
SELECT * FROM <TABLENAME> WHERE USER = 'JOHN' AND PASS = 'MYPASS'
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
not like that........
wat i mean to say is.......
i have alogin page where user enters his/her username and password
i have to check the data with database and redirect the user to corresponding next page for the i need a query.
|
|
|
|
|
bhattiprolu wrote: i have to check the data with database and redirect the user to corresponding next page for the i need a query
I cant see what the problem is, because after the select statement you will have all data specific to that user, so redirecting the user to the correct page should be a breeze. Just pass the information of the user to the next page. Unless I'm totlally mis-understanding you.
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
can u gimme the query.....
|
|
|
|
|
HE DID!!
He gave you this:
SELECT * FROM <TABLENAME> WHERE USER = 'JOHN' AND PASS = 'MYPASS'
But since you've told us nothing about your database structure it may not be correct.
If you want more help you'll have to help us understand your problem. Repeating the same statements over and over again do not help. You need to give us more information.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
bhattiprolu wrote: not like that........
Your original post said:
i have username and password fields in my table,
i jus want to write a query to check whether the given details of user matches with the database.
please gimme the query
What other answer could you expect from that?!
bhattiprolu wrote: i have to check the data with database and redirect the user to corresponding next page for the i need a query.
You mentioned nothing about login pages or redirecting users. How were we supposed to know, especially since you posted this in the "SQL" forum?
If you've got the data and youre question is about ASP.NET post in the appropriate forum.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
SELECT * FROM <tablename> WHERE USER = 'JOHN' AND PASS = 'MYPASS'
this is the write query...
now if u r using c# or vb.net
get result of this query in datareader and dataadaptor..
if any row returns that means username and password is correct... then redirect to the other page..
|
|
|
|
|
They Already gave u the right Query..if u're try to implement that query in your
apps just change the where value, ex :
<br />
Select * From [my_table] WHERE username = '" +UserText.Text+ "' AND password = '" +PasswdText.Text+ "'<br />
wat else do u need they gave u the right query u need
Regards,
Tomi
|
|
|
|
|
TomiEdy wrote: Select * From [my_table] WHERE username = '" +UserText.Text+ "' AND password = '" +PasswdText.Text+ "'
Then get ready for a SQL Injection Attack with code like that!
Please read: SQL Injection Attacks and Tips on How to Prevent Them[^]
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
Hi all,
I would like to know whether one uses the to_date function in a update statement aswell, as one would in a insert statement (when making use of a Oracle Database).
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I make use of the 'to_date' function everywhere. Whether it's a 'select', 'insert', 'update' or even a 'delete' statement, you can use a function call just about anywhere.
Do you have a specific instance that is giving you an error or problem?
Chris Meech
I am Canadian. [heard in a local bar]
|
|
|
|
|
Hello guys..
Looks like I just need a litle help on my SQL syntax in C#.NET
I have a field in my database which is DateTime type. Looks like I can't get the syntax right for comparing the value from the textBox with the field in database.
Now what I have looks like:
<br />
DateTime ShDate = DateTime.Parse(txtDate.Text);<br />
cmd1.CommandText = "SELECT ShipedDate FROM Details WHERE Details.ShipedDate = #ShDate#";<br />
When I fill dataset with the adapter which has this SelectCommand it will report error in date in the syntax expresion. Now the variable ShDate has a DateTime type in C# and it stores a date from the textbox with a help of conversion and it is in a correct format(I cheked while debuging).
I think the problem is somewhere here = #ShDate# . I bet I am missing some quotation marks ("") or single quote('').
So does any one have a clue?
Thanks..
|
|
|
|
|
Hi,
I think you are just now migrating from MS-Acccess.
When comparing date in SQL Server no need of "#".
Just simply " = ShDate " is enough.
Senthil
|
|
|
|
|
Can you try this out...
DateTime ShDate = DateTime.Parse(txtDate.Text);
cmd1.CommandText = 'SELECT ShipedDate FROM Details WHERE Details.ShipedDate =%' + ShDate + '%';
See if it helps.
Thanks!
Santhosh
Santhosh Kumar Edukulla
|
|
|
|
|
Apologies, ignore my previous post..
Try this
DateTime ShDate = DateTime.Parse(txtDate.Text);
cmd1.CommandText = 'SELECT ShipedDate FROM Details WHERE Details.ShipedDate like' + '''' + '%' + ShDate + '%' + '''';
I tried it on my sql box and it worked.
Hope this helps
Thanks!
Santhosh Kumar Edukulla
|
|
|
|
|
I'm looking to develop an application that will require a small database table structure (not more then 4-5 tables). I wanted to make the database internal to the application so that there wouldn't have to be a link out to a web server/SQL server anywhere, but with just receiving a new datafile to replace the old one, it would be able to pick it up. Is there any code/project type in Visual Studio that would allow me to create such a database that could be deployed with the application and be able to be queried with a SQL/Oracle type interface/query? I am open to writing the application in either Visual Basic or Visual C++.
|
|
|
|
|
|
I will look into it, but from a quick glance, it may just be that. Thank you very much.
|
|
|
|
|
Hi All
I Finished Deployment windows application and i will to setup it in the customer
My database is SqlSERVER 2005
I Used SqlServer EXPRESS 2005 to set the Backup of data base on it in the pc of customer
the Server is Mixed MOde
when I Running my Application The is give me this the Exeption
(An Erorr occurred while establishing aconnection to SQL Server 2005 , this failure may be caused by the fact that under the defult Settings SQL Server does not allow remote Connection (Provider :SQL Network Interface error :26-Error locating Server/Interface Specified))
what is the solve for this Problem ??
thanks for all Hellp me
Thaer
|
|
|
|