deolalkar_pooja

Greate....i did so simple mistake.
Actually I didnot understood the exception meaning. Now I got clear idea about it.

Thank you.

deolalkar_pooja Light Poster

Hello to all,
I have following simple Applet program.

 import java.applet.*;
    import java.awt.*;

    public class myapp1 extends Applet
    {
    Label l1, l2, l3, l4;
    TextField t1;
    TextArea t2;
    Checkbox c1,c2,c3,c4,c5,c6;
    CheckboxGroup cg;
    Button b;
    public void init()
    {
    l1=new Label("Enter your name: ", Label.RIGHT);
    t1=new TextField(20);
    l4= new Label("Enter your gender: ");
    cg=new CheckboxGroup();
    c5=new Checkbox("Male",cg,true);
    c6=new Checkbox("Female",cg,false);
    l2=new Label ("About Workshop: ");
    c1=new Checkbox("Timely Completion");
    c2=new Checkbox("Excellent Resourse Persons", true);
    c2.setEnabled(false);
    c3=c1=new Checkbox("Good Food");
    c1=new Checkbox("Excellent Hospitality");
    l3=new Label("Any other comment:");
    t2=new TextArea(10,20);
    b=new Button("OK");
    b.setForeground(Color.blue);
    add(l1);
    add(t1);
    add(l4);
    add(c5);
    add(c6);
    add(l2);
    add(c1);
    add(c2);
    add(c3);
    add(c4);
    add(l3);
    add(t2);
    add(b);
    }
    }

This program shows blank Applet with Labels, Button and CheckBoxes.
It shows follo. exception on Command Prompt.

java.lang.NullPointerException
        at java.awt.Container.addImpl(Container.java:1086)
        at java.awt.Container.add(Container.java:410)
        at myapp1.init(myapp1.java:39)
        at sun.applet.AppletPanel.run(AppletPanel.java:434)
        at java.lang.Thread.run(Thread.java:722)

Please help me to display proper output.

deolalkar_pooja

Thanks for reply....how to upgrade OS and ,net framework.

deolalkar_pooja Light Poster

Hi to all,
I want to install SQL SERVER 2008 on my XP 32-bit OS. After clicking on "New SQL Server stand-alone installation or add features to an existing " link unser installation tab, Setup Support Rules window shows success status of all rules except "Restart Computer". It neither directly retarting computer nor proceed after I retart computer manually. Again and again it is showing same error. What to do?

deolalkar_pooja

@Rik from RCE,
Thanks for suggestion.
I am having Windows XP Professional 2002.

@piers,
Thanks for suggestion. I tried 'msconfig' before this, it shows following startup program out of which, i am not understanding which are important? Please tell me that important program from following list.
1.hkcmd
2.EMAILSCN
3.ZVMOUNT
4.vport
5.TALLYLIC9XSERVER
6.ZVMOUNT
7.ctfmon
8.OneNote 2007.

deolalkar_pooja Light Poster

Hi to all,
I am having 1.75 GB of RAM on my 32-bit PC. The speed of computer is very slow for first 15-mins.
What should I do to increase speed.
Please suggest me, I am very new in this thing.

Thanks.

deolalkar_pooja

@adam_k.....
i am using dataGridView not dataset....i am beginer to all this thinks...i just want to display data from databse....will u please tell me step by step solution?

deolalkar_pooja

[QUOTE=adam_k;1731756]I guess you should put a breakpoint just before the objConnection.close() and start using messagebox or debug.print to verify the number of records in objDataSet.tables("student")
Once you know if you got any results then you'll know where to continue troubleshooting (the connection/db or your datagridview)

PS: Check the value of grdPublication.AutoGenerateColumns it should be true since you are not adding columns manually. If it's set to False then set it to True just before setting the datasource.[/QUOTE]

Yes....grdPublication.AutoGenerateColumns is set to true....but i am not understanding what is the actual problem?

deolalkar_pooja Light Poster

Hi....
I am trying to connect sql server with vb.net in Visual Studio 2008 with foll. code....
but it is having problem....what is the problem? Please tell me....

  1. I created "publication" databse. In table i took 2 columns...fname and lname and fill the records...
  2. I took DataGridView onto form and did foll. code....
    Imports System.Data
    Imports System.Data.SqlClient

Public Class Form1
Inherits System.Windows.Forms.Form
Dim objConnection As SqlConnection = New SqlConnection("server=(local);database=publication;integrated Security=SSPI;")
Dim objDataAdapter As New SqlDataAdapter()
Dim objDataSet As DataSet = New DataSet()

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    objDataAdapter.SelectCommand = New SqlCommand()
    objDataAdapter.SelectCommand.Connection = objConnection
    objDataAdapter.SelectCommand.CommandText = "select * from student"
    objDataAdapter.SelectCommand.CommandType = CommandType.Text
    objConnection.Open()
    objDataAdapter.Fill(objDataSet, "student")
    objConnection.Close()
    grdPublication.DataSource = objDataSet
    grdPublication.DataMember = "student"
    objDataAdapter = Nothing
    objConnection = Nothing

End Sub

End Class

But, it doesn't show any outpou....What to do?

Thanks & Regards,
Pooja.

deolalkar_pooja

@debasisdas, YAH......plz look it. i m very new to MS SQL. i studied it, but fail to solve queries

deolalkar_pooja

@debasisdas,
Hi, please read following info. about tables and then reply with your normalized tables.

In this database, each book may have one or more authors and each author may make different amount of money from that book. One book may make reference to other books. One book may be reviewed by different reviewers and get difference scores. An author could also be a reviewer and a publisher.

deolalkar_pooja

@debasisdas, Actually..........the basic tables are as follows...
BookAuthor(book, authors, earnings)
BookReference(book, referenceBook, times)
BookReview(Book, reviewer, score)
BookPublish(book, year, publisher, price, num)
.....................................................
These tables I normalized into that tables which i stated in the query. What should be the table normalization according to you?

deolalkar_pooja

actually, i have 4 tables which i normalised into above tables?

deolalkar_pooja Light Poster

hi to all, I created following table

create table book(id integer, author varchar(20))

In this, each book may have 1 or more authors.

My question is that, how can insert more value to author column like as follows.

id author
1 pooja merry james
2 robert stephen

Thanks & regerds,
Pooja

deolalkar_pooja Light Poster

I created the following tables and inserted few values.

create table books(bookid integer primary key, booktitle varchar(20), year integer, publisherid integer foreign key references publisher(publisherid), price integer, number integer)

create table publisher(publisherid integer primary key, publishername varchar(20)) create table author(authorid integer primary key, authorname varchar(20))

create table bookauthor(bookid integer foreign key references books(bookid), authorid integer references author(authorid), earnings integer )

create table bookreference(bookid integer foreign key references books(bookid), referencebook varchar(20), times integer)

create table reviewer(reviewerid integer primary key, reviewername varchar(20))

create table bookreview(bookid integer foreign key references books(bookid), reviewerid integer foreign key references reviewer(reviewerid), score integer)

Now, I want to solve following query in SQL Server 2000. Find all the books published in 2003 and reviewed by both ‘Sammer Tulpule’ and ‘Hemant Mahta’ . I am not getting any idea about query. How can I write it?

Thanks, Pooja

deolalkar_pooja Light Poster

Hi to all,
I created following table and its view.

[blue]create table employee(id integer, name varchar(20), age integer)

create view Vemployee as select id, name from employee.[/blue]

now I want to rename a view, so I wrote a query like

[blue]rename view Vemployee to Pemployee[/blue]

But, it shows error about 'raname' keyword.

what to do for renaming a view?

Thanks & regards,
Pooja.

deolalkar_pooja

create table publisher(name varchar(20), city varchar(20) check(city in('mumbai', 'pune', 'nasik', 'panji')))

deolalkar_pooja Light Poster

Hi to all, I create the following table.

create table man(id integer, name varchar(20), city varchar(20), age integer)
I want the age, maximum age of person. So, I ran following query,

select name, max(age) from man group by name;
It shows name of all person in ascending order with their age. What is going wrong?

Thanks & regards,
Pooja.

deolalkar_pooja Light Poster

Hi to all,
I have nothing idea about how to create relation and solve their queries. I want to relation as follows:

BookAuthor(book, author, earnings)
BookReference(book, referenceBook, times)
BookReview(book, reviewer, score)
BookPublih(book, year, publisher, price, numbar)

In these database, each book may have 1 or more authors & each author may make a diff. amt. of money from that book. One book may make reference to other book.1 book may be reviewed by diff. reviewers and get diff. scores. an author could also be a reviewer & a publisher.

