AHTUNG's Q&A profile
Visual Studio Tools for Office Retrieving data from SQL Server to Excel
I'm developing a solution to creat pivot tables in a Excel's workbook from data in Sql Server 2005. When I run the project in my local machine (Windows XP Pro Portuguese with Office 2007 English) it returns the workbook with the pivot table desired. However, in the development machine (Windows Server 2003 English with Office 2007 Portuguese) the program returns the follow message: "Erro de sintaxe SQL" ("SQL sintax error"). The part of the code where the error occurs is: private void InsertData(ref Excel.Worksheet DataSheet, string connection, string select) { Excel.QueryTable SqlData; try { SqlData = DataSheet.QueryTables.Add(connection, DataSheet.get_Range("A1", ...Show All
SQL Server Batch programs examples
Can someone point me to some examples of batch scripts that will allow me to write a simple tool which can reliably detect if any instances of SQL servers are running on a machine and if running, then their names. Hopefully the tool should be robust enough to run on diff flavors of MS Windows. Thanks ...Show All
Windows Forms How do I disable the AddNewItem button on the bindingNavigator control ?
I have a simple form with a DataGridView, a BindingNavigator and BindingSource allowing me to view the contents of a table called 'RUN'. I have included the DataSource in my project so a runTableAdapter and myDataSet.Run has been created automatically for me. The problem is that on this particular form I don't want the user to be able to add new items using the BindingNavigator control. I could just delete the 'AddNewItem' control from the navigator but for a consistent look and feel I would rather just disable it. I can disable it at design time which works to begin with. Then at run time, the user can select some 'filtering criteria' using other controls on the form and then press a button. I then fill the table using the following: ...Show All
Visual Basic Case Else
So I have this Select Case list which has a bunch of radio buttons (named adoXX) when the radio button is checked true, it is supposed to add the data from a textBox into a listBox as the last entry. I thought I had this right.... but apparently not. what a mess. 'anything listed as ado is a radio button 'anything listed as lst is a listBox function Select Case if adoAL.checked = True then me .lstAL.items.add(txtVote.text) else if adoAK.checked = true then me .lstAK.items.add(txtVote.text) else if adoAR.checked = true then Me .lstAR.items.add(txtVote.text) else if adoCA.Checked = True then ...Show All
SQL Server Deadlock at trigger
a trigger need to insert or update record at the other table in high traffic environments however, the deadlock happens; ie, a trigger running twice at the same time want to need to insert record at the table. i trid to change isolation as SERIALIZABLE or REPEATABLE , but i cannot solve the problem. i guess the "while loop" affects the result because i try to cancel the loop and execute smoothly. How to solve the deadlock Thx ----------------------------- i used the following commands to change isolation level: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE begin transaction commit transaction ----------------------------- the code are as follows: declare setskuCursor cursor local static for select item, qua ...Show All
SQL Server Would like to rename a Table name from Transcation to something else...
Hi All, First of all, let me admit that this is a mistake which should not have happened. It just came to my notice that we have a table named TRANSACTION in our database. I would like to rename this to TransactionDetails or something else. But then we have some SP's and Trigerrs which refer this table, so I would like to reflect the change in the table name in all these objects whcih refer this table. Please help me in writing the query to find all the objects that refer my table. FYI : The application is working fine with this table name, but we would like to get rid of it since TRANSACTION is a reserved name SQL Server. Thanks In Advance, Joe. I just found out that in the object browser in Quer ...Show All
SQL Server How to Restore the msdb DatBase
Hi, i have reinstalled the SQL Server before it i have taken backup of both master and msdb database.Because there were many scduled jobs. After Installation i want recreate those scduled job. That i think i can get by restoring msdb. But it is not restoring how can i restore it. Or there is any way to get the all scduled job list so that i can recreate it manully. Regards Sanjay Hi jens, i am tryning restore after stopping SQL Server Agent is stopped. But it is giving the error massage that "The backup of the system database on device E:\EcoSystemDatabasebackup\msdb_2006070200.BAK can not be restored because it was created by a different version of the server (1342184 ...Show All
Visual C# data encryption program
Hi ppl i have been assigned task to build an encryption program to encrypt text files.. and binaries.. I don't know much algos related to it... I will be glad if you geeks put up some suggesions..... Plz do reply to it if you visit.... Thanks in advance... ...Show All
.NET Development storing info in an array...
Hello all, I am building an application where I have created an array that will store the details that a student inputs (the details input are name, email and course). there are two text boxes for the name and email and a combo box for the course. I am having problems though, what I would like to happen is when the user presses the 'update' button on the form the details that the user has written are stored in the array. Then when another user enters their details those are stored in the next place. The maximum number of student details allowed is 50. Here is my code in case you need to see what I mean, the code that I have added to what MS Visual created is in red, and the update button I have renamed to buttonUpdate: using System; ...Show All
Visual C# how to catch the return value from the DeliverNotificationOptions?????
Ok, wrote this piece of code. Now how do I catch the return value from the DeliverNotificationsOptions //Describes the delivery notification options for e-mail. //In our case notify if the delivery is successful. mailMessage.DeliveryNotificationOptions = DeliveryNotificationOptions .OnSuccess; try { //The SmtpClient class is used to send e-mail to an SMTP server for delivery. SmtpClient smtpClient = new SmtpClient (); //Specifies how email messages are delivered. //Email is copied to the pickup directory used by a local Internet Information Services (IIS) for delivery. smtpClient.DeliveryMethod = SmtpDeliveryMethod .PickupDirectoryFromIis; //Sends the specified message to an SMTP server f ...Show All
Windows Forms Cannot accessed a disposed object named ComboBox
Hi, Has anyone run into this error before "Cannot accessed a disposed object named ComboBox" Basically, I have an MDI application using Visual Basic. net 2003. The weird thing is that it happens for a particular computer/user. Please give me some of your guidance. Thanks. Minh Most typically, this happens when you have a reference to a form that was closed by the user. Be sure to trap the FormClosed event for the form to know that the reference is no longer valid. Set it to null to ensure that the form can be garbage collected. ...Show All
Visual Studio Express Editions How to copy one worksheet to another WorkBook
Hi everyone, i am doing a project using the library Microsoft Excel 11.0 in C# and I am trying to copy one worksheet to another worksheet that is in a diferent Workbook. But I don’t know why it doesn’t works. So the problems is this. System.Runtime.InteropServices.COMException Exception from HRESULT: 0x800A03EC. My code is like this: System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US"); string Path = @"C:\Ejemplos excel\ejemplo 1.xls"; string savepath = "C:\\test3.xls"; Excel.Application app = new Excel.ApplicationClass(); app.UserControl = true; Excel.Workbook workBook = app.Workbooks.Open(Path, 0, t ...Show All
Visual Studio 2008 (Pre-release) Binding TreeView to Relational DataSet
alslamo alikom... i have a dataset with two tables..and they have a relation between them...which indecates the master table and the details table...the question is that i want to view those two tables in a tree view where the details table construct the leaf items...and the master table constructs the parent items...all that using code... i did the following and i don't know how to complete... -------------------------------------------------------------- TreeView MyTreeView = new TreeView(); GlobalDataSet.Tables.Add(ParentTable); GlobalDataSet.Tables.Add(ChildTable); GlobalDataSet.Relations.Add(ParentTable.Columns["ID"], ChildTable.Columns["ParentID"]) Bin ...Show All
.NET Development How to get access to last error encountered?
Hello, I have a call one with one of the methods returning bool depending wether there were exception inside a class or not. How can I get access to that Exception after calling a method and finding out that result is "false" and hence some exception happened inside calling method. Thanks, G true. but im sure that (if we look at low level/win32 API for example) if there was an exception thrown that you would "log" it in some way. Take for example win32 API functions/classes, if you SetLastError=true, you will get returned back the last error that occured and that error would have been stored globally to be accessed. I guess it depends on the developer, each has th ...Show All
SQL Server Trying to deploy a BI Project from Visual Studio and it is not responding
The project has been deployed serveral times before successfully. Here is the message in the output window where it stops: ------ Deploy started: Project: SSAS Step By Step, Configuration: Development ------ Performing an incremental deployment of the 'SSAS Step By Step' database to the 'localhost' server. Generating deployment script... Add Database SSAS Step By Step Process Database SSAS Step By Step Done Sending deployment script to the server... How do I go about trying to determine what is causing the problem Try deploying without immideately processing the database. You can do that through project properties. Once changes deployed, go to the SQL Management stud ...Show All
