473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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(string a, string b,string
c)
{
string strConn;
if(c.Length !=0)
{
strConn = c;
}
else
{
strConn = "Data Source=" + a +";Initial Catalog=" + b +
";Integrated Security=SSPI;";
/* string strConn = "Integrated Security=SSPI;Initial Catalog = " +
c +
";Data Source=" + a + ";";*/
}
System.Windows.Forms.MessageBox.Show(strConn);
SqlConnection objConnection = null;
try
{
objConnection = new SqlConnection(strConn);
objConnection.Open();
}
catch(Exception ex)
{
objConnection = null;
System.Windows.Forms.MessageBox.Show("Fout bij verbinden : " +
ex.Message,"Connection fout");
}
finally
{
if (objConnection != null)
{
objConnection.Close();
}
}
return objConnection;
}
================================================== =====================
The select statement I use is = SELECT MachineName FROM CounterDetails
GROUP BY MachineName

My ConnectionString is = "Data Source=" + a +";Initial Catalog=" + b +
";Integrated Security=SSPI;" (a = servername) (b = databasename);

My domainaccount has the dbowner role on the database. And
serverconnection 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(SqlConnection objConnection,
SqlDataAdapter objAdapter, string strQuery)
{
objConnection.Open();
System.Windows.Forms.MessageBox.Show(strQuery);
objAdapter.SelectCommand = new SqlCommand(strQuery,objConnection);
DataSet objDataSet = new DataSet();
try
{
objAdapter.Fill(objDataSet,"x");
objConnection.Close();
}
catch(Exception ex)
{
System.Windows.Forms.MessageBox.Show("SQL: " + ex.Message,"SQL
fout");
}
finally
{
if (objConnection != null)
{
objConnection.Close();
}
}
return objDataSet;
objDataSet.Dispose();
}
}
================================================== =====================

Nov 17 '05 #1
2 1776
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.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.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(string a, string b,string
c)
{
string strConn;
if(c.Length !=0)
{
strConn = c;
}
else
{
strConn = "Data Source=" + a +";Initial Catalog=" + b +
";Integrated Security=SSPI;";
/* string strConn = "Integrated Security=SSPI;Initial Catalog = " +
c +
";Data Source=" + a + ";";*/
}
System.Windows.Forms.MessageBox.Show(strConn);
SqlConnection objConnection = null;
try
{
objConnection = new SqlConnection(strConn);
objConnection.Open();
}
catch(Exception ex)
{
objConnection = null;
System.Windows.Forms.MessageBox.Show("Fout bij verbinden : " +
ex.Message,"Connection fout");
}
finally
{
if (objConnection != null)
{
objConnection.Close();
}
}
return objConnection;
}
================================================== =====================
The select statement I use is = SELECT MachineName FROM CounterDetails
GROUP BY MachineName

My ConnectionString is = "Data Source=" + a +";Initial Catalog=" + b +
";Integrated Security=SSPI;" (a = servername) (b = databasename);

My domainaccount has the dbowner role on the database. And
serverconnection 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(SqlConnection objConnection,
SqlDataAdapter objAdapter, string strQuery)
{
objConnection.Open();
System.Windows.Forms.MessageBox.Show(strQuery);
objAdapter.SelectCommand = new SqlCommand(strQuery,objConnection);
DataSet objDataSet = new DataSet();
try
{
objAdapter.Fill(objDataSet,"x");
objConnection.Close();
}
catch(Exception ex)
{
System.Windows.Forms.MessageBox.Show("SQL: " + ex.Message,"SQL
fout");
}
finally
{
if (objConnection != null)
{
objConnection.Close();
}
}
return objDataSet;
objDataSet.Dispose();
}
}
================================================== =====================

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
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...
5
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...
7
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...
9
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...
1
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! ...
0
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 --->...
0
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 --->...
0
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...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.