Search Results

Search found 6 results on 1 pages for 'iordantanev'.

Page 1/1 | 1 

  • exec problem in sql 2005

    - by IordanTanev
    Hi, i have the situation where i have two databases whith same structure. The first have some data in its datatables. I need to create a script that will transfer the data from the first database to the second. I have created this script. DECLARE @table_name nvarchar(MAX), @query nvarchar(MAX) DECLARE @table_cursor CURSOR SET @table_cursor = CURSOR FAST_FORWARD FOR Select TABLE_NAME FROM INFORMATION_SCHEMA.TABLES OPEN @table_cursor FETCH NEXT FROM @table_cursor INTO @table_name WHILE @@FETCH_STATUS = 0 BEGIN SET @query = 'INSERT INTO ' + @table_name + ' SELECT * FROM MyDataBase.dbo.' + @table_name print @query exec @query FETCH NEXT FROM @table_cursor INTO @table_name END CLOSE @table_cursor DEALLOCATE @table_cursor The problem is that when i run th script the "print @query" statement prints statement like this INSERT INTO table SELECT * FROM MyDataBase.dbo.table When i copy this and run it from Management studio it works fine. But when the script trys to run it with exec i get this error Msg 911, Level 16, State 1, Line 21 Could not locate entry in sysdatabases for database 'INSERT INTO table SELECT * FROM MPDEV090314'. No entry found with that name. Make sure that the name is entered correctly. Hope someone can tell me whot is wront with this. Best Regards, Iordan Tanev

    Read the article

  • Exec problem in SQL Server 2005

    - by IordanTanev
    Hi, I have the situation where i have two databases with same structure. The first have some data in its data tables. I need to create a script that will transfer the data from the first database to the second. I have created this script. DECLARE @table_name nvarchar(MAX), @query nvarchar(MAX) DECLARE @table_cursor CURSOR SET @table_cursor = CURSOR FAST_FORWARD FOR SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES OPEN @table_cursor FETCH NEXT FROM @table_cursor INTO @table_name WHILE @@FETCH_STATUS = 0 BEGIN SET @query = 'INSERT INTO ' + @table_name + ' SELECT * FROM MyDataBase.dbo.' + @table_name print @query exec @query FETCH NEXT FROM @table_cursor INTO @table_name END CLOSE @table_cursor DEALLOCATE @table_cursor The problem is that when I run the script the "print @query" statement prints statement like this INSERT INTO table SELECT * FROM MyDataBase.dbo.table When I copy this and run it from Management studio it works fine. But when the script tries to run it with exec I get this error Msg 911, Level 16, State 1, Line 21 Could not locate entry in sysdatabases for database 'INSERT INTO table SELECT * FROM MPDEV090314'. No entry found with that name. Make sure that the name is entered correctly. Hope someone can tell me whot is wront with this. Best Regards, Iordan Tanev

    Read the article

  • Custom Report Items in local reports

    - by IordanTanev
    Hi, i have read this article about custom report items(CRI) http://msdn.microsoft.com/en-us/magazine/cc188686.aspx The only problem is that CRI are only usable in reporting service and not in local reports. My question is it possible some how to use CRI in local reports( RDLC ). Also i am interested in which version of reporting service is this possible, if possible Best Regards, Iordan

    Read the article

  • Comobox event SelectedValueChanged

    - by IordanTanev
    Hi, i have simple question may be someone asked it before me but i could not find it.Let say i have datatable that has some data from the database and i want to bind it to a combobox i use standart code like this comboBox1.BeginUpdate( ); comboBox1.ValueMember = "id"; comboBox1.DisplayMember = "name"; comboBox1.DataSource = dt; comboBox1.EndUpdate( ); The problem is during this binding the event SelectedValueChanged is fired.The problem is that rebind combo several times when outher values change and every time i must do sometihn like this comboBox1.SelectedIndexChanged -= new System.EventHandler( this.comboBox1_SelectedValueChanged ); my question is there a smarter way to skip the event when i comes from databinding not from user input.The problem is that i want to do it some how globaly in my control that inherits combobox and not to do it everytime in every from Best Regards, Iordand

    Read the article

  • Protect value from changies using reflection?

    - by IordanTanev
    Hi, here is the problem case i am writing a little third party library. In this library i have a class like this public class TestClass { public int TestField { get; private set; } public TestClass( ) { TestField = 1; } } Then i have a varialbe form this class like this public TestClass test = new TestClass( ); The problem i am facing is that usnig reflection like this PropertyInfo field = typeof( TestClass ).GetProperty( "TestField" ); field.SetValue( test, 2, null ); programers can change internal value of this class. this will be very bad thing becouse it can crash the hole library. My question is what is the best way to protect my code form such changes.I know i can use some kind of bool flag so tha value can be changed only ones but this is not very good salution is there a better one? Best Regards, Iordan

    Read the article

  • Get node parent of defined type using xpath

    - by IordanTanev
    Hi, i will give an example of the problem i have. My XML is like this <roor> <child Name = "child1"> <node> <element1>Value1</element1> <element2>Value2</element2> </node> </child> <child Name = "child2"> <element1>Value1</element1> <element2>Value2</element2> <element3>Value3</element3> </child> </root> I have xpath expression that returns all "element2" nodes. Then i want to for every node of type "element2" to find the node of type "child" that contains it. The problem is that between these two nodes there can be from 1 to n different nodes so i can't just use "..". Is there something like "//" that will look up instead of down Best Regards, Iordan

    Read the article

1