|
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
|
|
|
|
|
Hell all,
i have developed an application say inventory management in vb.net/ ms sql. now i want to install this application on different machines of my clients. i have written maximum code in Sp's and have fear that some one copy it or edit/delete it.
kindly suggest me a best way in which no one copy my database or edit/copy/delete it.
thanks in advance
rmshah
Developer
|
|
|
|
|
That's a big reason not to use stored procedures.
If it's your client's system, you can't lock them out from doing silly things to it, yet you will likely be responsible for repairing any damage they do.
At best you could have a written agreement that clearly states what happens when they screw up the system.
I've was only required to write stored procedures for one client, and it as dreadful.
|
|
|
|
|
PIEBALDconsult wrote: That's a big reason not to use stored procedures.
Not really. The user can just as easily go in and update the tables without.
PIEBALDconsult wrote: At best you could have a written agreement that clearly states what happens when they screw up the system.
Thats a more common way.
At the end of the day, if the database is on your clients server, there is very little you can do to stop them screwing it up, so having a good, watertight, written agreement of responsibilities is probably the best way - if they are fully aware of the consequences then they probably won't.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Don't give database to the users. Keep it in a secured server. Create a web service/WCF service which provides access to this database from your application. This helps to keep database isolated and prevent users from modifying the SPs.
Another alternative(worst) what I think is to create the stored procedure with WITH ENCRYPTION clause. This will make the SPs encrypted, but there is no easy way to decrypt it back. Again, this will not prevent users from dropping it.
|
|
|
|
|
Hi evryone
I have some Oracle Question
1. I build DataBase on SQL server (Table's and view's) is it posible
to transfer to Oracle ? if yes - How ?
2. I build C# program that work's whit SQL server, I need to work
whit Oracle, is the code will fix ?
thank's for any help
|
|
|
|