I want to solve following queries

  1. find all books published in 2003 & reviewed by both Sammer Tulpule & Hemant Mehta.
    2.Find all the reviewers who never reviewed their own books.
    3.find all authors who reviewed more than 2 books written by Sita Mitra.
    4.Find all authors who have written exactly 1 book and reviewed more than 1 book.
    5.Find all the reviewer who reviewed every book from 'Stephen King'.
    6.find all books published in 1995-2000 in descending order.

I know, these is not good to find an answer, but believe me i really don't understand hoe to make table with relation & solve above queries.

Thanks & regards,
Pooja.

deolalkar_pooja Light Poster

Hi to all,
I created the following two table
create table mail(mid integer primary key, name varchar(20) )
create table phone( pid integer foreign key references mail(email), phone integer)
After inserting records on both table, now i want delete perticular record from table say 'delete record of pid=12'. that means, i have to delete record of pid=12 from oth table. so, i ran following query.
delete from mail, phone on mail.mid=phone.pid where pid=12

but i got the error like 'check the syntax near from', what to do then to get the proper output.

Thanks & regards,
Pooja.

deolalkar_pooja Light Poster

Hi to all,
I created following table

create table interiors(id integer, name varchar(20), type varchar(20) default 'baby cot', price integer)

but, when i doesn't inserted any value of 'type', by the definition of table, it should take default value. when i fetch all rows by 'select' query, it doesn't show default value.

can anyone tell me that what is the problem?

Thanks & regards,
Pooja.

deolalkar_pooja Light Poster

Hi to all,
i created following table
create table employee(name varchar(20), dob datetime)
I want to extract names of all months from 'dob'. for that i wrote following query
select datepart(month, dob) from employee

it works and shows all months but in number format,
i want to display all months in character format. i.e. january, february, march, ...
How can I do it?

Thanks & regards,
Pooja.

deolalkar_pooja Light Poster

Hi to all,
I created the following table

create table publisher(name varchar(20), city varchar(20))

I want to put following constraint, 'name is having unique with city taken only from 'mumbai', 'pune', 'nasik', 'panji''. I know about unique constraints with name. I searched many about constraint with city, but i don't get it till now. Will you please help me about constraint. I used 'BETWEEN' constraint, but it failed. What should I do?

deolalkar_pooja Light Poster

Hi to all,
I created following table

create table Interiors(no integer, name varchar, type varchar, dateofstock datetime, price decimal(6,3), discount numeric(6,2))

i want to solve these two queries.

  1. Display the type, sum of price and average of discount by grouping type as 'baby cot'.
  2. Display the type, maximum and minimum of price by grouping type as 'baby cot'.
    I wrote following stmt.s for each resp.
  1. select type, sum(price), avg(discount) from Interiors group by 'baby cot'.
  2. select type, max(price), min(price) from Interiors group by 'baby cot'.

I got following error same for both like that 'type is not an aggregate fun. or it dont have GROUP BY' clause. What should I do for solving that queries.

Thanks & regards,
Pooja.

deolalkar_pooja

I know, this is mysql forum. I wrongly put this question in this forum. but i want the output in 'MS SQL Server'.

Thanks & regerds,
Pooja.

deolalkar_pooja

i means, sql server doent't support 'enum' type.

deolalkar_pooja

hi smantscheff, i will work on ur suggestion abt 1st query.

I tried the same also abt 2nd query, but it shows same error. can u give different solution?

Thanks & regards.
Pooja.

deolalkar_pooja Light Poster

Hi to all,
I created following table
crate table publisher(name varchar(20), city varchar(20))

I want to run following query.
[U]'list all the positions of charcter 'a' from name.'[/U]

for this, i ran following query,

select patindex('%a%', name)
from publisher;

But, it doesn't show proper output. When i put 'city' column instead of 'name' column, it shows right output. What is the problem?

=======================================

Also, I want to dispaly the name of publishers whose getting minimum and maximum profit. for this, i ran following query,

select name, max(profit), min(profit) from publisher;

It shows the error like that "'name' is not part of aggregate function". what should i do for retrieving name of publishers who getting minimum and maximum profit.

Thanks & regards,
Pooja.

deolalkar_pooja Light Poster

Hi to all,
i created following table
create table employee(name varchar(20), dob datetime)
I want to extract names of all months from 'dob'. for that i wrote following query
select datepart(month, dob)

it works and shows all months but in number format,
i want to display all months in character format. i.e. january, february, march, ...
How can I do it?

Thanks & regards,
Pooja.

deolalkar_pooja

hi......smantscheff.
i tried on ur solution, but it doesn't work. Plz, help me in different way.