3
Answers

What does the Orientation property do in a Menu control?

Tapan Mallick

Tapan Mallick

7y
197
1
What does the Orientation property do in a Menu control?
Answers (3)
0
Raja T

Raja T

NA 7.4k 6k 9y

Attachment xamp.zip

Hi,
 
I have design form simple. In that 3 text box and one button.
 
db script
 
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_demo](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NULL,
[City] [varchar](50) NULL,
[Salary] [money] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
 
 Code Behide
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Data;
using System.Data.SqlClient;
namespace WpfApplication_Demo
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
try
{
if (txt1.Text == "")
{
MessageBox.Show("please enter name");
txt1.Focus();
return;
}
else if (txt2.Text == "")
{
MessageBox.Show("please city name");
txt2.Focus();
return;
}
else if (txt3.Text == "")
{
MessageBox.Show("please money name");
txt3.Focus();
return;
}
else
{
string constr = "Data Source=localhost;Initial Catalog=TestDemo;User Id=sa;Password=passwd@123;";
string query = "";
query = "insert into tbl_demo values('" + txt1.Text + "','" + txt2.Text + "','" + txt3.Text + "')";
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Inserted Successfully");
txt1.Text = "";
txt2.Text = "";
txt3.Text = "";
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
 
Please find the attached screen shots my design with output also.