TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kam
NA
9
3.9k
call the main fuction
Dec 12 2012 7:36 PM
Hi;
I want to call the Main function of class Program, and pass a sql string to the Main fuction,
from the function of btn1Search_Click of the class Form1, when i click a button on the main form.
i am writing a project for database, and all the data put into the dataGridView. and i want the window displays another data when i click a button.
Could anyone tell me how to do that, please.
///////////////////////////////
static class Program
{
public static string sql;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length < 1)
sql = "select buyerName, id, category, productName, price, date, referenceNo from elena ";
else
sql = args[0];
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(sql));
}
}
/////////////////////////////
public partial class Form1 : Form
{
........
private void btn1Search_Click(object sender, EventArgs e)
{
}
...........
}
Reply
Answers (
8
)
I need to insert spaces to string....
Adding a new row to a databound dataGridView control