newtocsharp's Q&A profile
SQL Server Problem with User Defined Function
I wrote a UDF to get a rolling average based upon a date passed to the UDF. The error I get is: Server: Msg 102, Level 15, State 1, Procedure fn_RollAverage, Line 26 Incorrect syntax near ')'. SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO CREATE FUNCTION fn_RollAverage(@CURVE_DATE AS SMALLDATETIME) RETURNS @TBLRESULT TABLE (US0001M_Index AS FLOAT, US0003M_INDEX AS FLOAT, US0006M_INDEX AS FLOAT, US0012M_INDEX AS FLOAT, usswap2_index AS FLOAT, usswap3_index AS FLOAT, usswap4_index AS FLOAT, usswap5_index AS FLOAT, usswap6_index AS FLOAT, usswap7_index AS FLOAT, usswap8_index AS FLOAT, usswap9_index AS FLOAT, usswap10_index AS ...Show All
Visual C++ Why is a kernel usually written in C?
Hi! I wonder why OS kernels are usually written in C only. After all Windows, Linux and OpenBSD are pure C and assembly in the kernel. Why isn't there any C++ anywhere I know that a part of the answer is the big existing code base, but apart from that what else is it that keeps C++ from coming into kernel development. I know that some basic functions have to be implemented first, so that you can use classes, but once they are there C++ could be used in the code. You would probably get better answeres at the kernel newsgroups at http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.win32.programmer.kernel&lang=en& ...Show All
Windows Forms Is there a better way to handle localization?
Hi, I know that for each form, VS.Net creates a resx file for each culture. When the project grows bigger, the number of resx files will grow too. I am wondering if there's a better way to maintain those resx files. Thanks. I'm not sure there is a single answer to this, it really depends on your project and your organization. There should be little or no impact on performance with one or more files. I haven't measured this, but in theory a look up should be about the same since regardless of the approach you mash it all together in a .dll file. A single file might be easier if you only have a few p ...Show All
Visual Studio Tools for Office VSTO Outlook (Beta) Lab2
Hi: I could not wait to learn about VSTO Outlook (Beta) Add-in project. However, during the Lab 2, I got a problem when typing the _LoadBankContactds_Click method. During the Excerise 3, Step 8, I could not get the property of customProperty.Value. I mean after typing the period (.) after customProperty, there is no "Value" displayed in the lists. Do I miss something My Outlook version is 11.6359.6408 SP1. Thanks! Hi wacko: I created, with the wrong type. It should be Outlook.UserProperty , somehow I pointed to Outlook.UserProperties . And I didn't know why I ...Show All
Visual Studio Extending the Server Explorer
I have made a code generation tool for use with our sql stored procedures and I want to make it easy to use from the IDE. Is there a way to add items to the context menu of the server explorer when you right click an item thanks, Josh this looks like its creates a menu item called "Server Explorer". What Im trying to do is create a menu item that appears when you right click on a stored procedure in the server explorer. I have tried to find documentation for the server explorer in the VS extensibility section but havnt found anything yet. ...Show All
.NET Development Telephony in .NET
Hi I would like to know how to implement telephony in .NET. We have TAPI 3.0 but it is not supported in .NET so any replacement of TAPI in .net please let me know. There is currently no TAPI API equivalent in .Net. That said, I am interested to learn more about this requirement. What do you use TAPI for What is the end user scenario Please do email your feedback to nclasks@microsoft.com.dontspam (remove the .dontspam). This alias goes to the System.Net product team. Thank you. ...Show All
.NET Development send byte[] and recive byte[] System.IO;
ok,, i have the next problem... i am creating a client server program ,,, i allready know how to send text trough tcp with a networkstream.. then a streamreader and a streamwriter... it works good with text... but the problem is when i try to send a byte [] ,,, i have a image and i use a memorystream to convert it to a byte [] and i want to create the image in the server when i got he image,, i allready know how to do that... what i dont know to do,, is how can i send a byte [] im trying to send the image this way,, when i allready have the byte [] i do this: //here i call a function that returns me a byte[] of the image byte[] con ...Show All
Visual Studio Team System Suppress CA1303:DoNotPassLiteralsAsLocalizedParameters for all occurrences of a method call?
I'm using a common method to log messages throughout a class library. In many cases, literal strings are used to included fixed state information in these messages. Is there a way to suppress the CA1303:DoNotPassLiteralsAsLocalizedParameters message for all occurrences of the logging method call throughout an assembly. That is, can I allow literals passed to this single logging method but still have a warning generated for other methods I've tried to use an assembly-level SuppressMessage attribute such as the following, but it does not seem to suppress these messages: [assembly: SuppressMessage ( "Microsoft.Globalization" , ...Show All
Windows Forms Language attribute at application’s exe/dll files.
Hello All! I have build my application (It's consist of 2 assemblies) and gets 2 files app.exe and app2.dll So when I open Windows Explorer and click (right button :)) on any of files, select "Properties" from popup menu and than select Version tab the Language attribute value is always "Language Neutral". It need to put there "English (United Sta ...Show All
Visual Studio Dynamically create shapes
Hello, Is there a way to dynamically create shapes. I would like to create a ModelElement on loading the .xyz designer. Is it possible to create multiple shapes / connectors on drag and drop of an element from the toolbox. In the ElementAdded method can I create shapes - do we have a method CreateModelElement() or API's to create model elements Thanks, Julian Jewel Hi Tom, Official help: http://msdn2.microsoft.com/en-us/library/bb126619(VS.80).aspx An example from this forum: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=799447&SiteID=1 Here, Duncan explains an advanced usage: http://forums.mic ...Show All
Visual Studio Team System TF30144 error when creating a project from another domain
Hi I am struggling with a setup which consists of TFS single deployed on domain X and Team Foundation Client (and Visual Studio) on domain Y. X and Y does not know about each other since they are on diffrent nets and the DNS servers are not connected. My first problem, which I solved, was that TFS setup (or possibly SharePoint Services or SQL Server) uses computer names in configuration files. Thus, Team Explorer did not work correctly (red crosses on the documents and reports folders etc..) since computer names couldn't be looked up from domain Y. This was solved by adding the IP computer name mapping in the Windows 'hosts' file. &nbs ...Show All
Visual C++ Wrapper C++/cli class
Hi, I want to wrapper a my c++ class using Interop. This class has a method WritePort with defined as : UINT WritePort (UINT BytesToWrite, UINT* pBytesWritten, BYTE* pWriteBuff, UINT WriteTimeout); On my C++/Cli Class I've defined an wrapper method defines as : int WrapperClass::Class1::WriteSerial( int BytesToWrite, int ^ pBytesWritten, String^ WriteBuff, int WriteTimeout); The code for this wrapper method is : int WrapperClass::Class1::WriteSerial( int BytesToWrite, int ^ pBytesWritten, String^ WriteBuff, int WriteTimeout) { UINT retval; UINT ByteWritten; BYTE *pWriteBuff; unsigned char * uWrit ...Show All
.NET Development System.IO.IOException was unhandled
I am facing a strange problem. I have just 2 lines of code - File . Create ( @"C:\test.test" ); File . Delete ( @"C:\test.test" ); When I execute I get the following error and am not able to tackle this problem. Any help will be appreciated- System.IO.IOException was unhandled Message="The process cannot access the file 'C:\\test.test1' because it is being used by another process." Source="mscorlib" StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.Delete()   ...Show All
Visual C++ Problem with GetTempPath
Hi, I have a problem with the following piece of code. char tempFile[MAX_PATH]; if(GetTempPath(sizeof(tempFile),tempFile)) if(GetTempFileName(tempFile, "XYZ",0,tempFile)) strcpy(someBuffer,tempFile); However the problem is that this code works fine in case I use VC7. If I use VC8 this causes a "Access Violation" exception in mvvcr80.dll!strlen(unsigned char *buf=0x05120882) Line 81 Asm. Have anyone faced this problem Any help regarding this would be highly appreciated. Thanks. GJ I can see two potential problems with the above. The first is that usin ...Show All
Visual Studio Team System Protocol violation - can I change how sensible the test shall be to protocol errors?
I get this error when running a test on a web page that I have no possibility to change: RequestFailed: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF Is it possible to configure how the test shall handle this so the test will not fail I meet the same problem :( I m building a project about mobile device application and I wanted to add web reference to tho my project. This problem occured. How can I solve this problem. There is no web config file on this project Thanks. ...Show All
