5,346 Posted Topics

Member Avatar for JamesKox

Dear JamesKox, Your code is itself a trouble. If your stream is buffered or FileStream or ByteArrayStream then you may use available() method to return the count of unread bytes.

Member Avatar for kvprajapati
0
2K
Member Avatar for chengkochung
Member Avatar for kvprajapati
0
121
Member Avatar for hesham_51

Hi! Hope this code will resolve your problem. [CODE] using System.Collections; using Microsoft.Office.Interop.Excel; using System; using System.Reflection; class Sample { static void Main() { string file = @"c:\csnet\jap\ex1\sample1.xls"; Microsoft.Office.Interop.Excel.ApplicationClass ap = new ApplicationClass(); Missing m=Missing.Value; Workbook wb=ap.Workbooks.Open(file, m, m, m, m, m, m, m, m, m, m, m, m, m, …

Member Avatar for Poojasrivastava
0
452
Member Avatar for Duki

[QUOTE=Duki;872239]I am trying to convert an array of longs to an array of chars. There are 1081 elements in the long array. Each element is 4 digits long. Is there a function in C++ that will convert a long something I can store in the array or could someone point …

Member Avatar for tux4life
0
250
Member Avatar for sanushks

I think the following code help you to solve your problem. [CODE] char s1[100]="1123#!3344#!948#!20"; char *p; int i=0; do { p=strtok(s1+i,"#!"); i=i+strlen(p)+2; printf("\n%s",p); }while(p!=NULL); [/CODE] [QUOTE] Note: strtok is prototyped in string.h header file. [/QUOTE]

Member Avatar for cool_zephyr
0
212
Member Avatar for Pramoda.M.A

[QUOTE=Pramoda.M.A;871830]code is : code is : path = (char*)malloc(100); pname = (char*)malloc(100); path = "ragHu"; strcpy(pname, path); free(path); whats wrong with this?[/QUOTE] [CODE]path = (char*)malloc(100);[/CODE] statement allocates heap and assign base address to the path if allocation is success. (we assume that the allocation is succeed) [CODE]path = "ragHu";[/CODE] - …

Member Avatar for Salem
0
130
Member Avatar for vedmack

You may get the solution at [URL="http://www.catenary.com/howto/bmpview.html"]http://www.catenary.com/howto/bmpview.html[/URL]

Member Avatar for peter_budo
0
183
Member Avatar for cool_zephyr

Two functions of dir.h header file namely [B]findfirst [/B] and [B]findnext [/B] are used to access the files/folders.

Member Avatar for Salem
0
104
Member Avatar for bharanidharanit

Name property of Button in .aspx file is different then its code behind file.

Member Avatar for mail2saion
0
97
Member Avatar for kanodi

Once you packed XML file into JAR/WAR/EAR use ClassName.class.getResourceAsStream() Method. Here is an example: Std.xml [XML File] [CODE] <?xml version="1.0" ?> <Students> <Std ClassName="1st"> <Roll>10</Roll> <Name>Mr. Raj</Name> </Std> <Std ClassName="3rd"> <Roll>11</Roll> <Name>Mr. Rohan</Name> </Std> </Students> [/CODE] ReadStd.java [CODE] import org.w3c.dom.*; import javax.xml.parsers.*; import java.io.*; public class ReadStd { public static …

Member Avatar for kanodi
0
216
Member Avatar for dip7

You may use Dialog (Kind of Form - Windows) windows for the purpose of redering charts/images.

Member Avatar for Diamonddrake
0
136
Member Avatar for kvprajapati

I have two integer numbers. I want to find which number is greater than other one without using relational operators.

Member Avatar for Dave Sinkula
0
181
Member Avatar for sneharaveendran

Welcome sneharaveendran, Please read [URL="http://www.daniweb.com/forums/announcement9-3.html"]http://www.daniweb.com/forums/announcement9-3.html[/URL] before to post your problem. I have re-write your code and add comments where it is required. [CODE] public class Test { public static void main(String[] args) { String line=".Raghu"; System.out.println(line); char[] h= line.toCharArray(); // char[] f=null; // it is a cause of an error …

Member Avatar for sneharaveendran
0
98
Member Avatar for starsinthesky

Server resources are precious. Opening a database connection counts you are the user and database create a new thread to serve you. A new thread is alive till user send disconnect command through Close() method. I think you got it.

Member Avatar for kvprajapati
0
69
Member Avatar for MrDiaz

Dear, Think about XML. You said that your application is sort of log system; Use JDOM API instead of Java's DOM or SAX.

Member Avatar for JamesCherrill
0
192
Member Avatar for bokz06

I have changed "actionPerformed" Method : [CODE]import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.*; import javax.swing.table.AbstractTableModel; import java.io.*; import java.util.*; import javax.swing.table.*; import java.awt.*; import java.awt.event.*; import javax.swing.JButton.*; import javax.swing.event.ListSelectionEvent; public class panel extends JFrame { private JTable table; private JButton button; static ArrayList<String[]> rosterList = new ArrayList<String[]>(); …

Member Avatar for JamesCherrill
0
2K
Member Avatar for squinx22

[QUOTE=squinx22;868452]hi, Thanks for the reply, I have no idea about huffman coding. But, i'll try to explain again what I wana do. For example, in a certain webserver, there is a limit of filesize that could be uploaded one at a time and you have a file that is greater …

Member Avatar for JamesCherrill
0
89
Member Avatar for ice_cool

Dear ice_cool, Don't paste your code like you did in this post. please use BB Code. Please read this link [URL="http://www.daniweb.com/forums/announcement9-3.html"]http://www.daniweb.com/forums/announcement9-3.html[/URL]

Member Avatar for kvprajapati
0
1K
Member Avatar for Fritzli

Set KeyPreview=True and Handles KeyDown Event of Form [CODE] private void Form1_Load(object sender, EventArgs e) { int x=10,y=10; for (int i = 1; i <= 3; i++) { x=10; for (int j = 1; j <= 3; j++) { TextBox t1 = new TextBox(); t1.Location = new Point(x, y); t1.Size …

Member Avatar for Fritzli
0
937
Member Avatar for anandarju

[QUOTE=anandarju;867743]I need to know how to access two tables which has some reference values within the table.I need the Java Code to Fetch Both the tables values which are same and have to display it[/QUOTE] Dear, There is no code of Java to fetch data from databases. Obviously, it is …

Member Avatar for kvprajapati
0
92
Member Avatar for lkw8888

Use BB Code. Please read [URL="http://www.daniweb.com/forums/announcement9-3.html"]http://www.daniweb.com/forums/announcement9-3.html[/URL]

Member Avatar for JamesCherrill
0
94
Member Avatar for sivak

A “web service”, is a technology that provides an interface for some functionality to make it accessible from other programs across the web. This functionality might be obtaining data from a database, performing a mathematical calculation, or enabling remote control of a device. Dear sivak, Read MSDN notes for Web-Service. …

Member Avatar for kvprajapati
0
80
Member Avatar for DevC++4.9.9.2

Use the following code : [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { string s = ""; Sample a = new Sample(); a.Refresh(); // re-paint a form do { s = Console.ReadLine(); a.MyText = s; a.Refresh(); // re-paint a …

Member Avatar for DevC++4.9.9.2
0
1K
Member Avatar for functionalCode

I think that your main thread get blocked - My suggestion is an example: [CODE] import java.awt.*; import java.io.*; import java.util.StringTokenizer; import javax.swing.*; import java.awt.event.*; public class Test extends JFrame { JButton b1=new JButton("Start"); JTextField t1=new JTextField("",20); public Test() { super("Simple Program"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().setLayout(new FlowLayout()); getContentPane().add(t1); getContentPane().add(b1); b1.addActionListener(new ActionListener() { …

Member Avatar for BestJewSinceJC
0
113
Member Avatar for grisha83

[QUOTE=grisha83;867610]Oops sorry, I am using Java. Also, im not sure where i am using it. I was just reading my textbook and the author has noted that i have to select a node after which i want to input new node.[/QUOTE] Mr. Author says that "Where you want to add …

Member Avatar for BestJewSinceJC
0
123
Member Avatar for sivak

[QUOTE=sivak;867666]when we go for webservices in .net ..if any one using webservices can u share that code and explain me ..is there any video learning thing about webservices?thanks in advance plz help me out[/QUOTE] You should read MSDN documentation.

Member Avatar for kvprajapati
0
61
Member Avatar for llemes4011

A Bean is simply a Java class that follows a set of simple naming and design conventions outlined by the JavaBeans specification. Beans are not required to extend a specific base class or implement a particular interface. If a class follows these Bean conventions, and you treat it like a …

Member Avatar for JamesCherrill
0
42
Member Avatar for sivak

[B]Abstract Classes[/B] Sometimes you may want to declare a class and yet not know how to define all of the methods that belong to that class. For example, you may want to declare a class called Writer and include in it a member method called Write. However, you don't know …

Member Avatar for kvprajapati
-1
135
Member Avatar for something78
Member Avatar for something78
0
93
Member Avatar for HunterFish

HunterFish has no idea about Text or XML file. Thanks to Ancient Dragon; Dashing code, Indeed.

Member Avatar for HunterFish
0
201
Member Avatar for raghuprasad

[QUOTE=raghuprasad;867080]hi, I am able to display a single image from the database on a webpage using the following code: rs1 = st1.executeQuery("select image from pictures where id='5'"); if(rs1.next()){ int len = imgLen.length(); byte [] rb = new byte[len]; InputStream readImg = rs1.getBinaryStream(1); int index=readImg.read(rb, 0, len); System.out.println("index"+index); st1.close(); response.reset(); response.setContentType("image/jpg"); …

Member Avatar for kvprajapati
0
785
Member Avatar for jonnytabpni

Simple solution is that remove the references of old dll from your project and add reference of new dll, build it and deploye it.

Member Avatar for JerryShaw
0
165
Member Avatar for dproun

Where is object reference variable: [CODE] class Philosopher extends Thread { int i; int minThinkTime, maxThinkTime, minEatTime, maxEatTime; .... .... @Override public void run() { while(true) { think(); // diningRoom and forks are not declared !!! diningRoom.enter(); forks.take(i); eat(); forks.release(i); diningRoom.exit(); } } } [/CODE]

Member Avatar for dproun
0
139
Member Avatar for DotA
Member Avatar for DotA
0
125
Member Avatar for Mitja Bonca

[QUOTE=Mitja Bonca;864174]I have created my own dataset: this.abcTableAdapter.Fill(this.dataSet1.abc); And I created DataGridViewComboBoxColumn called AllGrades: DataGridViewComboBoxColumn AllGrades = new DataGridViewComboBoxColumn(); for (int grade = 5; grade <= 10; grade++) { AllGrades.Items.Add(grade); } AllGrades.DataPropertyName = "Grade"; AllGrades.HeaderText = "Grade"; AllGrades.Width = 60; AllGrades.MaxDropDownItems = 6; AllGrades.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; dataGridView1.Columns.Add(AllGrades); In a dataGridView …

Member Avatar for kvprajapati
0
138
Member Avatar for dragonspectrum

[QUOTE=dragonspectrum;74985]I am trying to access a Clientside server file from an HTML file. Can anyone help me with how to code it? :eek: here is what I have: <form method="get" <if true then action=" :?: *****This is were I need to access Client side server ****** " else action= "file:///K:/web-content/Client …

Member Avatar for kvprajapati
0
275
Member Avatar for TeCNoYoTTa

[QUOTE=TeCNoYoTTa;865015]hello All I want to make a chat program where people enter a room and chat together :D like IRC i intend to use C# ....but i need to use free server [not ASP server :D] soo how can i do that :D ??[/QUOTE] Which kind of application - web …

Member Avatar for kvprajapati
0
72
Member Avatar for DaveD3

Dear, Visit the link [URL="http://www.codeproject.com/KB/grid/PrintDataGridView.aspx"]http://www.codeproject.com/KB/grid/PrintDataGridView.aspx[/URL]

Member Avatar for kvprajapati
0
119
Member Avatar for Sri_r

[QUOTE=Sri_r;865106]I am a junior Developer, working on asp.net,C#. I would require some code guidence in c#. Right now i am working on server controls, as in on click of radio button, data in dropdownlist shld appear. i have done this on javascript but trying do this in c#. Can anyone …

Member Avatar for kvprajapati
0
89
Member Avatar for sarita_sree

[QUOTE=sarita_sree;864568]Can u suggests me some powerfull but understandable java code for encrypting and decrypting password.The password should be encrypted and stored into the database and can be retrived ,decrypted[/QUOTE] Package [B]java.security [/B] has set of classes for your purpose. Especially, java.security.MessageDigest class with SHA or MD5 algorithm are used to …

Member Avatar for kvprajapati
0
68
Member Avatar for hemisphere

I hope you will add your sql statement. The code snippet show the sql query when you press a button. [CODE] private void button1_Click_1(object sender, EventArgs e) { if (listBox1.SelectedItems.Count == 0) { MessageBox.Show("select items"); return; } string s = ""; for (int i = 0; i < listBox1.SelectedItems.Count; i++) …

Member Avatar for kvprajapati
0
2K
Member Avatar for dip7

Sure, you can do this. [CODE] private void Form1_Load(object sender, EventArgs e) { Button b1 = new Button(); b1.Size = new Size(200, 200); Button b2 = new Button(); // Adding event b2.Click += new EventHandler(test); b1.Controls.Add(b2); Controls.Add(b1); } void test(object sender, EventArgs e) { MessageBox.Show("hi"); }[/CODE]

Member Avatar for kvprajapati
0
440
Member Avatar for monem

[QUOTE=monem;864059]Hello" I want to capture live video from web-cam to view it in a web page to access it using mobile phone and software i'm using is java jdk6,jakarta Tomcat as server and the web page is JSP. Thanks[/QUOTE] Please check this link : [URL="http://www.astahost.com/info.php/introduction-artificial-intelligence_t9807.html%5B/b%5D%5B/b%5D%5Blist=%5D%5B/video-streaming-web-browser-through-java-jsp_t9888.html"]http://www.astahost.com/info.php/introduction-artificial-intelligence_t9807.html%5B/b%5D%5B/b%5D%5Blist=%5D%5B/video-streaming-web-browser-through-java-jsp_t9888.html[/URL]

Member Avatar for kvprajapati
0
70
Member Avatar for mitra.uttam

You are attempting to access restricted resource. i.e. you haven't permission to access this resource.

Member Avatar for kvprajapati
0
125
Member Avatar for Califer

DataSet is has a solution of your problem. Consider the following code: [CODE] DataSet ds = new DataSet(); // Read XML File ds.ReadXml(@"c:\test1\WindowsApplication1\a1.xml"); // Assign Reference of Object - DataTable // DataTable dt=ds.Tables["Object"]; dataGridView1.DataSource = ds.Tables["Object"]; dataGridView2.DataSource = ds.Tables["SecondObject"];[/CODE]

Member Avatar for kvprajapati
0
229
Member Avatar for asian_al

Here is your code. [CODE]import java.awt.*; import java.io.*; import java.util.StringTokenizer; import javax.swing.*; import java.awt.event.*; public class ex74 extends JFrame { JButton b1=new JButton("OK"); JTextField t1=new JTextField("",20); String output=""; public ex74() { super("Simple Program"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().setLayout(new FlowLayout()); getContentPane().add(t1); getContentPane().add(b1); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { output=""; String sent; StringTokenizer …

Member Avatar for kvprajapati
0
92
Member Avatar for dazzagaelic
Member Avatar for dazzagaelic
0
181
Member Avatar for taruj83

[QUOTE=taruj83;863350]Hi, I want to create a web application that will let a user enter name in a text field and the application creates a newtab with datafields for that user to enter, it all must happen on a single page. There has to be one tab for each specific name …

Member Avatar for BestJewSinceJC
0
111
Member Avatar for BestJewSinceJC

Please refere [URL="http://java.sun.com/products/jfc/tsc/articles/painting/index.html"]http://java.sun.com/products/jfc/tsc/articles/painting/index.html[/URL]

Member Avatar for BestJewSinceJC
0
138
Member Avatar for cebubinary

Dear, please refere this link [URL="http://www.javalobby.org/articles/ultimate-image/"]http://www.javalobby.org/articles/ultimate-image/[/URL]

Member Avatar for kvprajapati
0
58

The End.