Search Results

Search found 187 results on 8 pages for 'karthik'.

Page 4/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • How to send a reply message to sender machine via serial port using c#

    - by karthik
    I am using the below code to receive the message via serial port which is working fine. Now i need to send back a acknowledgment message to the sender machine. How can send the message ? private void MonitorSP_DataReceived(object sender, SerialDataReceivedEventArgs e) { try { System.IO.Ports.SerialPort SP = (System.IO.Ports.SerialPort)sender; //Get the ports available in system string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames(); string strAvlPortNames = ""; foreach (string s in theSerialPortNames) { strAvlPortNames += s.ToString() + ", "; } //Read an contruct the message Thread.Sleep(1000); string msg = SP.ReadExisting(); string ConstructedMsg = "Port's Found : " + strAvlPortNames + "\n" + "Port Used : " + SP.PortName + "\n" + "Message Received : " + msg; if (InvokeRequired) { richTextBox1.Invoke(new MethodInvoker(delegate { richTextBox1.Text = ConstructedMsg; })); //Send acknowlegement to sender port SP.Write(SP.PortName); return; } } catch (Exception ex) { MessageBox.Show(ex.StackTrace.ToString()); } }

    Read the article

  • Create Dynamic Images using Base Image

    - by Karthik Kastury
    I am creating a Google Maps Social Application.. I have a basic marker that has a blank square in between it where I need to put the user uploaded picture. I already have the user uploaded pictures. Now How do I create these dynamic markers using PHP.. The accepted pictures are jpeg and png. I have heard of the PHP GD Library and would like to know how I can accomplish the task..

    Read the article

  • Migrate Vb to Vb.net

    - by vigna hari karthik
    Hai Friends I having the project in Vb i want to migrate that project in the vb.net.any tool available pls inform me.i have tried a lot.i have not installed the visual basic.with the help of remote server i am running that project.

    Read the article

  • Query to MySQL from c# returns System.Byte[]

    - by karthik
    I am using the below SP to return the value of Generated Insert statement and it works fine when executed in Query browser. When i try to get the value from C#, it give's me "System.Byte[]" as return value. When i try to get the value from MySql query browser, it give's me return value as : 'insert into admindb.accounts values("54321","2","karthik2","karthik2","1");' I guess the problem is with the single quotes of the returned value. Is it so ? DELIMITER $$ DROP PROCEDURE IF EXISTS `admindb`.`InsGen` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `InsGen`( in_db varchar(20), in_table varchar(20), in_ColumnName varchar(20), in_ColumnValue varchar(20) ) BEGIN declare Whrs varchar(500); declare Sels varchar(500); declare Inserts varchar(2000); declare tablename varchar(20); declare ColName varchar(20); set tablename=in_table; # Comma separated column names - used for Select select group_concat(concat('concat(\'"\',','ifnull(',column_name,','''')',',\'"\')')) INTO @Sels from information_schema.columns where table_schema=in_db and table_name=tablename; # Comma separated column names - used for Group By select group_concat('`',column_name,'`') INTO @Whrs from information_schema.columns where table_schema=in_db and table_name=tablename; #Main Select Statement for fetching comma separated table values set @Inserts=concat("select concat('insert into ", in_db,".",tablename," values(',concat_ws(',',",@Sels,"),');') as MyColumn from ", in_db,".",tablename, " where ", in_ColumnName, " = " , in_ColumnValue, " group by ",@Whrs, ";"); PREPARE Inserts FROM @Inserts; EXECUTE Inserts; END $$ DELIMITER ;

    Read the article

  • Find Month difference in php?

    - by Karthik
    Is there anyway to find the month difference in php? I have the input of from date 2003-10-17 and todate 2004-03-24. I need the results how many month is there within these two days. Say if 6 months, i need the output in months only. Thanks for guide me for day difference. I find the solution through mysql but i need in php. Anyone help me, Thanks in advance.

    Read the article

  • convert MsSql StoredPorcedure to MySql

    - by karthik
    I need to covert the following SP of MsSql To MySql. I am new to MySql.. Help needed. CREATE PROC InsertGenerator (@tableName varchar(100)) as --Declare a cursor to retrieve column specific information --for the specified table DECLARE cursCol CURSOR FAST_FORWARD FOR SELECT column_name,data_type FROM information_schema.columns WHERE table_name = @tableName OPEN cursCol DECLARE @string nvarchar(3000) --for storing the first half --of INSERT statement DECLARE @stringData nvarchar(3000) --for storing the data --(VALUES) related statement DECLARE @dataType nvarchar(1000) --data types returned --for respective columns SET @string='INSERT '+@tableName+'(' SET @stringData='' DECLARE @colName nvarchar(50) FETCH NEXT FROM cursCol INTO @colName,@dataType IF @@fetch_status<0 begin print 'Table '+@tableName+' not found, processing skipped.' close curscol deallocate curscol return END WHILE @@FETCH_STATUS=0 BEGIN IF @dataType in ('varchar','char','nchar','nvarchar') BEGIN SET @stringData=@stringData+'''''''''+ isnull('+@colName+','''')+'''''',''+' END ELSE if @dataType in ('text','ntext') --if the datatype --is text or something else BEGIN SET @stringData=@stringData+'''''''''+ isnull(cast('+@colName+' as varchar(2000)),'''')+'''''',''+' END ELSE IF @dataType = 'money' --because money doesn't get converted --from varchar implicitly BEGIN SET @stringData=@stringData+'''convert(money,''''''+ isnull(cast('+@colName+' as varchar(200)),''0.0000'')+''''''),''+' END ELSE IF @dataType='datetime' BEGIN SET @stringData=@stringData+'''convert(datetime,''''''+ isnull(cast('+@colName+' as varchar(200)),''0'')+''''''),''+' END ELSE IF @dataType='image' BEGIN SET @stringData=@stringData+'''''''''+ isnull(cast(convert(varbinary,'+@colName+') as varchar(6)),''0'')+'''''',''+' END ELSE --presuming the data type is int,bit,numeric,decimal BEGIN SET @stringData=@stringData+'''''''''+ isnull(cast('+@colName+' as varchar(200)),''0'')+'''''',''+' END SET @string=@string+@colName+',' FETCH NEXT FROM cursCol INTO @colName,@dataType END

    Read the article

  • Logic for FOR loop in c#

    - by karthik
    My method has a parameter, I have to use that in my For loop to iterate. For example, I have a text file with 4 lines. If the Param is 1, the for loop must iterate through the last three lines If the Param is 2, the for loop must iterate through the last two lines If the Param is 3, the for loop must iterate through the last one line How can i pass this param in my For loop to achieve all the three scenarios stated above ?

    Read the article

  • usercontrols inside panels

    - by karthik
    hi all In my project i added a usercontrol to a panel.when i try to add a new usercontrol to my panel i want to check what is the name of the usercontrol placed in the panel before how to do it. i have three different usercontrols, i assign it one by one to panel,before replacing the new one with the old one ,i want to find what is the old one inside the panel.

    Read the article

  • mysql fetch result parent id and category id by single query?

    - by Karthik
    I have the table and values like this, CREATE TABLE `category` ( `id` INT( 4 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `category` VARCHAR( 50 ) NOT NULL , `parent` INT( 4 ) NOT NULL ) INSERT INTO `category` VALUES (1, 'MCA', 9); INSERT INTO `category` VALUES (2, 'M Tech', 9); INSERT INTO `category` VALUES (3, 'B Tech', 9); INSERT INTO `category` VALUES (4, 'BioTech', 9); INSERT INTO `category` VALUES (5, 'InfoTech', 9); INSERT INTO `category` VALUES (6, 'Chemical', 10); INSERT INTO `category` VALUES (7, 'Indus', 10); INSERT INTO `category` VALUES (8, 'Physics', 10); INSERT INTO `category` VALUES (9, 'Information Science', 0); INSERT INTO `category` VALUES (10, 'Others Science', 0); I need a single query for getting the values in terms of category and subcategory. 3rd values zero as category and others are subcategory.

    Read the article

  • Mysql return value as 0 in the fetch result.

    - by Karthik
    I have this two tables, -- -- Table structure for table `t1` -- CREATE TABLE `t1` ( `pid` varchar(20) collate latin1_general_ci NOT NULL, `pname` varchar(20) collate latin1_general_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; -- -- Dumping data for table `t1` -- INSERT INTO `t1` VALUES ('p1', 'pro1'); INSERT INTO `t1` VALUES ('p2', 'pro2'); -- -------------------------------------------------------- -- -- Table structure for table `t2` -- CREATE TABLE `t2` ( `pid` varchar(20) collate latin1_general_ci NOT NULL, `year` int(6) NOT NULL, `price` int(3) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; -- -- Dumping data for table `t2` -- INSERT INTO `t2` VALUES ('p1', 2009, 50); INSERT INTO `t2` VALUES ('p1', 2010, 60); INSERT INTO `t2` VALUES ('p3', 2007, 200); INSERT INTO `t2` VALUES ('p4', 2008, 501); my query is, SELECT * FROM `t1` LEFT JOIN `t2` ON t1.pid = t2.pid Getting the result, pid pname pid year price p1 pro1 p1 2009 50 p1 pro1 p1 2010 60 p2 pro2 NULL NULL NULL My question is, i want to get the price value is 0 instead of NULL. How can i write the query to getting the price value is 0. Thanks in advance for help.

    Read the article

  • How to make a Non Rectangular Winforms ?

    - by karthik
    I am using the below code to change to shape of the winform. Its changing the shape, but not like how i wanted. I need the forms to have curved corners. What points should i use to get it ? public void MakeNonRectangularForm() { System.Drawing.Drawing2D.GraphicsPath p = new System.Drawing.Drawing2D.GraphicsPath(); int width = this.ClientSize.Width; int height = this.ClientSize.Height; p.AddClosedCurve(new Point[]{new Point(width/2, height/2), new Point(width,0), new Point(width, height/3), new Point(width-width/3, height), new Point(width/7, height-height/8)}); this.Region = new Region(p); }

    Read the article

  • Back Button disable

    - by vigna hari karthik
    Hai Friends I have used lot of codinds to disable the browser (using server side code) back button in mozila firefox 3.2 it is not working.But it is working fine in the Internet Explorer.Pls same the correct solution to solve this problem in mozila firefox3.2 version.say me in detail.

    Read the article

  • Thread to receive the messages from serial port is not working using c#

    - by karthik
    I am using Serial port to receive the messages. The below function is running in a thread. When i debug i find that the thread is running properly. But "if (sp.IsOpen)" is always false, due to which the code is not executing inside the IF condition at all. It says the Port is closed. I will be having multiple serial ports in my system and i will not know, which port will receive the message. So i need to listen to all the ports in one Thread. How can i solve my problem here ? private void ListenerPorts() { log.Info("Listening Thread Started"); while (true) { //foreach (SerialPort sp in storeport) foreach (SerialPort sp in comPortsList) { if (sp.IsOpen) { sp.ReadTimeout = readTimeoutInMs; sp.WriteTimeout = writeTimeoutInMs; try { string msg = sp.ReadLine(); this.GetMessageRichTextBox("Message : " + msg + "\n"); sp.WriteLine(sp.PortName); if (msg.Contains("COM")) { // is AutoScan receiverPortName = sp.ReadLine(); this.updateLblStatusRichTextBox(sp.PortName + " is connected to " + msg + "\n"); } else { //standalone is uppercase ReceiverPortName = sp.ReadLine(); this.updateLblStatusRichTextBox(sp.PortName + " is connected to " + ReceiverPortName + "\n"); } } catch (Exception ex) { // no data System.Diagnostics.Debug.WriteLine(sp.PortName + " : " + ex.Message); } } } } }

    Read the article

  • Using C code in c#

    - by karthik
    When i googled to find the way to change the window style i could find the code in "C" language How can i use the snippet below in my c# application, so that i can hide the Title Bar of external application ? I have not used "C" before.. //Finds a window by class name [DllImport("USER32.DLL")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); //Sets a window to be a child window of another window [DllImport("USER32.DLL")] public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); //Sets window attributes [DllImport("USER32.DLL")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); //Gets window attributes [DllImport("USER32.DLL")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); //assorted constants needed public static int GWL_STYLE = -16; public static int WS_CHILD = 0x40000000; //child window public static int WS_BORDER = 0x00800000; //window with border public static int WS_DLGFRAME = 0x00400000; //window with double border but no title public static int WS_CAPTION= WS_BORDER | WS_DLGFRAME; //window with a title bar /* This function sets the parent of the window with class ClassClass to the form/control the method is in. */ public void Reparent() { //get handle of parent form (.net property) IntPtr par = this.Handle; //get handle of child form (win32) IntPtr child = FindWindow("ClassClass", null); //set parent of child form SetParent(child, par); //get current window style of child form int style = GetWindowLong(child, GWL_STYLE); //take current window style and remove WS_CAPTION from it SetWindowLong(child, GWL_STYLE, (style & ~WS_CAPTION)); }

    Read the article

  • No Audio from Windows XP after formatting.

    - by karthik
    Hello folks, I have reinstalled in my Windows XP machine. After it is re-isntalled the audio in my machine has failed. I have installed all the device drivers in my mother board. The Realtek Sound driver is also installed. Note: Sound is working when I test the surround settings test in my RealTek program, but unable to play any audio, tried playing both in my local machine and from the internet.

    Read the article

  • Problem with Executing Mysql stored procedure

    - by karthik
    The stored procedure builds without any problem. The purpose of this is to take backup of selected tables to a script file. when the SP returns a value {Insert statements}. I am using the below MySql stored procedure, created by SQLWAYS [Tool to convert MsSql to MySql]. The actual MsSql SP is from http://www.codeproject.com/KB/database/InsertGeneratorPack.aspx When i execute the SP in MySql Query Browser, It says "Unknown column 'tbl_users' in 'field list'" What would be the problem ? Because there was no error when i build-ed this Converted MySql SP. Help.. DELIMITER $$ DROP PROCEDURE IF EXISTS `demo`.`InsertGenerator` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `InsertGenerator`(v_tableName VARCHAR(100)) SWL_return: BEGIN -- SQLWAYS_EVAL# to retrieve column specific information -- SQLWAYS_EVAL# table DECLARE v_string NATIONAL VARCHAR(3000); -- SQLWAYS_EVAL# first half -- SQLWAYS_EVAL# tement DECLARE v_stringData NATIONAL VARCHAR(3000); -- SQLWAYS_EVAL# data -- SQLWAYS_EVAL# statement DECLARE v_dataType NATIONAL VARCHAR(1000); -- SQLWAYS_EVAL# -- SQLWAYS_EVAL# columns DECLARE v_colName NATIONAL VARCHAR(50); DECLARE NO_DATA INT DEFAULT 0; DECLARE cursCol CURSOR FOR SELECT column_name,data_type FROM `columns` WHERE table_name = v_tableName; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN SET NO_DATA = -2; END; DECLARE CONTINUE HANDLER FOR NOT FOUND SET NO_DATA = -1; OPEN cursCol; SET v_string = CONCAT('INSERT ',v_tableName,'('); SET v_stringData = ''; SET NO_DATA = 0; FETCH cursCol INTO v_colName,v_dataType; IF NO_DATA <> 0 then -- NOT SUPPORTED print CONCAT('Table ',@tableName, ' not found, processing skipped.') close cursCol; LEAVE SWL_return; end if; WHILE NO_DATA = 0 DO IF v_dataType in('varchar','char','nchar','nvarchar') then SET v_stringData = CONCAT(v_stringData,'SQLWAYS_EVAL# ll(',v_colName,'SQLWAYS_EVAL# ''+'); ELSE if v_dataType in('text','ntext') then -- SQLWAYS_EVAL# -- SQLWAYS_EVAL# else SET v_stringData = CONCAT(v_stringData,'SQLWAYS_EVAL# ll(cast(',v_colName,'SQLWAYS_EVAL# 00)),'''')+'''''',''+'); ELSE IF v_dataType = 'money' then -- SQLWAYS_EVAL# doesn't get converted -- SQLWAYS_EVAL# implicitly SET v_stringData = CONCAT(v_stringData,'SQLWAYS_EVAL# y,''''''+ isnull(cast(',v_colName,'SQLWAYS_EVAL# 0)),''0.0000'')+''''''),''+'); ELSE IF v_dataType = 'datetime' then SET v_stringData = CONCAT(v_stringData,'SQLWAYS_EVAL# time,''''''+ isnull(cast(',v_colName, 'SQLWAYS_EVAL# 0)),''0'')+''''''),''+'); ELSE IF v_dataType = 'image' then SET v_stringData = CONCAT(v_stringData,'SQLWAYS_EVAL# ll(cast(convert(varbinary,',v_colName, 'SQLWAYS_EVAL# 6)),''0'')+'''''',''+'); ELSE SET v_stringData = CONCAT(v_stringData,'SQLWAYS_EVAL# ll(cast(',v_colName,'SQLWAYS_EVAL# 0)),''0'')+'''''',''+'); end if; end if; end if; end if; end if; SET v_string = CONCAT(v_string,v_colName,','); SET NO_DATA = 0; FETCH cursCol INTO v_colName,v_dataType; END WHILE; END $$ DELIMITER ;

    Read the article

  • How to Check for record existence and do Insert in MYSQL ?

    - by karthik
    How to Check for record existence and do Insert or Update in MYSQL ? I have a script, which has set of Insert statements for multiple tables. Now when i try to execute the Insert statement, i want to do the following.. Check for the record existence and then do Insert or Update. If the Record is not exist do Insert. If the Record is already do not do anything. How to accomplish this ? Note : The script with Insert Statements are generated programmaticaly using SP

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >