|
Mangesh Tomar wrote: string filenname = "";
string path = "";
This is kind of useless, don't you think ?
If you can't set the text value of a textbox, and you can't work it out, then it's really time to be buying and reading a C# book. I can't think of much that's more trivial. What have you tried ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Whats there in this .. ..
Are you playing with us or what. . ???
Its just txtbx.Text = System.IO.Path.GetDirectoryName(FD.FileName);
|
|
|
|
|
Here is my code which gives me full path of file and it work
if (FD.ShowDialog() == DialogResult.OK)
{
textBox1.Text = " " + FD.FileName;
}
thx for reply
|
|
|
|
|
Thats cool. ..
But please from now leave a reply stating that you got your query so we didnt reply you in a way this happened...
|
|
|
|
|
Dear Friends
i developed more than from how to get the form1 to form2 how to value get .... ur suggestions
example i need help
|
|
|
|
|
Hard to understand what you're saying exactly. What is krishan ? your name ? How is that a remotely useful subject.
Buy a book on C# and read it. Pay attention to the chapter on delegates.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi all,
I am developing an excel automation addin in c# .net. I have its setup and msi too. Now, when i tried installing it on a test machine, the installation is all fine and i can also see the registry entry(of MyProject.Connect with LoadBehavior 3) being made in the hkey local machine. But, no registry entry is made in the hkey classes root!!! I am not able to find my GuidAttribute(EA0AA093-EB23-4BD5-B499-4A2D327FC4D9) in the 'hkey classes root\clsid'!!!
What could be the reason for this?! Kindly help me in this regard. Any suggestions and ideas are very much thankful.
Regards.
|
|
|
|
|
Because you've not registered your COM object ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hey Graus, good to see you replying.
Well, at last i figured out and it has made the registry entries in 'hkey classes root' on the test machine.. but apparently am very surprised with the fact that, though I am not able to see MySample.Connect in 'Excel--Tools--Addins', my addin is working to some extent.
Actually my addin is supposed to generate a button in excel, on the addin-created CommandBar(which i call MyCommandBar). The button is showing up and all the forms resulting its click are showing up. however, the UDFs i defined in 'MySample.Connect.cs' are not being recognised!!! Why is this happening?! How am I able to see the button when there is no entry of 'MySample.Connect' in the 'Excel--Tools--Addins' list!!??
I need my UDFs to be working.
Regards.
|
|
|
|
|
I want one regular expression which is like to be the values cannot start with "SA" or "K"(case insensitive).Please do the needful ASAP. which is urgent for me.Thanks in advance
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
ok, you've been around for a while and still you ask something ASAP and it's urgent, an automatic negative response generator.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
'do the needful' does not make sense. It also seems to serve as a warning around here that the poster is clueless.
yadlaprasad wrote: which is urgent for me
Not for me, as it happens. As you have an urgent problem, what have you done to solve it ? What tools do you use for Regex, there are some excellent free ones, some are even on CP.
You don't need a regex, you can just check the start of your string with a substring function if you want.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
yadlaprasad wrote: cannot start with "SA" or "K"
How cruell, you are discriminating the letters sa and k!!
|
|
|
|
|
Hi,
here is my code from openfile dialog box i directly open the excel file but i want the total file path which i want to fetch in the text box suggest some thing
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel|*.xls";
ofd.ShowDialog();
System.Diagnostics.Process.Start(ofd.FileName, "Fileselected");
|
|
|
|
|
Mangesh Tomar wrote: ofd.FileName
You already got it. Just assign this to textbox before you start the process.
|
|
|
|
|
try this:
<br />
if(ofd.ShowDialog() == DialogResult.OK)<br />
{<br />
textBox.text = "FileName: " + ofd.FileName;<br />
}<br />
|
|
|
|
|
Hi
here is my code i conver the excel file in to sql server 2005 i want to write a logc for excel data to cerate a pivot table for specific coloumbs
I want help regarding the SQL query
namespace WindowsApplication2
{ public partial class Form1 : Form
{
DataTable dtbl;
private SqlCommand scmd;
public Form1()
{
InitializeComponent();
scmd = new SqlCommand();
}
private void button1_Click(object sender, EventArgs e)
{
string filename = @"C:\abc.xls";
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);
dtaTable dataTable = dataSet.Tables[0];
dataGridView1.DataSource = dataSet.Tables[0];
MessageBox.Show(dataGridView1.RowCount.ToString());
connection.Close();
}
private void Form1_Load(object sender, EventArgs e)
{
string constr = "server=Myserver,database=mor,uid=;pwd=;";
SqlConnection sqcon = new SqlConnection(constr);
string cnd = "Select * from emp";
}
private void button2_Click(object sender, EventArgs e)
{
string constr="data source=Myserver;initial catalog=mo;integrated security=SSPI";
SqlConnection sqcon = new SqlConnection(constr);
sqcon.Open();
int i = 1;
while (i < (dataGridView1.Rows.Count)-2)
{
string istr = "insert into emp(name,std,des)values('" + Convert.ToString(dataGridView1.Rows[i].Cells[9].Value.ToString()) + "','" + Convert.ToString(dataGridView1.Rows[i].Cells[10].Value.ToString()) + "','" +Convert.ToString(dataGridView1.Rows[i].Cells[17].Value.ToString()) + "')";
scmd.CommandText = istr;
scmd.Connection = sqcon;
int r;
r = scmd.ExecuteNonQuery();
i++;
}
if (i > 1)
{
MessageBox.Show("Records saved");
}
}}}
|
|
|
|
|
what is the problem you are having, asking for unspecified help is not going to get you anything.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi,
i want to open only excel file using OpenFileDialog box need help.
here is my code which open any file from local drive.
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
openFileDialog1.ShowDialog();
System.Diagnostics.Process.Start(openFileDialog1.FileName, "Fileselected");
}
|
|
|
|
|
Apply filter to OpenFileDialog
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel|*.xls";
ofd.ShowDialog();
System.Diagnostics.Process.Start(ofd.FileName, "Fileselected");
|
|
|
|
|
is there any method to get entiered file string in text box from OpenFileDialog box
|
|
|
|
|
No, only the full path. You can use Path.GetFileName to get the filename without the path in front of it
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
How to config the strong name for wrapper assebmly key file in project properties
|
|
|
|
|
I am trying to use an OLE Automation Server object intended for VB6 in a c# project.
The documentation that comes say to do the following:
Dim PHD as Object
Set PHD = CreateObject("VisualPHD.Data")
I've added the object to my project as a reference and try to use
Type phd = Type.GetType("VisualPHD.Data");
This returns null. If I look in the Object Browser, I see that there is an interface called "PHDCtrl". Using that as the parameter to GetType, I still get null.
How do I determine the type I should be passing to GetType, or should I be doing something different altogether?
Once I get the type, I should be able to do something like:
PHDCTRLLib.PHDCtrl PHD = (PHDCTRLLib.PHDCtrl)Activator.CreateInstance(phd);
Here is a link to the info from Object Browser: http://i43.tinypic.com/2hpkv3s.jpg[^]
Any help on what I should pass to GetType?
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
First of all, I do not see VisualPHD.Data in the object browser. I am assuming that you want to create an instance of PHDCtrlLib.PHDCtrl. Try this:
PHDCtrl PHD = new PHDCtrlClass();
The PHDCtrlClass implements the PHDCtrl interface.
|
|
|
|