Alexander Kachalkov's Q&A profile
Visual Studio 2008 (Pre-release) Getting Real Client IP Address in Service
I am posting this question again because I have look through the previous post regarding this question but I still have not found an answer that I needed. In most previous post, the solution described as always been making client add their own IP in OutgoingMessageHeaders. But I feel this is not really a good way, someone can masquerade as another client by just putting a fake IP address in the header. Is there a way to obtain the real IP address of the client as appeared on the IP packets received by the service I know that this might be spoofed but at least it is a little better much harder that just relying on the client to tell its IP address. Thanks! What if you are using HTTP and the message is pa ...Show All
SQL Server Problem of unicity constraint in a data flow
Hi, I'm trying to import data from an xml file into a table in my database and I have a problem of unicity constraint in my table. Here is an example of the data flow in my file : CITY LOCATION_ID CATALOG_SAISON PARIS 12 S06 PARIS 12 S07 NEW YORK 15 S06 BERLIN 14 S08 The primary key in my destination table is the two first fields CITY/LOCATION_ID, so I would like to have only one CATALOG_SEASON per CITY/LOCATION_ID. That's why I want insert the following flow in my destination table: CITY LOCATION_ID CATALOG_SAISON PARIS 12 S06 NEW YORK 15 S06 BERLIN 14 S08 In T ...Show All
.NET Development .NET TCP/IP
can someone please show me how me to create a very simple tcplistener app and tcpclient app here's my sample code on TCP Listener: Imports System.Net.Sockets Imports System.Net Imports System.Threading Public Class Form1 Dim server As TcpListener Delegate Sub DelegateServer() Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim thdServer As New Thread(AddressOf ServerStart) thdServer.Start() End Sub Sub ServerStart() If server Is Nothing Then server = New TcpListener(IPAddress.Any, 3030) server.Start() End If RunServer() End Sub Sub RunServer() Dim done As Boolean = False Dim client As New TcpClient() W ...Show All
Visual C++ menu problems
hi there I have one little problem the thing is about menu I would like to make some elements gray and it dosn't work, menu id is IDR_MENU1 I tried to use a EnableMenuItems but it dosn't seem to work help me please PS I am using VC++6 if only it is important Adrian Proszczuk Poland That is what I said, you missed to specify how you are going to identify the menu item. In your case you can give it as follows ptrMenu_0->EnableMenuItem(IDM_FILE_HH_TO_ALPRO,MF_GRAYED | MF_BYCOMMAND ); it will work fine ...Show All
.NET Development Update Query not updating or issuing exceptions
Hey guys I have this Access Query I am trying to run in C# windows app the Query from access UPDATE tblStaff SET tblStaff.Record_Password = [ NP], tblStaff.LastUpdatedBy = [ LB] WHERE (((tblStaff.CorpID)=[ CD]) AND ((tblStaff.Record_Password)=[ CP])); C# code OleDbConnection objConn = new OleDbConnection(); objConn = Config.ConnBuilder(); OleDbCommand oCmd = new OleDbCommand(Query,objConn); oCmd.Connection = objConn; oCmd.CommandType =CommandType.StoredProcedure; oCmd.CommandText = "PwChange"; oCmd.Parameters.Add(" NP" , OleDbType.VarChar).Value = newPass; oCmd.Parameters.Add(" LP" , OleDbType.VarChar).Value = updatedBy; oCmd.Parameters.Add(" CD" , OleDbType.VarChar).Value = corpId; oCmd.Parameters.Add(" CP" , OleDbTy ...Show All
SQL Server Adding new column to Flat File Source Connection
What is the best way to deal with a flat file source when you need to add a new column This happens constantly in our Data Warehouse, another field gets added to one of the files to be imported, as users want more data items. When I originally set the file up in Connection Managers, I used Suggest File Types, and then many adjustments made to data types and lengths on the Advanced Tab because Suggest File Types goofs a lot even if you say to use 1000 rows. I have been using the Advanced Tab revisions to minimize the Derived Column entries. The file is importing nightly. Now I have new fields added to this file, and when I open the Connection Manager for the file, it does not recognize the new columns in the file unless I click Reset Fiel ...Show All
Windows Forms How to Wrap text in a text box column of datagrid in windows application.
I have a datagrid column in which I want to wrap the text in one column. private DataGridTextBoxColumn dgcComments dgcComments = new DataGridTextBoxColumn() dgcComments.TextBox.Multiline = true dgcComments.TextBox.AcceptsReturn = true dgcComments.TextBox.WordWrap = true I have set the WordWrap property to True and Multiline property to True, but it doesn't seem to work. I am able to see the wraped text only when I manually increase the size of the row and click in the cell containing value. Anybody has any idea how to wrap text in a text box column of datagrid Regards Hemant Maybe this thread will help. ...Show All
Windows Forms Enabling Menu Strip in Main form from child Form
Here is my code: Main form: Friend Sub LoadMenus(ByVal MenuPermissive As Boolean) Dim Blah As Boolean Blah = MenuPermissive If Blah = True Then MessageBox.Show("Test! IT WORKS!", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Information) Me.ToolBar1.Visible = True End If End Sub Child form: MenuPermissive = True Dim AccessMenu As New Form1 AccessMenu.LoadMenus(MenuPermissive) I am able to display the message box, but it doesnt make the toolbar visable! Any help would be much appreciated! Thank you! You are correct, after further testing, it doesnt work in vs2003 either. How do I adjust the code to make it work, I'm clueless at t ...Show All
Visual Studio Team System CTP6 - Cannot create project
I've just installed CTP6 and cannot create a 2005 project. I am getting the following error: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections". I have specificed a local instance of SQL Server 2005 ('localhost\SQLServer2005' is the value I put in the Tools | Options | Data Connections page and Tools | Options | Design-time Validation database page). My local instance does allow remote connections and I can connect to it without any problem from Management Studio. Thanks for your help - Amos. Hello Amos, 1. CTP6 ...Show All
Visual Basic VB.NET Coding error
Hi, I was creating a webform and I got one error and I don't know what does it means can anyone help me with it The Error: Reference to a non-shared member requires an object reference. The underline and bold line. My login Page: Username: < asp : TextBox ID ="UserID" runat ="server">User1 </ asp : TextBox > Try If s.Connected Then s.Send(bytesSent, bytesSent.Length, 0) Do bytes = s.Receive(bytesReceived, bytesReceived.Length, 0) receiveText = Encoding.ASCII.GetString(bytesReceived, 0, bytes) receiveXMLText = receiveXMLText + receiveText If receiveText.IndexOf( "</packet>" ) Then quitRequest = True receiveXMLText = receiveXMLTex ...Show All
Smart Device Development How to intercept incoming calls in WM 2003 SE
Hello everyone, i am trying to intercept incoming calls and do some logic before giving the user notification for the call. But i am not able to intercept the calls. Like for Messages, we have IMapiClientRule, where we intercept the messages, and based on the logic, it is forwarded to the store/inbox. How can we do something similar for calls Any ideas or pointers would be appreciated. Thank you, -Rupreet Can this be done using the OpenNetCF... I have tried looking at TAPI in C++ but i cannot find any good examples, and the CE dialer sample dooes not seem to work for me, i think i need to change something so as i can use UK numbers, but as i am trying to learn this then i am not sure, a ...Show All
Visual Studio 2008 (Pre-release) How to draw an ellipse inside a canvas at specific coordinates?
I have a custom class that inherits from Canvas and I create instances of this as rectangles inside a xaml window. When the user clicks on one of these shapes (canvases), I want to draw a small ellipse at that point. I have successfully drawn an ellipse inside the canvas and its default location is top/left. How do I position it exactly where the mouse clicked in the canvas Note: ‘ myShape’ is a custom class I’m using that inherits from Canvas. private static void PaintDot ( Point pt , myShape uim ) { Ellipse el = new Ellipse (); el . Width = 10 ; el . Height = 10 ; el . Fill = Brushes . LimeGreen ; uim . Children . Add ( el ); //Now how do I position el at p ...Show All
SQL Server Bypassing locks when doing insert or update
Hi, I want to bypass locks while doing Insert or Update. I am only updating a log db and I don't care about one or two fields getting junk as I won't use it later (atleast as long as I am working with my current company ;) ) I am using MS SQL 2000 I am getting too many deadlocks and messages like these "Process ID was deadlocked with another process and has been chosen a victim. Please rerun the transaction". Please tell me how to achieve this. Regards, Noorul You absolutely CANNOT bypass locking when doing UPDATES or INSERTS or DELETES. Nor would you want to. You are getting deadlocks because your code is accessing the data in differring order, you are holding transactions open too long, and/or ...Show All
SQL Server Problem for Calling A Stored Procedure, Please help.
I am writing a Stored Procedure for other server (using C++ to receive the output values) as below, where @Total , @balance, @A are output values create proc [MaxTime] @number varchar(30), @numbera varchar(30), @numberb varchar(30) as begin declare @balancefloat declare @table varchar(20) declare @freetotal varchar(20) declare @SQL nvarchar(4000) declare @A float declare @Total float select @balance = balance, @table = table, @freetotal = freetotal from info where number = @number SELECT @SQL = 'select @A = A FROM' + @table + ' WHERE LEFT(code, 1) = ' + LEFT(@incomingcode, 1) + ' AND CHARINDEX(LTRIM(RTRIM(code)), ' + @incomingcode+ ') = 1' + ' ORDER BY LEN(code) DESC' exec sp_executesql ...Show All
SQL Server SQL 2000 Enterprise Memory usage
Hello... I have a couple servers that are running SQL 2000 Enterprise on Windows 2003 Enterprise edition with 8gig of ram. However, we cannot seem to get the SQL server to take more than 1.7GB... Is there something that we are missing do we still need to to the /3g switch or any other startup switches Also is it a good idea to set the 'reserve physical memory for SQL Server' option for a dedicated machine Thanks for the help... I can seem to find this answer. and the windows server has the /PAE option set Hi William. How are you verifying the memory footprint for Sql i.e. are you using task manager or perfmon If you're using task manager, you'll see skewed data in many different s ...Show All
