|
Turn your caps off - it is the equivalent of walking up to someones desk and SHOUTING in their ear. It is also really painful to read!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes, its called an UPDATE
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
mu question is on clicking the same button can we add the data with same id . for update we have to use other button.
|
|
|
|
|
why not you create a extra variable which hold the ID of the department. set -1 for new department. If you edit any saved department, then replace -1 to ID of saved department. And finally on button click, check whether variable is equal to -1 then use insert query, otherwise use Update query
|
|
|
|
|
This is a somewhat stupid question, it all depends on your database design - if the id is a primary key then no, otherwise yes.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I'm using IReport and I'm trying to connect to the database on the server from my home computer. It works fine when I connect from my work computer that is on the same network as the server but it fails from home.
I checked on everything, firewall is turned off on the server, all sql server services are running, The tcp/ip port 1433 is enabled and sql server authentication is enabled on sqlexpress.
The url is: jdbc.sqlserver:// serverIpAddress:1433;DatabaseName=mydatabase
It connects from my work pc, but at home it doesn't. Am I missing something?
modified on Thursday, February 26, 2009 2:55 AM
|
|
|
|
|
I think you just committed hari kari, I have not heard of someone attempting this for at least a decade, your exposure is extreme and there are automated systems that test 1433 for open connections.
Having said that you may be lucky and the IP you are using is the local one on your office network and not a publicly accessible IP address. If you want to connect to your office SQL server then do it via web services not directly.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How do I find out which ip address to use in the url??
I'm using windows server 2003
|
|
|
|
|
No idea - as I said a decade since I have seen this done and it has moved on since then.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I now understand that I'm connecting to the ip address that the server and clients have locally which is not necessarily the same as the ip address that the remote database will see..
|
|
|
|
|
how to connect with database when entered select query is correct
|
|
|
|
|
me_aaryan wrote: how to connect with database
use appropriate connection string for connect to database
me_aaryan wrote: when entered select query is correct
select query is used to select the data from database, not for connect to database
Your question is confuse me .
can you post more detail ?
|
|
|
|
|
i mean when the query is right then data should be dispalyed and to display i need to connect
|
|
|
|
|
what is the query and what is the language.
can you provide some code snippet and elaborate how you perform the task?
|
|
|
|
|
You really are an idiot, you have asked the same question 3 times over the last month. You have no understanding of the question you are asking and therefore cannot understand the answers so you keep repeating the question, like a 5 year old.
Remove your self from the forum until you get some more sense.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I am having database table as TicketNo,Name,Issue Date. I inserted the data for "IssueDate" field using calender control in Asp.Net.
So the table data looks like this
TicketNo Name IssueDate
1 xxx Feb 5 2009 12:00AM
2 yyy Feb 6 2009 12:00AM
3 zzz Feb 10 2009 12:00AM
4 aaa Feb 15 2009 12:00AM
Now i want to write the query to select "IssueDate" between 02/04/2009 and 02/11/2009.
Please Can anybody help me how to write query to retrieve the data between those dates?
Thanks
Pavani
|
|
|
|
|
pavanip wrote: select "IssueDate" between 02/04/2009 and 02/11/2009.
almost had it in your question
Select * from Tablename where IssueDate Between '02/04/2009' and '02/11/2009'
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I tried with that query but when i execute that query i am getting zero results but there are records in my table with that dates. I stored date value in varchar is it correct or i have to use only datetime datatype.
|
|
|
|
|
You need to store the date as a date.
Why people store dates in a character field is totally beyond me.
|
|
|
|
|
As Jamie said, mistake 1 STORE YOUR DATES AS DATE TIME.
So now that your have screwed your data you have 2 choices.
Convert the dates from varchar to datetime - this is the recommended solution
Make all the date values into datetime in your query.
Select * from table name where convert(datetime,Stupiddate) between thisdate and thathdate
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for your response that query is working for my condition.
Select * from tbl_ticketinfo where convert(datetime,issuedate) between '" 02/05/2009' and '02/09/2009'
|
|
|
|
|
select * from table where issueDate BETWEEN CONVERT(varchar, '2009-02-04', 111) AND CONVERT(varchar, '2009-02-11', 111)
|
|
|
|
|
I tried with this query
select * from table where issueDate BETWEEN CONVERT(varchar, '2009-02-04', 111) AND CONVERT(varchar, '2009-02-11', 111)
but when i execute that query i am getting zero results but there are records in my table with that dates. I stored date value in varchar is it correct or i have to use only datetime datatype.
|
|
|
|
|
Rupesh
Wrong way - you are converting to varchar and comparing strings, you need to convert to datetime to use between!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How to connect to multiple databases (like SQL server, mysql, oracle) through Java code.
Thanks,
Nirmala
|
|
|
|