Search Results

Search found 197 results on 8 pages for 'karthikeyan karthik'.

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

  • 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

  • string function workout in php

    - by Karthik
    I have the string like this, $inp1 = "3 doses at 0[0,0], 1-2 and 6 Month[6,1] [3,2])"; in this internally, going to take the values of square bracket. How can i take this values in the square bracket? any function is there to return the string like this [0,0] [6,1] [3,2] Thanks in advance for help.

    Read the article

  • animate() not working for opacity in IE

    - by Karthik
    I'm trying to animate a div from 100% opacity to 40% opacity WITHOUT using fadeTo(). I need to use animate(). It works fine in chrome/FF/safari, but in IE, the opacity doesn't animate, it simply changes to that after the animation is done. Happens in IE 7 and 8. I'm doing this: .animate({ width: new_width, top: new_top, left: new_left, padding: new_padding, opacity: 0.4, filter: "alpha(opacity=40)" }, ... it's just not animating the opacity. Any ideas?

    Read the article

  • How to Connect to a Mysql database using PHP?

    - by Karthik
    <?php mysql_connect("localhost", "username", "password") or die(mysql_error()); echo "Connected to MySQL<br />"; ?> This is the code I am using to check if I am able to connect to Mysql. I am having problem connecting using this code. Should I change localhost to the name of the website? I tried ("www.abc.com","login username", "password") even this is not working.

    Read the article

  • Is File good for Interprocess communication

    - by Karthik
    Hi, I have an EXE and DLL running in different process. From DLL I have to send large of amount of data to EXE, which would vary from 50 chars to 2000 chars and more(The data is recordid of records saved in DB). I thought about two options to do that: 1. Using SendMessage- In which data's will be sent in batch. 2. Use an Intermediate file to transfer data. Can anyone list out the pros and cons of methods. I have developed my components using C#.NET Thanks you folks.

    Read the article

  • how do redirect values to other page without click event in html. Below code is fine IE. But Not in

    - by karthik
    I have implemented paypal in my web page. Process is 'given inputs are redirect to other page(2 nd page) which have to get that input and redirect to paypal page(third page). Here we submit data on first page. value pass to second page(in this page user interaction not allowed) after pass to third page.It works fine in IE . But Not In Mozila.Send any Solution. Code sample(second page): <%string product = Request.QueryString["productName"].ToString();% <% string amount = Request.QueryString["price"].ToString(); % " " document.all.frmpaypal.submit(); Fine in IE, Not In Mozila

    Read the article

  • Problem while adding a new value to a hashtable when it is enumerated

    - by karthik
    `hi I am doing a simple synchronous socket programming,in which i employed twothreads one for accepting the client and put the socket object into a collection,other thread will loop through the collection and send message to each client through the socket object. the problem is 1.i connect to clients to the server and start send messages 2.now i want to connect a new client,while doing this i cant update the collection and add a new client to my hashtable.it raises an exception "collection modified .Enumeration operation may not execute" how to add a NEW value without having problems in a hashtable. private void Listen() { try { //lblStatus.Text = "Server Started Listening"; while (true) { Socket ReceiveSock = ServerSock.Accept(); //keys.Clear(); ConnectedClients = new ListViewItem(); ConnectedClients.Text = ReceiveSock.RemoteEndPoint.ToString(); ConnectedClients.SubItems.Add("Connected"); ConnectedList.Items.Add(ConnectedClients); ClientTable.Add(ReceiveSock.RemoteEndPoint.ToString(), ReceiveSock); //foreach (System.Collections.DictionaryEntry de in ClientTable) //{ // keys.Add(de.Key.ToString()); //} //ClientTab.Add( //keys.Add( } //lblStatus.Text = "Client Connected Successfully."; } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void btn_receive_Click(object sender, EventArgs e) { Thread receiveThread = new Thread(new ThreadStart(Receive)); receiveThread.IsBackground = true; receiveThread.Start(); } private void Receive() { while (true) { //lblMsg.Text = ""; byte[] Byt = new byte[2048]; //ReceiveSock.Receive(Byt); lblMsg.Text = Encoding.ASCII.GetString(Byt); } } private void btn_Send_Click(object sender, EventArgs e) { Thread SendThread = new Thread(new ThreadStart(SendMsg)); SendThread.IsBackground = true; SendThread.Start(); } private void btnlist_Click(object sender, EventArgs e) { //Thread ListThread = new Thread(new ThreadStart(Configure)); //ListThread.IsBackground = true; //ListThread.Start(); } private void SendMsg() { while (true) { try { foreach (object SockObj in ClientTable.Keys) { byte[] Tosend = new byte[2048]; Socket s = (Socket)ClientTable[SockObj]; Tosend = Encoding.ASCII.GetBytes("FirstValue&" + GenerateRandom.Next(6, 10).ToString()); s.Send(Tosend); //ReceiveSock.Send(Tosend); Thread.Sleep(300); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }

    Read the article

  • How to execute commands in Command Prompt using c#

    - by karthik
    I want to execute these steps in CMD using c# 1 - CD C:\MySQL\MySQL Server 5.0\bin 2 - mysqldump -uroot -ppassword sample d:\Test\222.sql On manually doing this, i will get file named "222.sql" I am using the below code to do it, but missing something.. Nothing Happens public void CreateScript_AAR() { string commandLine = @"CD C:\MySQL\MySQL Server 5.0\bin\mysqldump -uroot -ppassword sample> d:\Test\222.sql"""; System.Diagnostics.ProcessStartInfo PSI = new System.Diagnostics.ProcessStartInfo("cmd.exe"); PSI.RedirectStandardInput = true; PSI.RedirectStandardOutput = true; PSI.RedirectStandardError = true; PSI.UseShellExecute = false; System.Diagnostics.Process p = System.Diagnostics.Process.Start(PSI); System.IO.StreamWriter SW = p.StandardInput; System.IO.StreamReader SR = p.StandardOutput; SW.WriteLine(commandLine); SW.Close(); }

    Read the article

  • Stored Procedure to create Insert statements in MySql ??

    - by karthik
    I need a storedprocedure to get the records of a Table and return the value as Insert Statements for the selected records. For Instance, The stored procedure should have three Input parameters... 1- Table Name 2- Column Name 3- Column Value If 1- Table Name = "EMP" 2- Column Name = "EMPID" 3- Column Value = "15" Then the output should be, select all the values of EMP where EMPID is 15 Once the values are selected for above condition, the stored procedure must return the script for inserting the selected values. The purpose of this is to take backup of selected values. when the SP returns a value {Insert statements}, c# will just write them to a .sql file. I have no idea about writing this SP, any samples of code is appreicated. Thanks..

    Read the article

  • How to remove the MenuBar of an application using windows API ?

    - by karthik
    I am using the below code to remove the Title Bar of an application, which is working perfectly for notepad. Now i want to remove the Menu Bar also. How to achieve it ? //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); [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); //assorted constants needed public static int GWL_STYLE = -16; 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 public void WindowsReStyle() { Process[] Procs = Process.GetProcesses(); foreach (Process proc in Procs) { if (proc.ProcessName.StartsWith("notepad")) { IntPtr pFoundWindow = proc.MainWindowHandle; int style = GetWindowLong(pFoundWindow, GWL_STYLE); SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_CAPTION)); } } }

    Read the article

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