.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cannot find table 0

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
Hope someone can help.  When the page loads I am able to click the add button and it moves the selected person from one dataset to the next.  If I then try to move another person I get the error message 'Cannot find table 0'.  I have changed the text to bold where the error occurs. Here is my codestring sourceUser = (string)HttpContext.Current.Session["TargetUserID"];System.Data.DataSet blank = new System.Data.DataSet();System.Data.DataSet ds = new System.Data.DataSet(); protected void Page_Load(object sender, EventArgs e){ if (lstCopyTargetUsers.Items.Count < 1) { if (Page.IsPostBack) { Sage.Platform.Data.IDataService service = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Data.IDataService>(); string connStr = service.GetConnectionString(); Sage.SalesLogix.Security.SLXUserService usersvc = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>(); Sage.Entity.Interfaces.IUser user = usersvc.GetUser(); string loggedinid = user.Id.ToString(); System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connStr); conn.Open(); System.Data.OleDb.OleDbCommand reps = new Syste

View Complete Post

More Related Resource Links

DTA doesn't find referenced table form stored procedure with SP_executesql

Using the SQL2008R2 profiler and DTA connected to a SQL2000 server. I created a tuning tracefile with profiler for a certain db on the sql2000 server because I need to tune 1 table in the database referenced by 3 parameterized stored procedures which built a query depending on the parameters and is executed with an sp_executesql statement. When I run the DTA loading the tracefile I see the exec stored procedure events with it's parameters and the message Event does not reference any tables. And that's it. The DTA generates no Recommendatioin at all. How can I get the exact sql statements in the tracefile so the DTA can do what he needs to do? Regards

I have 3 triggers defined on an sqlserver2008 table and I can't find them with c#

I've got the code below and when I run it, it always says there are 0 triggers in table.Triggers.  I added some debugging code checkin the table.HasDeleteTrigger, etc. and from that, I get the exception: "To accomplish this action, set property HasDeleteTrigger." when I try to set it to bool hasDeleteTrigger. I can get stored procedures find, just not triggers. Below is my problem code: foreach (Database database in databaseCollection) { if (database.Name.Equals(catalogName)) { // first we need to delete triggers associated with all tables that begin // with our prefix. we can skip our the framework tables because those // don't have triggers on them // grab all tables, filter for non prefixed ones in foreach loop so we can delete triggers from non prefixed ones results.AddRange(from Table table in database.Tables select table.Name); foreach (var tableName in results) { var table = new Table(database, tableName, CrSyncDbSchemaName); table.Refresh(); bool hasDeleteTrigger = table.HasDeleteTrigger; bool hasAfterTrigger = table.HasAfterTrigger; bool hasInsertTrigger = table.HasInsertTrigger;

I have added new fields to a table in SQLserver, why could not find these new fields in Analysis Ser

I have added new fields to a table in SQLserver, why could not find these new fields in Analysis Services database source view?  My version is 2005.

Duplicate records find in table

  Hi ALL, I want to find the dynamically check the primary key values and remove the duplicate records.. please suggest it.   Regards Ram

Cannot find Table 0

Hi all! Having a bit of an issue here where I'm getting the error "Cannot Find Table 0" when executing an INSERT INTO sql statement. The fishy part is that the code half works -- the new information is submitted to the database. Here the code in question:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Request.Form("TextColContent") = "" Or Request.Form("TextColTitleEN") = "" Or Request.Form("TextColTitleFR") = "" Then 'This is to display the information in the text areas (from database) Dim rst1 'As New DataTable Dim rst2 'As New DataTable Dim rst3 'As New DataTable rst1 = ExecSQLSelect("SELECT Top 1 News_Item_Content FROM r_BI_Welcome_News ORDER BY News_Item_ID DESC") rst2 = ExecSQLSelect("SELECT Top 1 News_Item_Title_EN FROM r_BI_Welcome_News ORDER BY News_Item_ID DESC") rst3 = ExecSQLSelect("SELECT Top 1 News_Item_Title_FR FROM r_BI_Welcome_News ORDER BY News_Item_ID DESC") formOpen.Text = "<FORM Action='add_news.aspx' Method='Post'>" textarea1.Text = "<TEXTAREA Rows=1 Cols=48 Name='TextColTitleEN'>" & rst2.Rows(0)("N

Find all tables that depend on table with FK column

I need to write a stored procedure that when passed the id of a row on a table, will query all tables that are referencing that row and move the data to another row.  I am doing this because we have 2 seperate systems that are linked by a table and sometimes things get out of whack and you have to manually move information over. I have this query that can find all the dependent tables, my question is what would I add to this to obtain the name of the column that is the foreign key on that tables.  SELECT o.name[parentTable], o2.name[childTable] FROM sys.sysobjects o INNER JOIN sys.sysforeignkeys fk ON fk.rkeyid = o.id INNER JOIN sys.sysobjects o2 ON o2.id = fk.fkeyid AND o2.id <> o.id WHERE o.name = 'tablename' I want to do this as a query because I want the procedure to be able to detect any new tables that might have been added.

How can I avoid error a Insert Store proc if he don't find any coloum in a table


I have created one Insert Proc for a table which has three Colourm. 

Id int, [Name] varchar (30), Phone varchar (15) I want to use this proc for another Table which has two coloum which is semiler with first table lie   Id int, [Name] varchar (30) I want to use one Insert Store Proc For two Table. I can avoid null value of parameter but but can't avoid if the coloum is not exist. 



Find '' in a table in MS SQL SERVER 2008



I need to find white spaces in my table. the table contains 35 columns, therefore, I cannot check with AND or OR operator something like this

SELECT * FROM MS_Exchange_IS WHERE (TMZDIFF != '' AND Timestamp != ''..........)

Also I don't want to use cursors as it will greatly hamper the performance of my application.

Please suggest any other option.


Any link or pointers would be helpful


Thanks in Advance,


Find out Distinct Rows in sql table


Hi All,

I have a one sql table, it contain 5 column 

id, ipaddress, status, datetime, value.

I need to find distinct rows as per ipaddress column basic..

Where can I find the Base Schema version Id for a particular table in SSMS


Where can I find the Base Schema version Id for a particular table in SSMS




how to find who had recently updated/delete the table



  i need to find who had updated or deleted the table in sql server 2000 ,please tell me the way to find it.

Error while merging: "Could not retrieve column info from table tablename" and Could not find stored


Hi i am getting following error message while merging. Can any one please help?

We are using sql server 2005
I have this problem in publisher.Gone throught his article http://social.msdn.microsoft.com/Forums/en/sqlreplication/thread/b0bbc330-91df-45d5-8dbf-e2df461a8005 but no luck.

The merge process could not retrieve column information for table 'dbo.tablename'. Verify that you have sufficient privileges on the database and retry the operation. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201016)
Get help: http://help/MSSQL_REPL-2147201016

Could not find stored procedure 'dbo.MSmerge_sel_sp_6481B06512B54C91FCC171C542E7'. (Source: MSSQLServer, Error number: 2812)
Get help: http://help/2812


To find a column available in all table



Does anyone able to advise me the query such that i can search all the tables available in my server instead of individual table of the particular column that i wish to search?


Find and compare values from a repating table?


Hi all

I am trying to loop through a repeating table, which is a secondary data source, and compare the Title column from the repeating table to another string which is not from the table. If they equal, I want all other rows to be hidden, except the equal one. I could do it easily in regular c#, but have not done it with InfoPath. I am not quite sure how to acheive that in InfoPath. If somebody could give me some sample code to put me in the right direction, I would be most thankful.


How to find the max version of a Product stored in a table?



I have a table in which column name is Product_Verion, whcih stored a string value of the versions released in that product. eg like

Product_Version (Column) in Table Product_Details


how to get the latest version? I know we need to parse the "." and check the max version. I am thinking of replacing the ('.') and then take only the numbers in as single digit and get the max digit. Will it give the max version. Please let me know if you have any other better way.




How to Find a specific sentence in a table that contains only words?


Hello dear grurus,

I don´t know if my question did, somehow, explain itself... if not, let me brake it down:

I have a table like this:

ID         WORDS

1          change color red

2          open door

3          find terms


now, I would like to search for an ID giving this search string: "Whould you like to change the color to red, please?"

please notice I have given a sentence containing 3 keywords found in row 1 for the table above... I know this, but how do I make t-sql to know this? 


Thank you so much for the help guys!

PS: please let me know if im not clear enough.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend