Quantcast
Channel: Programming Forums
Viewing all 51036 articles
Browse latest View live

Windows Phone 8 LongListSelector loses large items

$
0
0
I am working on an app that gets bbcode from a website, converts it to the appropriate UIElements and then adds it to a wrap panel via a dependency property which is in a LongListSelector. All of that code works fine, however when the bbcode contains a lot of images or is just very long I have something weird happen. When you scroll about halfway down the large item it gets unrealized and disappears from the screen and never comes back. The rest of the items in the list show fine, but if you scroll up or down to where the large item is, it never shows. I have tried adding my wrappanel to a stackpanel and it shows properly. I have also taken my wrappanel property and just had it add a bunch of textblocks and that also skips past the long one about half way down. Here is my test code for the LLS and the WrapPanel


XAML
<Grid x:Name="ContentPanel" Grid.Row="2" Margin="12,0,12,0">
    <phone:LongListSelector 
        x:Name="MainLongListSelector"
        Margin="0,0,-12,0"
        ItemsSource="{Binding PostList}">
                
        <phone:LongListSelector.ItemTemplate>
            <DataTemplate>
                <toolkit:WrapPanel wrapx:Properties.BBCode="{Binding PostContent}"/>
            </DataTemplate>
        </phone:LongListSelector.ItemTemplate>
    </phone:LongListSelector>
</Grid>



WrapPanel Properties
public class Properties : DependencyObject
{
    public static readonly DependencyProperty BBCodeProperty =
        DependencyProperty.RegisterAttached("BBCode", typeof(string), typeof(Properties), new PropertyMetadata(null, BBCodeChanged));

    public static void SetBBCode(DependencyObject obj, string value)
    {
        obj.SetValue(BBCodeProperty, value);
    }

    public static string GetBBCode(DependencyObject obj)
    {
        return (string)obj.GetValue(BBCodeProperty);
    }

    private static void BBCodeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        WrapPanel panel = d as WrapPanel;
        if (panel == null) 
            return;

        panel.Children.Clear();

        for (int i=0; i<3000; i++)
        {
            TextBlock t = new TextBlock();
            t.Width = 500;
            t.Text = i.toString();
            panel.Children.Add(t);
        }
    }



Is there any way to stop my larger items from being unrealized?

Theater Seating project help.

$
0
0
I am having trouble getting the running total to in this code, it runs but in case 4 the part with the call for the running total is just giving me the same number 589505315. Hope it is just a simple overlook on my end like usual. Here is my code. Any help is appreciated.

#include <iostream>
#include <iomanip>
using namespace std;
 

int Show_Menu ();                //To show Menu
int Purchase_Ticket ();         //To purchase ticket
void Show_Chart ();            //To show the seating chart

const char FULL = '*';          //Seats taken
const char EMPTY = '#';         //Seats open
const int columns = 10;        //Number of seats per row
const int Num_Rows = 5;        // Number of row
char chart [Num_Rows][columns];    //Array to hold seating chart

double price;				  // To hold the price

int total = 0;				// Total price of ticket
int seat = 50;				// Total number of seats
int Quit = 1;

int main ()
{
int price [Num_Rows];
int row2 = 0, column2, cost;
int answer;
 
    cout << "Welcome to Michael Greger's wonderful, stupendious, magnificent theatre.\n";
 
    for (int count = 0; count < Num_Rows; count++)
        {
            cout << "Please enter the price by row, row " << (count + 1) << ": ";
                cin >> price [count];
              
       }
 
    for (int i = 0; i <= Num_Rows; ++i)
        {
            for (int j = 0; j <= columns; ++j)
                chart [i][j] = EMPTY;
        }
 
int choice;
    do
    {
       choice = Show_Menu();
 
        switch (choice)
        {
            case 1:
                cout << "View Seat Prices\n\n";
                for (int count = 0; count < Num_Rows; count++)
               {
                   cout << "The price for row " << (count + 1) << ": ";
                    cout << price [count] << endl;
                }
 
                break;
 
            case 2:
                cout << "Purchase a Ticket\n";
                do
                {
					Show_Chart ();
					cout << "\n# indicates an open seat and * indicates an unavaliable seat.\n";
                    cout << "Please select the row you would like to sit in: ";
                    cin >> row2;
                    cout << "Please select the seat you would like to sit in: ";
                    cin >> column2;
					if (row2 > 5 || column2 > 10)
					{
						cout << "Please input a valid seat.";
					}
					else if (chart [row2] [column2] == '*')
                        {
                            cout << "Sorry that seat is taken, Please select a new seat.";
                            cout << endl;
                        }
 
                    else
                    {

                        cost = price [row2 - 1];
                        cout << "That ticket costs: " << cost << endl;
                        cout << "Confirm Purchase? Enter (1 = YES / 2 = NO)";
                        cin >> answer;
                       
                        if (answer == 1)
                        {
                            cout << "Your ticket purchase has been confirmed." << endl;
                            chart [row2][column2] = FULL;
							total = total + cost;
                        }
                        else if (answer == 2)
                        {
                            cout << "Would you like to look at another seat? (1 = YES / 2 = NO)";
                            cout << endl;
                            cin >> Quit;
                        }
                        
                       cout << "Would you like to look at another seat?(1 = YES / 2 = NO)";
                        cin >> Quit;
                    }
 
                }
                while (Quit == 1);
                break;
 
            case 3:
                cout << "View Available Seats\n\n";
                Show_Chart ();
                break;
            case 4:
				cout << "The total sales are " << total << endl;
				break;
            case 5:
                cout << "quit\n";
                break;
            default : cout << "Error input\n";

			
        }
		

    } while (choice != 5);
return 0;
}

int Show_Menu()

{

    int MenuChoice;
        cout << " \n\tMAIN MENU\n";
        cout << " 1. View Seat Prices.\n";
        cout << " 2. Purchase Tickets.\n";
        cout << " 3. View Available Seats.\n";
		cout << " 4. To view the total sales.\n";
        cout << " 5. Quit the program.\n\n";
        cout << "Please enter your choice: ";
        cin >> MenuChoice;
        cout << endl << endl;
    return MenuChoice;
}

 

void Show_Chart ()

{

    cout << "\tSeats" << endl;

    cout << "      1 2 3 4 5 6 7 8 9 10\n";
	 
        for (int count = 1; count <= 5; ++count)
        {
            cout << endl << "Row " << count;
 
            for (int count2 = 1; count2 <= 10; ++count2)
            {
                cout << " " <<  chart [count] [count2];
            }
        }
            cout << endl;
}



Adding an ID

$
0
0
Hi, I've created a form where someone can type in Forename and Surname and adding these details to a file. What I've been trying to do is create, basically an ID for each user, i.e. when the first user inputs their info an automatic ID is created and for each other user the count goes up by one. Here is the code I've done so far:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim id As Integer = 0
        Dim users As String = "C:\Users\Home\Desktop\users.txt"


        Dim objWriter As New System.IO.StreamWriter(users, True)

        While id <= 11
            objWriter.Write(id)
            objWriter.Write("," + Trim(txtForename.Text) + ",")
            objWriter.Write(Trim(txtSurname.Text) + vbCrLf)
            id = id + 1

            MsgBox(txtForename.Text & "now added!")
        End While



        objWriter.Close()

    End Sub


I've tried a , for function, and a while loop, but when running the program the info doesn't get written to file and just loops. Anyone got any idea of what I could try?

(New to VB so go easy on me :P/>/>/>)

Use variable from textbox and run command line

$
0
0
Hi guys.. I'm having so many issues with this.

What I need to do is:
1. Have a form with:
A: 1 button
B: 1 text box

When I click on the button I should be able to get this in a command prompt: "livestreamer (string from textbox) best"

I've tried:
Process.start ("cmd","/k  "livestreamer"  & Textbox1.Text & "base")


So this "works", but I get: "livestreamer stringbase"
So string and "base" are together. No space.

I've tried using
("cmd","/k  "livestreamer"  & Textbox1.Text " &  """" & "base")

but it's still together.

I've also tried

Dim TestString As String 
TestString = Space(1)

Process.start ("cmd","/k  "livestreamer"  & Textbox1.Text & Space(1) & "base")

But I still get nothing.
This is driving me crazy.

Can anyone help me with this code?
Thanks

AttributeError: 'MyClass' object has no attribute

$
0
0
Hi guys

I need a bit of your help. I've created the variables that I want to store a list of arrays outside the for loop. I have got a problem with the code that I currently using.

When I try this:

    import xbmc
    import xbmcgui
    import xbmcaddon
    
    class ProgramControls(object):
         def __init__(self, control, program):
             self.control = control
             self.program = program
    
    class MyClass(xbmcgui.WindowXML):
    
         def __init__(self):
             self.program_buttons = list()
             self.button_focus = 'programs_yellow.png'
             self.button_nofocus = 'channels_bar1.png'

     program_controls = xbmcgui.ControlButton(
            int(position_start), 
            int(position_top), 
            int(program_width), 
            int(program_height), 
            program_title, 
            focusTexture = path + self.button_focus, 
            noFocusTexture = path + self.button_nofocus,
            textColor ='0xFFFFFFFF',
            focusedColor ='0xFF000000'
        )
        self.program_buttons.append(ProgramControls(program_controls, program))
    programs_button = [elem.control for elem in self.program_buttons]
    program_id = list()
    program_width = list()
    
    for elem in programs_button:
        program_id = elem.getId()
    print program_id
    self.addcontrols(programs_button)



It will give me the error: AttributeError: 'MyClass' object has no attribute 'programs_button'

The error are jumping on this line:

for elem in self.programs_button:



Can you please help me how I can fix this?

How to enable the number pad keys to display number in a label

$
0
0
I am very new to VB and to gain more experience I'm trying to build a calculator. I have it in a working form but would like to enable the number pad keys to input the number to a label. I've tried searching but no luck. All the info I have seen is very old and I think that might be why its not working for me. If you can help that would be great! Thanks!

Also: I would like to enable the keys D0 through D9

New to python trying to write multiple choice quiz with a loop.

$
0
0
Trying to write a python program that's interactive with the user. I am currently learning python the hard way from Zed Shaw and what I like to do is after I learn a lesson, I like to make a sample program using what I learned so I can get the feel of what I learned from that lesson better. This program I am trying to write is similar to the movies 2001: A space odyssey and the 1983 war games. Trying to make it as interactive as possible. Right now, I am stuck where the user selects the game they wish to play or not play the game it won't print the response. My other question is when the user selects the "no", how would I program an endless loop that can be broken? Every time I try it won't let me. I've tried different ways and can't figure it out.
Any and all help would be greatly appreciated.

This is my program:
prompt='<'
beto1="1. Checkers"
beto2="2. Tic tac toe"            
beto3="3. surprise!!!!"
beto4="4. Global Thermonuclear War."
pc="\n* checkers\n * Tic tac toe\n * Surprise\n * Global Thermalnuclear war"
GTW="Global Thermonuclear War"
chess="chess"
stars="\nDON'T DO IT!!!!"
name=raw_input("what is your name?(press enter after inputting any data)")
print"Hello %s, my name is H.A.L." % (name)
raw_input("Shall we play a game?:")
print"What game would you like to play?"
print"%s"%(pc)
a=raw_input()
a=a.lower
if a =="global thermonuclear war":
        print"How about a nice game of chess?"
if a =="checkers":
        print"You don\'t want to play something harder?"
if a =="tic tac toe":
        print"What are you three years old?"
if a =="surprise":
        print"MY GOD, IT\'S FULL OF STARS!!!! DON'T DO IT %s!!!!"%(name)
if a =="no" or a =="n":
 a= 1
while a ==1:
  print "Too bad I was looking for a challenge, thanks for trying goodbye:"

Parsing an array with multiple parents and combining children

$
0
0
Hey Guys - I asked a similar question in the database forum a few weeks ago and made some really good headway but not I'm stuck at a slightly different point. Here's my problem...

I have a query that I run to pull data from 4 or 5 tables. It works great but if there are multiple children then the parent is returned as part of the array with multiple sub-arrays. I want to parse the array and retrieve the relevant data but I'm not sure of the best way to go about it. I know PHP has a strong subset of predefined functions that handle arrays and MySQL so I wasn't sure if there was something I was just missing. Also, I'm using PDO in case it makes a difference.

Here's my example. I have the following tables

Parent (locations)
Address (addresses)
Phone (phones)
Geographic Data (geodata)

When I pull the data there should only be one line from each table except for phones. There could be 2 or 3 phone numbers listed. All great except my query then has the parent data with associated child data listed multiple times for each phone line. When I get the array, I've thought of two ways to handle it...but I'm not sure.

1) Loop the array and compare the current key to the previous key. If different, close old div, print new. If not, add new child to existing div. This seems like overkill for such a simple task and it seems a bit primitive considering the robust functions available for other things.

2) I've played with array_map and array_unique a little. With a combination of the two, I can get the unique keys out. The problem here is once I have the unique values, I'm not really sure how to grab the corresponding children and create a new array with children grouped under parent correctly.

Is there something I'm missing? I don't have any PHP to post but I am going to post my query just in case there is something I can do there to help as well. Also, I'm not looking for anyone to give me the code here - just a nudge in the right direction would be great.

Thanks in advance!!

SELECT 04_rest_00_locations.Name, 
04_rest_00_locations.Description, 
04_rest_00_locations.RNID,
04_rest_01_addresses.Add1,
04_rest_01_addresses.Add2,
02_driver_geodata.primary_city,
02_driver_geodata.state,
02_driver_geodata.zip,
04_rest_01_phones.AreaCode,
04_rest_01_phones.Prefix,
04_rest_01_phones.LineNum
FROM 04_rest_00_locations 
LEFT JOIN 04_rest_01_addresses
ON 04_rest_00_locations.id = 04_rest_01_addresses.RestID
AND GroupID 
IN (SELECT 04_rest_00_locations.GroupID 
    FROM 04_rest_00_locations 
    WHERE RestID = $RestID)
LEFT JOIN 04_rest_01_phones
ON 04_rest_00_locations.id = 04_rest_01_phones.RestID
AND 04_rest_01_phones.active = 1
AND 04_rest_01_phones.IsPublic = 1
AND 04_rest_01_phones.PhoneType = 1
LEFT JOIN 02_driver_geodata
ON 04_rest_01_addresses.CSZID = 02_driver_geodata.id
AND 04_rest_01_addresses.active = 1
AND 04_rest_01_addresses.AddType = 1
WHERE 04_rest_00_locations.active = 1
AND 04_rest_00_locations.Published = 1


Making a Webservice for already developed software

$
0
0
how a webservice can be developed for already developed software , let me clear my question by an example . we have a builtin windows calculator so i want other users to use this calculator.For this i have to create webservice for this already developed calculator.Now how could i develop a webservice for already made software.So i hope every one would have understood my question.

NOTE: I want to do this in C# AND ASP .NET ...

WP8 Network capabilities

$
0
0
Does anyone know how I'd be able to go about(just as a simple example) scanning a network for IP addresses and resolving hostnames on WP8. I know Windows Phone isn't a popular platform, but I figured I'd give it a shot just to see WHY people despise it so much.

I'm already seeing why people dislike the platform, but I'd like to try and contribute to it just a little since I've played with every other phone's sdk.

Thanks,
-UW

P.S. Yes, I did research, I didn't come up with anything useful which is why I came here.

JDBC4/SQL or Hibernate/ORM?

$
0
0
Hi DIC,

I have an upcoming thesis project that may be used by the school itself if the system proves to be good. It is a web application (Struts2) for an Online Teacher's Performance Evaluation System.

The database (MySQL) is expected to have the following:
  • 20 tables
  • 2000 records
  • 2000 users of the system
  • Perform AVG() to calculate the teacher's average performance score

(All estimates already come with considerable allowance.)

With a project this scale, is it advisable to go with plain JDBC4/SQL or use Hibernate/ORM?

Editing the width of program in Visual Basic?

$
0
0
I hope you will give advice on how to progress further with such matter.

Situation

I have a handheld device with Windows Mobile 6.5 OS. There is a custom program/app in it used for ticking/answering certain questions and then syncing the gathered info to server. The interface is very HTML like, web-forms etc., very basic.

However, when using the program in portrait mode the annoying unnecessary margins are present.
When changed to landscape mode - the scrolling is gone. The resolution of the device is 640x480.

Clearly the width of the program has not been adapted for the portrait mode.

This is so simple in HTML, CSS. I see there is Program-GUI.exe file.

I looked at examples of width properties in Visual Basic.

How do I progress further regarding this?

Magento : The Hot Cake for ecommerce Development

$
0
0
Have you ever tried to create your online store with the help of world’s leading brand trust? Till date millions of businesses owners have built their online store using eCommerce Platform with the help of Magento Platform which is trusted by more than 11, 125,000 Merchants and users as per recent statistics of Newspaper. As We aware with the fact that every business requests need to be contend and requires to run efficiently online to make sure steady business growth. That’s why Magento ecommerce solution comes into picture and start playing vital roll for small businesses and big business at international level to fulfill huge ambition.

Are you incisive for open source e-commerce phase that appear with enormous flexibility and hold for online merchants? Magento provides such resolution of it. These days, Magento is hot cake for e-commerce development and conventionally prominent stage because of its improved petition, renowned reliability, extra flexibility and minor cost. Magento program is continually organized and utilize compared with any other frameworks or expansion stage and extremely pleasing choice of clientele.

We at Stepin solutions can proficiently design and develop your e-commerce website to dynamic web. Our team of specialist developers has skill in acclimatize the Magento effort solutions to most outstanding suit your business requirements. Our Magento development team will clarify you in adapt and make the most of the competence of your e-commerce website. Our Core Magento Web Development Services will be inclusion of Development of Ecommerce Portals with assist of Magento, Add-Ons development, Integration with Third Party Software, Migration and up gradation, Customization of Core functionality and Multi-store development.

There are quite a few other open source ecommerce platforms available these days which includes osCommerce, Shopify, zenCart to name a few. But considering our ecommerce development experience and clients’ feedback, we feel Magento has came out as the flexible, scalable and easy to manage ecommerce solution platform compared to others and leading the ecommerce market with supporting majority of ecommerce websites.

Mobile App And Mobile Website: What your business actually needs?

$
0
0
There has been much ado about the issue of mobile apps vs. mobile websites. The usability of mobile apps has been opposed by the evidently bigger numbers of mobile website users. And just as usual, it depends on the project, its orientation and functionality, and of course, on the target user audience and budget. Here we would like to present some of the most interesting and valuable tips that you might find helpful. Somewhere apps win, somewhere websites do. But in general, you only have to walk through these facts to facilitate your choice.

Devices and platforms. Mobile apps are designed for peculiar types of devices, and fully corresponds to its capabilities. If you for some reason target the audience of iPad users, an app is a must. Mobile websites are better for delivering their content across various mobile platforms. They are freely and instantly accessible for devices. Mobile apps have to be downloaded and installed from an application store of a peculiar platform. A great win is that mobile apps are able to run offline, unlike websites. Apps are also more capable of bringing direct returns.

Content and features. Mobile websites can display text, audio and video content, as well as several other features, such as location-based mapping and click-to-call. That is why for simpler solutions, a mobile website is a better option. Mobile apps can incorporate a wider set of platform's native features, thus have much wider functional opportunities. Turn to them when a website is not enough. Apps deliver a user experience unmatched by websites. At least for now. The situation might change with emergence of new platforms and because of varieties of devices within one platform. Then adjusting apps for all of them may become a laborious task.

Updates and changes. It is much faster and easier to update the content on a website, rather than in an application. Changes in apps can be very limited; moreover, users have to download and install updates. Changes on a website become visible straight away. Websites are easier to find and to share links. In the future, web development tools will expand the functional filling of a mobile website, thus bringing in new prospects.

Think all these issues over to draw up the entire picture of what you really need. It is generally more considerable to build a website as the first step of establishing mobile presence among a wide audience. It is faster and cheaper. That's a great solution for the sphere of marketing and eCommerce. Meanwhile the complex software that requires native features, the software for regular and offline use, the interactive software such as games - all these are implemented best as mobile apps. Other things depend on the peculiarities of your project, which your software developers will gladly advise you on.

Open Source Technology for Better Web Projects

$
0
0
With the way the tech world is changing, more and more businesses are moving to open source development. Open source customization provides the ability to create innovative and creative applications that could suit the business needs of any organization. It involves tailoring open source CMSs or scripts like Joomla, WordPress, OsCommerce and Mambo to grace the website with superior looks and functionalities.

WordPress and Joomla are the most commonly used open source tools for web development. WordPress is most common software preferred by the bloggers across the world. The seamless user interface of the tool makes content writing, publishing and organizing very easy and quick. It can be used to make a full featured website with functionalities like E-commerce, forum and Job-portal.

Joomla is a web based software that allows creating impressive websites even without the knowledge of of HTML, CSS or PHP. Its admin interface gives more control over look and feel of content in different parts of the website. There are numerous other amazing open source software as well; all having their own special features and functionalities.

Various companies employ open source techniques to set up their websites or improve the already developed ones. In the web development world there are numerous open source products available for creating vibrant websites and other commercial web applications.
The use of these technologies helps cutting down the expenses in the development of the websites or applications, to a great extent. It is because these open source tools are available for free of cost.
Customizing the open source resources consumes lesser time as compared to writing code for the entire set of features in the application. Customization can be used in every aspect of web development right from mere templates to high end CMSs, CRMs etc. With a customized open source service, the users can eliminate the chances of problems like lack of good documentation, user training problems, lack of product support etc.

Furthermore with this approach, users get the freedom from vendors and they are also free to change software. Open source customization has a huge community to support it and help the new developers. The amateur developers can get help to solve their queries, debugging problems, technical solutions and for regular updates.

Furthermore, those who are looking for an economical system that might require changes or additional functionalities within a given budget, must seek for open source customization services. Because, if they choose to buy a commercial software, not only they will have to incur the initial cost of buying, but also more money will be wasted on adding extra features, getting technical support etc.
With several open source technologies available in the market, there are many options to choose for web applications development. For customized web app development, you need can amateur developers hire expert developers, who can build flexible, powerful and scalable websites and applications.

Exchange send mail c#

$
0
0
hello everyone i want you to help me to fine source code for exchange send mail by c# some one here help me b4 with this but he post link with project just i can send by smtp ssl please guys i want some project with exchange mail send by c#
https://www.emailarchitect.net/easendmail/ex/c/3.aspx
i use this project but i send send by exchange server

thank you all

Console App wont close

$
0
0
HI Guy's

Im having a problem with the below code within a console app, I am copying and pasting data across server locations, the copy works fine but it looks like the app wont close and I am left with the screen (Shown in attachment). I want to run this in part of a batch process but because the app stay open it wont move onto the next task. Any ideas why this is?

Thanks

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace SQL_Backup_Move_Files
{
    class Program
    {
        public class SimpleFileMove
        {
            static void Main(string[] args)
            {

                {
                    var DT = DateTime.Now;
                    var DT2 = DT.Day + "-" + DT.Month + "-" + DT.Year;

                    string SourcePath = @"Sourcepath";
                    string DestinationPath = @"DestPath " + DT2;
                    Directory.CreateDirectory(DestinationPath);

                    //Now Create all of the directories
                    foreach (string dirPath in Directory.GetDirectories(SourcePath, "*",
                    SearchOption.AllDirectories))
                        Directory.CreateDirectory(dirPath.Replace(SourcePath, DestinationPath));

                    //Copy all the files & Replaces any files with the same name
                    foreach (string newPath in Directory.GetFiles(SourcePath, "*.*",
                    SearchOption.AllDirectories))
                    File.Copy(newPath, newPath.Replace(SourcePath, DestinationPath), true);
                
                    
                }
                System.Environment.Exit(0);
            }


       }


   }

}



Java Build Path Problem

$
0
0
bonjour,

J'ai rencontré l'erreur suivante:
The container "Maven Dependencies" referencing non existing library 'C:\Users\dell\.m2\repository\com\oracle\ojdbc14\10.2.0.4.0\ojdbc14-10.2.0.4.0.jar'

Aidez-moi, svp, à trouver le fichier .jar correspondant!!merci

Exception in thread "main" java.lang.ClassNotFoundException: c

$
0
0

package javademo;

import java.io.DataInputStream;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class JavaDemo {

    /**
     * @param args the command line arguments
     * @throws java.io.IOException
     * @throws java.sql.SQLException
     * @throws java.lang.ClassNotFoundException
     */
    public static void main(String[] args)throws IOException, SQLException, ClassNotFoundException {
        // TODO code application logic here
    DataInputStream d=new DataInputStream(System.in); //for keyboard input
        System.out.println("Enter Employee ID:");
        int eid=Integer.parseInt(d.readLine());
        
         System.out.println("Enter Employee Name:");
        String ename=d.readLine();
        
         System.out.println("Enter Employee Salary:");
        double esalary=Double.parseDouble(d.readLine());
        
        Class.forName("com.mysql.jdbc.Driver");// 1> Loading Mysql driver
        // 2> Getting connection from Mysql server
        Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/isacDB","","");
        //3> prepared statement hasbeen usPreparedStatemented for query with placeholder
        PreparedStatement pst=con.prepareStatement("Insert into employee values(?,?,?)");
        //CallableStatement pst=con.CallableStatement("Insert into employee values(?,?,?)");
                pst.setInt(1,eid);
                pst.setString(2,ename);
                pst.setDouble(3,esalary);
                int rowcount=pst.executeUpdate();// 4> this method is used for insert/update/delete
                System.out.println(rowcount+"row has been inserted");
               
    
    }
    
}

Error 7 error LNK1120: 1 unresolved externals

$
0
0
hi

i'm new to c

i keep getting this error when i run the code

Error 7 error LNK1120: 1 unresolved externals C:\Users\toshiba\Desktop\programming\degrees\Debug\degrees.exe 1 1 degrees


i can send the code a PM

i have no other errors apart from this

thanks in advance
Viewing all 51036 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>