Click here to Skip to main content
16,004,887 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello....i will create query using 2 form and single database in my smartdevice project. the first form for input data, and the second form for view data using datagrid. i am using vs 2008, c#, framework 2.0, windowsmobile 5.....what can i do????...can any body help me how i can do it????? i need a sample query and code
Posted
Comments
Sergey Alexandrovich Kryukov 6-Oct-12 0:54am    
As number of databases has nothing to do with number of forms; so it's not clear what's the problem and what kind of help do you need, exactly. "What can I do" is not a well-defined question, due to its ambiguity. You can easily face the answer "design and implement the solution you want", and it still be one of the possible kinds of answers.

To get some real help, you need to be more specific and ask some questions on something you have difficulties with.
--SA

1 solution

this is my code in form1:

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlServerCe;

namespace FirstSmartDeviceProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

/* Reset Button Code */
private void btnreset_Click(object sender, EventArgs e)
{
txtuname.Text = "";
txtpassword.Text = "";
}

private void btnlogin_Click(object sender, EventArgs e)
{
AppDatabase1DataSet ds = new AppDatabase1DataSet();
AppDatabase1DataSet.userDataTable dt = new AppDatabase1DataSet.userDataTable();

this.userTableAdapter1.Fill(dt);

foreach (DataRow dr in dt.Rows)
{
if (dr[1].ToString() == txtuname.Text && dr[2].ToString() == txtpassword.Text)
{
txtpassword.Text = "";
txtpassword.Text = dr[0].ToString();

MessageBox.Show("Login Valid!");
}
}
}

private void nextbtn_Click(object sender, EventArgs e)
{
Form Name = new Form2(); Name.Show();

}
}
}

and this is my code in form2:
C#
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FirstSmartDeviceProject
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            if (AppDatabase1DataSet2Util.DesignerUtil.IsRunTime())
            {
                // TODO: Delete this line of code to remove the default AutoFill for 'appDatabase1DataSet2.user'.
                this.userTableAdapter.Fill(this.appDatabase1DataSet2.user);
            }

        }

        private void backbtn_Click(object sender, EventArgs e)
        {
            Form Name = new Form1(); Name.Show();
        }
    }
}


i want to insert data textboxt in form1 to datagridview in form2, and save it. but if i deploy that code, textbox in form1 cannot insert in datagridview form2


....can any body help me....i am a beginner to development smartdevice
 
Share this answer
 
Comments
Sandeep Mewara 6-Oct-12 4:29am    
This is not an answer. Please use 'Have a Question or Comment' link to respond to an answer. It will notify answerer of your comment such that he can come back and reply. Or if needed, use Improve Question link to edit/update your question at anytime.
yani budiman 6-Oct-12 5:59am    
i am sorry if i am mistake to put that code...brother...the point is...are you can teach me...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900