Click here to Skip to main content

aayu - Professional Profile

Summary

1,407
Authority
3
Debator
283
Editor
40
Enquirer
41
Organiser
640
Participant
0
Author
No Biography provided
Member since Monday, April 12, 2010 (3 years, 2 months)

Contributions

Articles 0
Tech Blogs 0
Messages 3 (Lurker)
Q&A Questions 50
Q&A Answers 64
Tips/Tricks 0
Comments 187

Links

Reputation

For more information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an Articlesilversilversilversilver
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.


 
You must Sign In to use this message board.
Search this forum  
GeneralOn the selection of the drop down and data should print in label Pin
Monday, November 15, 2010 7:38pm by Aarti2010
Hi
 
I am writing the Blog on this because i have face the problem on such question i have search in Google also but i could not find such answer which was related to my query.
 
Well the query i was face is i want to print the data on label by the selection from drop down list.
 
For Example : There is one table call Product and Second table called Discount there is no relationship between this two table then also i want on the selection of the product i should get a discount to be printed in label.
 
So the code for this type of query is :-
 
 private void combobox_SelectedIndexChanged(object sender, EventArgs e)
        {
            SqlConnection cnn1 = new SqlConnection(@"");
            cnn1.Open();
 
            DataSet da = new DataSet();
            SqlDataAdapter sda = new SqlDataAdapter("select * from table you want", cnn1);
            sda.Fill(da, "Tablename");
 
            //  for (i = 0; i < da.Tables["tablename"].Columns.Count; i++)
            int i = 0;
            for (i = 0; i <= da.Tables["tablename"].Columns.Count - 1; i++)
            {
                string strcolumn = da.Tables[0].Columns[i].ToString();
                string strvalue = da.Tables[0].Rows[0][i].ToString();
 
                
                if (combobox.SelectedItem.ToString() == "columnname")
                {
                    if (combobox.SelectedItem.ToString() == strcolumn)
                    {
                        label5.Text = strvalue;
                    }
 
                }
                else
                {
                    if (combobox.SelectedItem.ToString() == "columnname")
                    {
                        if (combobox.SelectedItem.ToString() == strcolumn)
                        {
                            label5.Text = strvalue;
                        }
                    }
 

 
Happy Coding Shucks | :-> Shucks | :-> Laugh | :laugh: Laugh | :laugh: Big Grin | :-D
 
GeneralLogin code for web application [modified] Pin
Friday, December 9, 2011 8:08pm by aayu
protected void btnlogin_Click(object sender, EventArgs e)
    {
        //sql connection
        SqlConnection cnn = new SqlConnection();
        cnn.ConnectionString = "Your connection";
        cnn.Open();
        SqlCommand cmd = new SqlCommand("select mobileno, password from register where mobileno='"+txtmoblie.Text +"'and password='"+txtpassword.Text+"'",cnn);
        cmd.Connection = cnn;
        SqlDataReader dr = cmd.ExecuteReader();
 
        if (dr.Read())
        {
            Response.Redirect("http://www.google.com");
        }
        else
        {
            Response.Write(@"<script language="'javascript'">alert('Invalid Username and Password')</script>");
            
        }
        cnn.Close();
       
 

    }
 
Happy coding Big Grin | :-D Big Grin | :-D

modified 12-Dec-11 23:50pm.

 
GeneralHow to Store the data from datagridview to sql server Pin
Tuesday, November 16, 2010 7:07pm by Aarti2010
Hi
 
This code is basically for storing the data from datagridview to sql server
 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
 
namespace MIC
 public Form1()
        {
	 InitializeComponent();
         }
 
public SqlConnection getsqlcon()
        {
            string connstring = "Server Name";
            SqlConnection con = new SqlConnection(connstring);
            return con;
        }      	
 
public bool getcomm(string connstring1)
        {
            try
            {
                SqlConnection sqlcon = this.getsqlcon();
                SqlCommand sqlcomm = new SqlCommand(connstring1,sqlcon);
                sqlcon.Open();
                sqlcomm.ExecuteNonQuery();
                sqlcomm.Dispose();
                sqlcon.Close();
                sqlcon.Dispose();
                return true;
 
            }
            catch(Exception ex)
            {
                return false;
            }
 
 private void btnsubmit_Click(object sender, EventArgs e)
        {
	try
            {
                string col1 = dataGridView1[0, dataGridView1.CurrentCell.RowIndex].Value.ToString();
                string col2 = dataGridView1[1, dataGridView1.CurrentCell.RowIndex].Value.ToString();
                string col3 = dataGridView1[2, dataGridView1.CurrentCell.RowIndex].Value.ToString();
                string col4 = dataGridView1[3, dataGridView1.CurrentCell.RowIndex].Value.ToString();
               // string col5 = comboBox1 4,comboBox1.SelectedItem.ToString();

                string insert_sql = "insert into clientwiseproductwise(col1,col2,col3,col4)values('" + col1 + "','" + col2 + "','" + col3 + "','" + col4 + "')",con;
 
                if (this.getcomm(insert_sql))
                {
                    MessageBox.Show("Insert Success");
                }
                else
                {
                    MessageBox.Show("Insert Failed");
                }
            }
            catch
            {
 
            }
 

 
Happy coding Smile | :) Smile | :) Shucks | :-> Shucks | :->

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web04 | 2.6.130619.1 | Last Updated 19 Jun 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid