|
data is present in all cells. i think problem in the column data type
|
|
|
|
|
How do u read the data from cells?
Does the app always read first cell?
|
|
|
|
|
Hi All,
Please let me know how to invoke a method of an application in Windows service using Process Class of System.Diagnostics. I don't want to make use of Reflection.
// Get all instances of Application running on the local
Process[] localName = Process.GetProcessesByName("Application_Name");
foreach (Process proc in localName)
{
Console.WriteLine(proc.ToString());
Console.WriteLine(proc.Id);
Console.WriteLine(proc.GetType());
}
Using the above instance I have to call the method of the application.
Noor hussain
|
|
|
|
|
Then you need to load the assembly using the methods in the System.Reflection namespace, not get a set of processes in the system.
|
|
|
|
|
oConn.Open = "Provider=DB2OLEDB;" & _
"Network Transport Library=TCPIP;" & _
"Network Address=xxx.xxx.xxx.xxx;" & _
"Initial Catalog=MyCatalog;" & _
"Package Collection=MyPackageCollection;" & _
"Default Schema=MySchema;" & _
"User ID=MyUsername;" & _
"Password=MyPassword"
this is the connection string i got from a site. How will apply it in my program:
OleDbConnection connect=new OleDbConnection();
connect.ConnectionString="Provider=DB2OLEDB; initial catalog=SAMPLE;integrated security=SSPI,default schema=jefoy";
connect.Open();
OleDbCommand cmd_save =new OleDbCommand("INSERT INTO test(name,year,course)"+"VALUES("+"'"+textBox1.Text+"'"+","+"'"+textBox2.Text+"'"+","+"'"+textBox3.Text+"'"+")",connect);
cmd_save.ExecuteNonQuery();
connect.Close();
will i place it as it is or will i change the schemas and the other items? its not working. Maybe somethings wrong. Thanks...
|
|
|
|
|
Hi,
No need to write Default Schema.
Eithr u use Upper haft part or lower half part. Give User id and Password in lower part of connection string. Then Take a Integer vriable as
int intRow=cmd_save.ExecuteNonQuery();
if(intRow>0)
{
"Record Updated"
}
Note: ExecuteNonQuery returns number of rows affected.
Binod K.
|
|
|
|
|
OleDbConnection connect=new OleDbConnection();
connect.ConnectionString="Provider=DB2OLEDB; initial catalog=SAMPLE;integrated security=SSPI,user id=db2admin;password=eugene09";
connect.Open();
OleDbCommand cmd_save =new OleDbCommand("INSERT INTO test(name,year,course)"+"VALUES("+"'"+textBox1.Text+"'"+","+"'"+textBox2.Text+"'"+","+"'"+textBox3.Text+"'"+")",connect);
int intRow=cmd_save.ExecuteNonQuery();
if(intRow>0)
{
MessageBox.Show("Record added");
}
connect.Close();
this is a program i created adding a record in the database but their is no error but an exception, saying " DB2OLEDB is not existing in the local machine."
i think the problem is in the insert command. thanks for all the help!
|
|
|
|
|
On closing a .Net 2.0 windows application exe i get the following error.
The instruction at "0x7c9118d0" referenced memory at "0x00000000". The memory could not be "written".
While closing the application , i start another process using System.Diagnostics.Process class.
What can be the reason for this error?
Also this is not a consistent behavior.
Thanks.
|
|
|
|
|
Are you using any third party components? Or a taskbar/tasktray type component?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Implement the following and it will show the exception that is occurring:
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
// Connect to the unhandled exception event
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new TestApp());
// Disconnect from the unhandled exception event
AppDomain.CurrentDomain.UnhandledException -= new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
// Show the exception to the user. This could be written
// to a file, but since this is just a test app...
MessageBox.Show(e.ExceptionObject.ToString());
if (!e.IsTerminating)
Application.Exit();
}
Phil
|
|
|
|
|
Hi,
I'm currently working with user controls under VS2005.
VS2005 does provide a handy tool called "UserControl TestContainer" for every user controls in my project.
However, I need to configure one of my user controls in the project to be the first one to display.
The problem here is that I'm using a third party control and it doesn't render correctly if its parent form is not the first one to be rendered. So I need a way to set the form as a startup user control.
Is there any way to do that?
Thank you very much.
KiT
Never wait for a chance to come, Believe in your own potential and go get it!
|
|
|
|
|
None that I know of, I'm afraid.
|
|
|
|
|
Good day,
I have a user control. My user control is customize Panel which can be minimize or maximize. I use Transparent as background of my control.
I tried to test my new control under a form that has a background picture. When I run my test program, i've tried to minimize my user control Panel but the area that was left behind by my panel is NOT the background image picture of the form where i put my user control instead the trasparent color appear.
Is there a way that we could get the background of the Area what was overlapped by my user control ? How can I make my user control aware of the background area that it overlapped at design time so that I could restore that area when my control is minimize?
Any suggestions would be appreciated.
Thanks,
|
|
|
|
|
The simplest thing to do is to invalidate or refresh the form when the customize Panel is minimized/maximized. You can let the customize Panel trigger a minimized/maximized event back to the parent control or just use the 'this.Parent.Refresh()' but that's not a very neet way of handling the problem.
Another way of solving the problem is to calculate the area that should be invalidated and then repaint only that small area.
I hope that might give you some idé to solve the problem. 
|
|
|
|
|
Hi SNews
Thanks for your feedback, however, I already tried to add a handler to my panel. so that in the forms code :
mypanel.SetParentControl(myparentcontrolorparentform);
and on my panel code:
private Control m_parentcontrol=null;
public void SetParentControl(Control e) { m_parentcontrol=e; }
[Browsable(true)]
[TypeConverter(typeof(boolValueConverter))]
[DisplayName("Collapse"), Category("Panel Information"), Description("Minimize/Maximize Panel")]
public bool Collapse
{
get { return m_isminimized; }
set {
m_isminimized = value;
if(m_parent!=null) m_parentcontrol.Refresh();
Refresh();
}
}
However the when my panel is minimized, the area that was left behind displays the transparent color. If its okay with you, can i ask for your email address so that I could email you the output sample of my program.
Perhaps I'll to follow your second suggestion, however how can my user control aware or get the area only that it has overlapped?
Thanks
|
|
|
|
|
Yes, send me an email through the message board and I will reply to that so you get my email adress.
|
|
|
|
|
please.. i need a sample... or please check if somethings wrong in this program..its not saving..and i think the connection string is not valid but it doesnt build any errors until you save in the database.
OleDbConnection connect=new OleDbConnection();
connect.ConnectionString="PROVIDER=DB2OLEDB; initial catalog=SAMPLE;integrated security=SSPI";
connect.Open();
OleDbCommand cmd_save =new OleDbCommand("INSERT INTO test(name,year,course)"+"VALUES("+"'"+textBox1.Text+"'"+","+"'"+textBox2.Text+"'"+","+"'"+textBox3.Text+"'"+")",connect);
cmd_save.ExecuteNonQuery();
connect.Close();
thanks for the help..
|
|
|
|
|
Check this to get some help with the connection string.
http://www.carlprothman.net/Default.aspx?tabid=86#OLEDBManagedProvider
But it sure seems odd that the error isn't raised when the Open() method is called. Must be the INSERT statement that's wrong. I don't know for sure if it's ok to write the ending ) of the data declaration without any space before VALUES( ... ) declaration.
I can also recommend you to start using SqlParameter to get a safer and smoother SQL handling.
Take a look here for a quick example:
http://www.samspublishing.com/articles/article.asp?p=27640&seqNum=6&rl=1
Hope it helps some
|
|
|
|
|
thanks.. its now running. But the problem is that i cant save data on the database. The exception is that the provider=DB2OLEDB is not available in the local machine.
it highlights the statement where i insert values. thanks.
|
|
|
|
|
and also the site that you give is not valid..
thanks..
|
|
|
|
|
I try to use
this.Text = "\u149d";
But I get strange character.
Thank You.
|
|
|
|
|
I am using the following code to draw an image. I want it to add to my page, the current code erases my page and only shows the image.
Bitmap draw = new Bitmap(500, 20);<br />
Graphics g = Graphics.FromImage(draw);<br />
<br />
g.DrawImageUnscaled(topleft, 0, 0);<br />
<br />
for (int i = 13; i <= intTableWidth; i++)<br />
{<br />
g.DrawImageUnscaled(contop, i, 3);<br />
}<br />
<br />
draw.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Add a panel at design time and @ the position where you want to display the graphic.
and add creating this graphic, add this to the panel
Nana
|
|
|
|
|
How do I draw on a panel?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Dont draw on panel.
Whenever ur object g is ready,
just say pnlGraph.Add(g);
Nana
|
|
|
|