473,760 Members | 8,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

invalid object sql error. maybe security??

I am developing a C# windows application which will act as an frontend
for a SQL 2000 database.
I am using a laptop with SQl 2000 workgroup edition (sp4). SQL is setup
to use windows authentication.
When I use my application on my laptop everything works.
When I use my application on a SQL server (SQL 2000 enterprise sp4) in
my organisation I get the error : "invalid object <tablename>"

The database is a database generated by logman.exe and filled with
performance/capacity figures. The database structure is always the
same.
I am using the following code for the connection:
=============== =============== =============== =============== ==========
public static SqlConnection GetConnection(s tring a, string b,string
c)
{
string strConn;
if(c.Length !=0)
{
strConn = c;
}
else
{
strConn = "Data Source=" + a +";Initial Catalog=" + b +
";Integrate d Security=SSPI;" ;
/* string strConn = "Integrated Security=SSPI;I nitial Catalog = " +
c +
";Data Source=" + a + ";";*/
}
System.Windows. Forms.MessageBo x.Show(strConn) ;
SqlConnection objConnection = null;
try
{
objConnection = new SqlConnection(s trConn);
objConnection.O pen();
}
catch(Exception ex)
{
objConnection = null;
System.Windows. Forms.MessageBo x.Show("Fout bij verbinden : " +
ex.Message,"Con nection fout");
}
finally
{
if (objConnection != null)
{
objConnection.C lose();
}
}
return objConnection;
}
=============== =============== =============== =============== ===========
The select statement I use is = SELECT MachineName FROM CounterDetails
GROUP BY MachineName

My ConnectionStrin g is = "Data Source=" + a +";Initial Catalog=" + b +
";Integrate d Security=SSPI;" (a = servername) (b = databasename);

My domainaccount has the dbowner role on the database. And
serverconnectio n goes ok!
The only strange thing I see in the eventlog is that my authentication
to the corporate SQL server is performed by NTLM. Why not by kerberos??
When I use a access frontend I always see Kerberos events in the
eventlog. Could this be a security issue? Or am I using the wrong
query?

code for query:
=============== =============== =============== =============== ===========
public static DataSet ExecuteQuery(Sq lConnection objConnection,
SqlDataAdapter objAdapter, string strQuery)
{
objConnection.O pen();
System.Windows. Forms.MessageBo x.Show(strQuery );
objAdapter.Sele ctCommand = new SqlCommand(strQ uery,objConnect ion);
DataSet objDataSet = new DataSet();
try
{
objAdapter.Fill (objDataSet,"x" );
objConnection.C lose();
}
catch(Exception ex)
{
System.Windows. Forms.MessageBo x.Show("SQL: " + ex.Message,"SQL
fout");
}
finally
{
if (objConnection != null)
{
objConnection.C lose();
}
}
return objDataSet;
objDataSet.Disp ose();
}
}
=============== =============== =============== =============== ===========

Nov 17 '05 #1
2 1794
Hi,

That's probably cause the user that created the object is different from the
one trying to use it now:
1- Go to enterprise manager , your DB, tables and see who is the owner of
the table
2- access the table using [db_user].tablename
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"mpriem" <sp**@mpriem.co m> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
I am developing a C# windows application which will act as an frontend
for a SQL 2000 database.
I am using a laptop with SQl 2000 workgroup edition (sp4). SQL is setup
to use windows authentication.
When I use my application on my laptop everything works.
When I use my application on a SQL server (SQL 2000 enterprise sp4) in
my organisation I get the error : "invalid object <tablename>"

The database is a database generated by logman.exe and filled with
performance/capacity figures. The database structure is always the
same.
I am using the following code for the connection:
=============== =============== =============== =============== ==========
public static SqlConnection GetConnection(s tring a, string b,string
c)
{
string strConn;
if(c.Length !=0)
{
strConn = c;
}
else
{
strConn = "Data Source=" + a +";Initial Catalog=" + b +
";Integrate d Security=SSPI;" ;
/* string strConn = "Integrated Security=SSPI;I nitial Catalog = " +
c +
";Data Source=" + a + ";";*/
}
System.Windows. Forms.MessageBo x.Show(strConn) ;
SqlConnection objConnection = null;
try
{
objConnection = new SqlConnection(s trConn);
objConnection.O pen();
}
catch(Exception ex)
{
objConnection = null;
System.Windows. Forms.MessageBo x.Show("Fout bij verbinden : " +
ex.Message,"Con nection fout");
}
finally
{
if (objConnection != null)
{
objConnection.C lose();
}
}
return objConnection;
}
=============== =============== =============== =============== ===========
The select statement I use is = SELECT MachineName FROM CounterDetails
GROUP BY MachineName

