|
Dear your code is not working i am trying it but there is problem.
let me explain it again i want to display text file and pdf file on the button click.
i need this only.
|
|
|
|
|
Hi dear,
Pls remember to add
using System.Diagnostics;
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
I have done this, but its path which i given in code is in C drive but if i want to add file in solution explore then is their any different technique for displaying ms word file or pdf file.
|
|
|
|
|
Hi,
I would like to write AddIn for Office 2003 but I want to know the pros and cons while developing the same using VC++ .Net. Which approach is better for development.
Thanks
SNI
|
|
|
|
|
This is not a VC++.Net Forum or even not related to MS Office
Choose right forum to get answer to you queries
|
|
|
|
|
I think i put the question wrong way. I would like to ask what are the advantages of writing COM AddIn using C# over VC++.
Thanks
SNI
|
|
|
|
|
|
IMO you can write in any of the language since both will be equally powerful. Since you will be having same framework to support your code, it does not really matter which language you use.
Check this[^] link. Might help.
जय हिंद
|
|
|
|
|
Hey all...
I came across a very basic problem ....
Suppose I made a simple Notepad like editor...
Now I want that whenever I double click on any presice extension file . .. i.e. .jpg or anything...
It should open my application and the file should be opened ....
It is somewhat like opening a word document by double clicking the .doc file ...
This is exactly what I want in my application...
Thanx in advance techies...
|
|
|
|
|
|
But after registering also..
Suppose it opened the application.. But how to load that file because of which it is opened...
Did you understand the problem ..
|
|
|
|
|
If I'm not mistaken windows will automatically add the path of the file as an argument...
|
|
|
|
|
you have to associate your application with that file type. 2 ways to do that
1. Just right click on any file of that type > open with > Choose Default Program > and browse your app and check 'Always use this pro....'
2. You can directly edit registry, read this article[^]
plus when you done, you have catch the arguments that will give you that file path you open by double click.
you can get through Main(string[] args) or Environment.CommandLineArgs
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I think this might surely work . ..
This was the thing that I want. .
Thanks dude. .
|
|
|
|
|
jaypatel512 wrote: I think this might surely work .
Think, might and surely.
जय हिंद
|
|
|
|
|
It worked dude. ..
Thanks a lot all of you . ..
I really appreciated man . .
|
|
|
|
|
Hi All
Look at the code
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;
namespace DealingWithImages
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.label1 = new System.Windows.Forms.Label();
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(53, 52);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(211, 13);
this.label1.TabIndex = 2;
this.label1.Text = "This is windows forms do you like it?";
this.Controls.Add(label1);
Image myimage = Image.FromFile(@"Give path of the image");
this.BackgroundImage = myimage;
this.MaximumSize = new System.Drawing.Size(400, 400);
this.MinimumSize = new System.Drawing.Size(400, 400);
}
protected override void OnMove(EventArgs e)
{
base.OnMove(e);
this.Refresh();
this.Invalidate();
}
protected override void OnPaintBackground(PaintEventArgs e)
{
if (this.BackgroundImage != null)
{
e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
e.Graphics.DrawImage(this.BackgroundImage, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height);
}
else
{
base.OnPaintBackground(e);
}
}
}
}
I have to put image on the background of my windows form which I am doing using the code above.
I have some controls which I am generating at runtime.
Now the challenge is the background color of the control(here label1) looks odd on the form.
Does anybody know How to solve it?
Thanks
Regards
THE SK
|
|
|
|
|
label1.BackColor = Color.Transparent;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
thousands line question
One line answer
Thanks
|
|
|
|
|
Hi,
I am building a ASP.NET page using c#.
I need a code to add a javascript function to disable a button on a text change event.
The below is the code i wrote
The script code in tags:
function SetButtonStatus()
{
document.getElementById("Button2").disabled = true;
}
other codes here
this is the textbox tag:
<asp:textbox id="txtName" runat="server" onchange="SetButtonStatus()" xmlns:asp="#unknown">
It doesn't seem to work. Please help me on this one. I tried this in ASP.Net forums there were no replies
|
|
|
|
|
I would suggest just doing it in your code behind. This is a bit of c# code that works.
On the aspx page :
<asp:textbox id="TextBox1" ontextchanged="TextBox1_TextChanged" autopostback="true" runat="server" xmlns:asp="#unknown">
<asp:button id="Button1" runat="server" text="Button" xmlns:asp="#unknown">
in the code behind
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Button1.Enabled = false;
}
Now take note to the field AutoPostBack="true" this will update the button automatically after you click out of the textbox itself, which will cause the page to update. If you want to manually update the page you can just remove that line.
Hope that helps
|
|
|
|
|
This is not a ASP.Net forum
Put your queries related to ASP.Net in ASP.Net Forum
|
|
|
|
|
hi
This is my code in which i upload a excel file using file dialog box and store it in to the sql server as table name emp but problem is that when i run the program secound time all the values again store in same table
so my question is that is possible to create a table at run time in bata base NEED HELP or any logic regaring that.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace openfi
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog FD = new OpenFileDialog();
FD.Filter = "Excel|*.xls";
if (FD.ShowDialog() == DialogResult.OK)
{
textBox1.Text = " " + FD.FileName;
}
string filename = textBox1.Text;
String connectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
OleDbCommand selectCommand = new OleDbCommand("SELECT * FROM [sheet1$]", connection);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
dataAdapter.SelectCommand = selectCommand;
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
System.Data.DataTable dataTable = dataSet.Tables[0];
dataGridView1.DataSource = dataSet.Tables[0];
// textBox1.Text = "";
MessageBox.Show(dataGridView1.RowCount.ToString());
connection.Close();
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog FD = new OpenFileDialog();
FD.Filter = "Excel|*.xls";
if (FD.ShowDialog() == DialogResult.OK)
{
textBox2.Text = " " + FD.FileName;
}
string filename = textBox2.Text;
String connectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
OleDbCommand selectCommand = new OleDbCommand("SELECT * FROM [sheet1$]", connection);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
dataAdapter.SelectCommand = selectCommand;
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
System.Data.DataTable dataTable = dataSet.Tables[0];
dataGridView2.DataSource = dataSet.Tables[0];
// textBox1.Text = "";
MessageBox.Show(dataGridView2.RowCount.ToString());
connection.Close();
}
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
private void button4_Click(object sender, EventArgs e)
{
string constr="data source=MYSERVER;initial catalog=mo;integrated security=SSPI";
// string constr = "Datasource=Myserver;Initialcatlog=mo;Integrated security=SSPI";
SqlConnection sqcon = new SqlConnection(constr);
SqlCommand scmd = new SqlCommand();
sqcon.Open();
int i = 1;
while (i < (dataGridView1.Rows.Count)-2)
{
string istr = "insert into emp(Personnel_Area,EE_Grp,Employee_Group,ES_Grp)values('" + Convert.ToString(dataGridView1.Rows[i].Cells[0].Value.ToString()) + "','" + Convert.ToString(dataGridView1.Rows[i].Cells[1].Value.ToString()) + "','" + Convert.ToString(dataGridView1.Rows[i].Cells[2].Value.ToString()) + "','" + Convert.ToString(dataGridView1.Rows[i].Cells[3].Value.ToString()) + "')";
MessageBox.Show(istr);
scmd.CommandText = istr;
scmd.Connection = sqcon;
int r;
r = scmd.ExecuteNonQuery();
if (r > 0)
// MessageBox.Show("Record Saved");
i++;
}
if (i > 1)
{
MessageBox.Show("Records saved");
}
}
}
}
|
|
|
|
|
Before doing your insert you should check first to see if the table exists, at which point you can specify another name for the table. I would dynamically set the table name in your code as a variable, and do a count on how many tables with that name already exist, and then create a new table based on that name and the count. This link may help you with the code on checking first to see if the table exists.
http://dotnetmonk.blogspot.com/2007/07/check-if-table-already-exists-in-sql.html[^]
hope this helps.
|
|
|
|
|
Something about this question just seems wrong to me. There should be one table in your database that contains all your "Customers" for example. Seems like a bad design to have "Customer_1_Jan_2009", and "Customers_2_Jan_2009", will you really want to query 'x' Customer tables for given date range as in the example provided?
Alternatively, if you have for example a Customer table in your database, and each customer might need some additional data for each individual customer, i would highly suggest storeing the additional information within an xml column if possible.
Or better yet figure out exactly what data you need to store, track, and maintain. You might have some specialized need to store data in this manor, but i simply can't think if a reason for it, seems like a bad design, and if you need to store daily inform for a given customer, then the date value should simply become a value withing the record.
|
|
|
|