|
hey ,
im working on a project which involve oracle database , untill now i was testing my application when the app and the oracle server are on the same box and it was working great, but now when im trying to test the application on a different box it is a failure,
when trying to establish connection with database i get : "ORA-12514: TNS:Listener does not currently know of service..."
the connectionString looks like this:
String connstr = "server=" + Properties.Settings.Default.dbHostName +
";Persist Security Info=True;User ID=" + Properties.Settings.Default.dbUserName +
";Password=" + Properties.Settings.Default.dbpass +
";Unicode=true;";
all the info in the properties is 100% correct when i get the error...
i can ping the target machine normaly
and i get this on the oracle server Listener.log file:
19-AUG-2007 08:54:52 * (CONNECT_DATA=(SERVICE_NAME=192.168.2.100)(CID=(PROGRAM=C:\Documents and Settings\Udi\Desktop\Udi DeskTop\FileHelpersTest.exe)(HOST=PILOY-3EC14114C)(USER=Udi))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.101)(PORT=3662)) * establish * 192.168.2.100 * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
when i connect on the computer which the server is installed on successfuly it looks like this:
19-AUG-2007 08:44:56 * (CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=C:\Documents and Settings\Udi\My Documents\Visual Studio 2005\Projects\FileHelpersTest\FileHelpersTest\bin\Debug\FileHelpersTest.vshost.exe)(HOST=TEHUB3R-BCEDAD0)(USER=Udi))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.100)(PORT=1176)) * establish * XE * 0
i think when i connect on the remote computer i dont set the SID
but i didnt find any way of setting the SID , dont know if its possible at all,
Any help is more than welcome i was googling for 10 hours about this
alot of stuff about the error but nothing that made sense to my problem
thanks.
Net
|
|
|
|
|
Hi
first of all this doesn't have anything to do with c#. it's a Database question and should be asked in the Database Section.
you must use the "net configuration assistant" to create a local alias of the remote service. if you use the oracle .net components(provided with the oracle client software) for your connection, your connection string should look like "User ID=" + Username + ";Password=" + Password + ";Data Source=" + LocalAlias
greets
M@u
|
|
|
|
|
hey thanks for the fast reply , sorry for posting it here i thought its something to do with syntax , anyway i was configuring my tnsnames.ora
with the net conf assistant...
i made an alias that looks like this:
ORACLESERVER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.100)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = xe)
)
)
when i do tnsping oracle server this are the results:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.2.100)(PORT = 1521))) (CONNECT_DATA = (SERVER = SHARED) (SERVICE
_NAME = xe)))
OK (20 msec)
but when im trying to establish connection via my application
(the project im working on )
i get the folowing error:
ora-12154: TNS:could not resolve the connect identifier specific
on the connection string i was using Data Source="oracleserver";......
Net
|
|
|
|
|
hmm.. what happens when you remove "(server = dedicated)" for OracleServer in the tnsnames.ora?
|
|
|
|
|
The same error occures also i may add trying
to connect with sqlplus generate the same error
Net
|
|
|
|
|
oops sorry my fault we should both better read what oracle says
your oracle ping says "server=shared"
so try to change the "server=dedicated" to "server=shared"
|
|
|
|
|
oooh it was my fault i was posting a ping when i was testing
a shared connection and posted the tnsnames.ora when i was testing a dedicated connection.....basicly i was trying all the possible ways to connect and it generate same error
man thank you realy much for your time!! , its faster than msn messenger :P
*MODIFY* : oh i was trying this testservice tool in the oracle net manager i managed to connect to my server from this tool using the
"oracleserver" service that i have created ,
maybe that info helps
-- modified at 10:27 Sunday 19th August, 2007
Net
|
|
|
|
|
ok.. the ping said "using tnsnames to resolve blah blah blah..." as far as i know these tools do not look at the sqlnet.ora. did you configure the naming methods (second option in the net configuration assistant)? default is only local. you must tell it to use tnsnames also.
|
|
|
|
|
yea i did set the sqlnet.ora currently it looks like this:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES)
*MODIFY*:OK i FOUND A TEMPORARY SOLUTION!
i found out that you can set
Data Source="[hostname]/[servicename]"....
so i changed the code to DataSource="192.168.2.100/xe"
and i managed to connect via lan........ but still its anoying that i cant make that damn alias to work
THANKS FOR THE HELP!!!!
if you got any other ideas how to make it work i'll be glad to hear
thanks again
*
-- modified at 11:14 Sunday 19th August, 2007
-- modified at 11:19 Sunday 19th August, 2007
Net
|
|
|
|
|
how can i find which day of week today is.
i.e if today is Sunday then it should return 1
the problem is if it returns day of week in another language
for e.g in German they call Sunday as sonntag.
|
|
|
|
|
As far as I know all calenders in System.Globalization returns DayOfWeek property as a DayOfWeek Enumaration So no language would affect it.
and casting the DayOfWeek to integer gives something like this
Sunday=0,Monday=1,...,Saturday=6
int dayNum=(int)DateTime.Now.DayOfWeek+1;
good luck
|
|
|
|
|
I have a C# service that communicates to a USB flash drive. Since my program is smart enough to know when the drive is plugged in and when it's not, I don't need to have XP open the "Autorun" dialog window asking me what application to run when the drive is plugged in.
Can I somehow kill this window from my C# app? I would like to do it this way because if my application is NOT running, I DO want the XP autorun dialog to display giving users the option to install the application.
Any advice would be appreciated!
Thanks,
Barry
Barry Etter
|
|
|
|
|
You can disable it through registry
const int DISABLEALL = 0xff;
const int DISABLEALLEXECPTCDROMS = 0xdd;
const int DISABLECDROM = 0xb1;
RegistryKey key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("Policies").OpenSubKey("Explorer", true);
key.SetValue("NoDriveTypeAutoRun", DISABLEALLEXECPTCDROMS);
}
code for disable AutoRun for all devices is 0xff
and disable AutoRun for all devices except CD-Roms is 0xdd
disable just for CD-Roms is 0xb1
and the changes would be applied after restart
Good Luck
|
|
|
|
|
Good evening everyone,
As the subject says, I wonder if there's a possibility to add a column to a datagrid control that calculates (count, sum, or average) multiple columns or rows..
Please advise
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
You have complete control over the datagrid, so yes, there is a way to add a totals column.
One way would be to add it to your query.
SELECT field1, field2, SUM(field3) FROM...
Another way would be to handle the databinding events and populate the column at runtime.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote:
SELECT field1, field2, SUM(field3) FROM...
Call me an idiot but tell me this's not creating me a totals row (not column)
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
If you had a table with this structure
col1 col2
1 2
10 20
20 30
then SELECT col1, col2, SUM(col1,col2)...
would produce this:
1,2,3
10,20,30
20,30,50
Of course this only gives you the totals for the rows selected. If you want some other sort of total, then adjust the SQL statement, maybe MAX, or AVE, or whatever is needed.
only two letters away from being an asset
|
|
|
|
|
If you are using a DataSet as data source then you can add an expression column to it.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
hi all,
iam working on directx.capture class library, iam not able to run the sample code included in the zip file. i get the above error at
private Filters filters = new Filters();
please somebody help me with this. iam using vs2005 express edition
Thanks in advance
|
|
|
|
|
Hi
I have this Sql Authentication connection string which has a username and password.
I added this connection string to Application Settings and the corresponding app.config item
was added to my project automatically. But now that i want to access the app.config file
in my codes,ConfigurationSection,ConfigurationManager and other related classes,properties and methods
are not available.I read many articles on this subject but i havent been able to do the encryption so far.
The other question is wether the encryption needs to be done once or should it be done every time
the application runs? Is it be possible to set this encrypted connection as a SqlConnection's connection
string or the assignment must be done prior to encryption?
please help!
thanks
|
|
|
|
|
try this
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2010907&SiteID=1&pageid=0#2010907
|
|
|
|
|
I have a WinForms MDI app that has a docked navigation panel at the left edge. However, when I create MDI child windows, the main window seems to ignore the presence of the navigation panel and uses its entire client area to layout the child windows. Is it possible to override the MDI container's layout logic and reduce its client area by the space occupied by the navigation panel?
I tried doing this in the main window's Load handler, but it didn't seem to have any effect. (I understand that this would only set the initial client area, which may need to be recomputed in a SizeChanged handler).
private void MainFrm_Load
(object sender,
EventArgs e)
{
NavigatorFrm nf = new NavigatorFrm();
nf.MdiParent = this;
nf.Dock = DockStyle.Left;
nf.Show();
this.ClientSize = new Size (this.ClientSize.Width - nf.Width, this.ClientSize.Height);
}
Thanks,
/ravi
|
|
|
|
|
If you get an answer to this, I'd be interested to find out how to do it.
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
If still anyone is looking for this, just override the control's DisplayRectangle property. Just mentioned as I was looking for the same till a few days ago.
|
|
|
|
|
Hi,
I want to display a description of the item being hovered over, how would i do this please.
|
|
|
|