My ConnectionStrin g is = "Data Source=" + a +";Initial Catalog=" + b +
";Integrate d Security=SSPI;" (a = servername) (b = databasename);

My domainaccount has the dbowner role on the database. And
serverconnectio n goes ok!
The only strange thing I see in the eventlog is that my authentication
to the corporate SQL server is performed by NTLM. Why not by kerberos??
When I use a access frontend I always see Kerberos events in the
eventlog. Could this be a security issue? Or am I using the wrong
query?

code for query:
=============== =============== =============== =============== ===========
public static DataSet ExecuteQuery(Sq lConnection objConnection,
SqlDataAdapter objAdapter, string strQuery)
{
objConnection.O pen();
System.Windows. Forms.MessageBo x.Show(strQuery );
objAdapter.Sele ctCommand = new SqlCommand(strQ uery,objConnect ion);
DataSet objDataSet = new DataSet();
try
{
objAdapter.Fill (objDataSet,"x" );
objConnection.C lose();
}
catch(Exception ex)
{
System.Windows. Forms.MessageBo x.Show("SQL: " + ex.Message,"SQL
fout");
}
finally
{
if (objConnection != null)
{
objConnection.C lose();
}
}
return objDataSet;
objDataSet.Disp ose();
}
}
=============== =============== =============== =============== ===========

Nov 17 '05 #2
thanks, I will try that.
Another question:

When I use my access frontend I can see Kerberos events in the SQL
server eventlog.
When I use my c# frontend it is NTLM..
I cannot see the code behind the Access frontend because its a mde.

On my production workstation I am part of a w2k3 domain as is my sql
server. Why doesn't SSPI use the Kerberos provider??

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3998
by: mcmg | last post by:
Hi, I have an asp app that works fine on a windows xp machine but does not work on a windows 2000 server. I have the following code in my global.asa: <OBJECT RUNAT=Server SCOPE=SESSION ID=MyID
5
3434
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS 5), but fails on IIS 6 running on a Win2003 server. The web uses Pages derived from a custom class I wrote (which itself derives from Page) to provide some common functionality. The Page_Load handler the failing webpage starts out like this: ...
7
1526
by: Keith Norris | last post by:
I cannot successfully create a connection object in a web form. In the page_load event I try the following code: Dim sConnection As String = "server=MIDATLANTICUS;" & _ database=Pubs;integrated security=SSPI" Dim conTest As New SqlConnection conTest.ConnectionString = sConnection conTest.Open() conTest.Close()
9
6651
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its length is 642 bytes ( I have appended it to the end of this message). I suspect that the reason may have something to do with an incorrect declaration of which class to de-serialize to. In the attached code I substituted @@@@@@@ in the code below with...
1
2981
by: romiko2000 | last post by:
Hi Folks, I got a weird problem, I create an XMLWriter to post a document via the webrequest stream and after running a network trace, I notice the data is prefixed with 3 invalid characters! The invalid characters are: ef bb bf, at the top of the stream, which are . Why is this occuring, I am totally baffled by this? Here is the stream:
0
1582
by: aziza.shaikh | last post by:
Hi, I am using WSE 2.0 SP3. I am getting the following error when concurrent requests are made to the same web service. The signature or decryption was invalid ---> System.Security.Cryptography.CryptographicException: WSE523: The CipherData contents are invalid. at
0
2181
by: aziza.shaikh | last post by:
Hi, I am using WSE 2.0 SP3. I am getting the following error when concurrent requests are made to the same web service. The signature or decryption was invalid ---> System.Security.Cryptography.CryptographicException: WSE523: The CipherData contents are invalid.
0
3382
by: Amelyan | last post by:
Why does this happen? How to fix it? Once in a while I get error in ~/ScriptResource.axd?d=... System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at
2
2196
by: Amelyan | last post by:
Why does this happen? How to fix it? Once in a while I get error in ~/ScriptResource.axd?d=... System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at
0
10107
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9945
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8768
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7324
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.