|
|
I'm totally confused. How do you know you have an error if you don't know what it is?
You post code and say it has an error? How do you not know what the error is? Surely the error manifests itself in some way? What is the manifestation of that error? And what should happen if the error was fixed?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Could it be that this is a kind of homework or test question?
"Name all the errors/problems in this piece of code"
Just a thought...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Never thought of that. You could be right.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
How do I write a code in C# with following functionality:-
The program will search and pick a code from a repository.
Then it will deploy the code to some other machine.
It will also maintain a log of transaction.
varun
|
|
|
|
|
|
vkg_dce wrote: The program will search and pick a code from a repository
Define "repository" in the current context.
Define "code" in the current context.
vkg_dce wrote: Then it will deploy the code to some other machine
Define "deploy" in the current context.
vkg_dce wrote: It will also maintain a log of transaction.
Define "log" in the current context.
Define "transaction" in the current context.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
vkg_dce wrote: How do I write a code in C# with following functionality:-
The program will search and pick a code from a repository.
Then it will deploy the code to some other machine.
It will also maintain a log of transaction.
Using the keyboard.
(If you want a more specific reply, you have to ask a more specific question.)
---
single minded; short sighted; long gone;
|
|
|
|
|
Situation is like this:
There are too many code versions in our local repository, I need to make a program to pick up the required code for the application and deploy it on another machine outside our local network.
We have 3 applications to be run and it depends on user/client to choose which application version has to be run.
There are 5 versions for each of the 3 applications.
Can there be some build program written for it.....to pick a code version from a machine with IP address xxxxxxxxxxxxspecified by user/client and deploy it on another system with IP address yyyyyyyyy.
|
|
|
|
|
Situation is like this:
There are too many code versions in our local repository, I need to make a program to pick up the required code for the application and deploy it on another machine outside our local network.
We have 3 applications to be run and it depends on user/client to choose which application version has to be run.
There are 5 versions for each of the 3 applications.
Can there be some build program written for it.....to pick a code version from a machine with IP address xxxxxxxxxxxxspecified by user/client and deploy it on another system with IP address yyyyyyyyy.
A log has to be generated stating which code was picked and deployed...
|
|
|
|
|
Salut,
J'ai crée un panel transparent qui marche plutôt bien en ce qui concerne la transparence; mais le problème est quand je fais bouger l'ascenseur, les parties du panel qui apparaissent sont floues et ont de sérieux problèmes d'encre et je ne sais plus quoi faire (faut dire que je débute en gdi).
voici ma classe de base:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
namespace TransparentControlsLibrary
{
public class TransparentPanel : System.Windows.Forms.Panel
{
#region P/Invoke
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
private static extern int GetWindowLong(HandleRef hWnd, int nIndex);
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
private static extern IntPtr SetWindowLong(HandleRef hWnd, int nIndex, int dwNewLong);
private const int WS_EX_TRANSPARENT = 0x00000020;
private const int GWL_EXSTYLE = -20;
#endregion
private bool isPainting = false;
private bool isResizing = false;
private Brush backBrush;
private Bitmap tempBitmap;
private Graphics tempGraphics;
public TransparentPanel() : base()
{
this.SetStyle(ControlStyles.UserPaint, true);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
}
protected override void OnMove(EventArgs e)
{
//this.Invalidate();
base.OnMove(e);
}
protected override void OnResize(EventArgs e)
{
isResizing = true;
base.OnResize(e);
}
protected override void OnSizeChanged(EventArgs e)
{
isResizing = true;
base.OnSizeChanged(e);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
backBrush.Dispose();
tempBitmap.Dispose();
tempGraphics.Dispose();
}
base.Dispose (disposing);
}
protected override void OnBackColorChanged(EventArgs e)
{
this.Invalidate();
}
protected override void OnInvalidated(InvalidateEventArgs e)
{
if (!isResizing && !DesignMode)
{
// HACK: Permet de supprimer d'initialiser le fond du panel à Transparent.
this.SuspendLayout();
this.Width--;
this.Width++;
this.ResumeLayout();
}
base.OnInvalidated (e);
}
protected override void OnPaint(PaintEventArgs e)
{
if (!isPainting)
{
isPainting = true;
backBrush = new SolidBrush(Color.FromArgb(this.OpacityAsByte, base.BackColor));
tempBitmap = new Bitmap(this.Width, this.Height);
tempGraphics = Graphics.FromImage(tempBitmap);
tempGraphics.FillRectangle(backBrush, 0,0,this.Width, this.Height);
e.Graphics.DrawImage(tempBitmap, e.ClipRectangle);
isPainting = false;
isResizing = false;
}
}
// Transforme la valeur d'opacité du masque en byte
private byte OpacityAsByte {
get {return (byte)(this.opacity * 255);}
}
private double opacity = 1;
public double Opacity {
get {return opacity;}
set {
if (value > 1)
value = 1;
else if (value < 0)
value = 0;
opacity = value;
this.Invalidate();
}
}
// Précise que le controle doit être transparent
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= WS_EX_TRANSPARENT;
return cp;
}
}
}
}
|
|
|
|
|
Hello, I have create a transparent panel which goes rather well with regard to the transparency; but the problem is when I make move the elevator, the parts of the panel which appear are fuzzy and have serious problems of ink and I dont know what to do (is necessary to say I'm a beginner in gdi). here my basic class:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
namespace TransparentControlsLibrary
{
public class TransparentPanel : System.Windows.Forms.Panel
{
#region P/Invoke
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
private static extern int GetWindowLong(HandleRef hWnd, int nIndex);
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
private static extern IntPtr SetWindowLong(HandleRef hWnd, int nIndex, int dwNewLong);
private const int WS_EX_TRANSPARENT = 0x00000020;
private const int GWL_EXSTYLE = -20;
#endregion
private bool isPainting = false;
private bool isResizing = false;
private Brush backBrush;
private Bitmap tempBitmap;
private Graphics tempGraphics;
public TransparentPanel() : base()
{
this.SetStyle(ControlStyles.UserPaint, true);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
}
protected override void OnMove(EventArgs e)
{
//this.Invalidate();
base.OnMove(e);
}
protected override void OnResize(EventArgs e)
{
isResizing = true;
base.OnResize(e);
}
protected override void OnSizeChanged(EventArgs e)
{
isResizing = true;
base.OnSizeChanged(e);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
backBrush.Dispose();
tempBitmap.Dispose();
tempGraphics.Dispose();
}
base.Dispose (disposing);
}
protected override void OnBackColorChanged(EventArgs e)
{
this.Invalidate();
}
protected override void OnInvalidated(InvalidateEventArgs e)
{
if (!isResizing && !DesignMode)
{
// HACK: Permet de supprimer d'initialiser le fond du panel à Transparent.
this.SuspendLayout();
this.Width--;
this.Width++;
this.ResumeLayout();
}
base.OnInvalidated (e);
}
protected override void OnPaint(PaintEventArgs e)
{
if (!isPainting)
{
isPainting = true;
backBrush = new SolidBrush(Color.FromArgb(this.OpacityAsByte, base.BackColor));
tempBitmap = new Bitmap(this.Width, this.Height);
tempGraphics = Graphics.FromImage(tempBitmap);
tempGraphics.FillRectangle(backBrush, 0,0,this.Width, this.Height);
e.Graphics.DrawImage(tempBitmap, e.ClipRectangle);
isPainting = false;
isResizing = false;
}
}
// Transforme la valeur d'opacité du masque en byte
private byte OpacityAsByte {
get {return (byte)(this.opacity * 255);}
}
private double opacity = 1;
public double Opacity {
get {return opacity;}
set {
if (value > 1)
value = 1;
else if (value < 0)
value = 0;
opacity = value;
this.Invalidate();
}
}
// Précise que le controle doit être transparent
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= WS_EX_TRANSPARENT;
return cp;
}
}
}
}
PS: I'm using VS2005
|
|
|
|
|
Hello Every Body,
I want to populate the grid view from the data base but i m not able to do so,
Actually i want to show selected feild only through coding,
Regards,
RAHUL
rahul saini
|
|
|
|
|
monuSaini wrote: I want to populate the grid view from the data base but i m not able to do so,
Why not? Is it a knowledge constraint or a coding constraint?
monuSaini wrote: Actually i want to show selected feild only through coding,
You will have to explain this better because at the moment i dont understand what you are asking\looking for.
|
|
|
|
|
Hi,
Thanks for replying me.
Actually i want bind selected columns only.
And i want to add edit button , delete button and an dropdownlist box in gridview
this is which i m not able do.
Regards,
Karan
rahul saini
|
|
|
|
|
monuSaini wrote: Actually i want bind selected columns only
I am assuming you are using VS2005 here.
If you have your grid bound to a datasource then use the grids "Edit Columns" property in design view to remove the columns from the datasource that you dont want to appear in your grid.
monuSaini wrote: And i want to add edit button , delete button and an dropdownlist box in gridview
You can add unbound columns which contain buttons etc again by using the Edit Columns option in design view.
If you need to access any of the controls you add then there are many articles on the web explaining how to do this. Take a look at the following article within the code project articles section.
http://www.codeproject.com/dotnet/AccessingControlsInsideGr.asp[^]
I hope this helps in some way.
|
|
|
|
|
Hi,
Yes i m working in VS2005
And also want to tell you that i m working on datagridview of windows application. In this i m not able to add button.
Regards,
Karan
rahul saini
|
|
|
|
|
Try looking at this page:
http://msdn2.microsoft.com/en-us/library/zkatshfa.aspx[^]
It explains how to add unbound columns to a gridview through code. There is also a link on the page which will take you to a step by step guide of how to add buttons through the designer.
If this is no help then here are the steps i followed:
1. Create a new windows forms application.
2. Add a data gridview to the form and bind it to a data source. (Customers table on the Northwind database)
3. Right click on the grid view and select Edit Columns.
4. Remove the columns you dont want to display from the data source.
5. Right click the grid view and select Edit Columns.
6. Click the Add button.
7. On the Add Column window select the "unbound column" option box.
8. Change the Type combo box to be DataGridViewButtonColumn
You now have a column which will contain a button.
Unless there is something i am mis-understanding then this should do what you were asking.
|
|
|
|
|
Hello Every Body,
I want to populate the grid view from the data base but i m not able to do so,
Actually i want to show selected feild only through coding,
Regards,
RAHUL
rahul saini
|
|
|
|
|
// Fill dataTableObject with your desired data
// and bind it to your grid view
datagridview1.datasource=dataTableObject;
and if you're doing in asp.net then,
gridview1.datasource=dataTableObject;
gridview1.databind();
|
|
|
|
|
|
Er nikesh yadav wrote: int results = com.ExecuteScalar;
Read the build output and it'll tell you how to correct it:
int results = com.ExecuteScalar();
|
|
|
|
|
Er nikesh yadav wrote: Re: Please correct the errror...
There is a lexical typo error in the string literal 'errror'.
Er nikesh yadav wrote: string sqlQuery = "select user,pwd from Login where user= ' " + this.TextBox1.Text + " ' and pwd=' " + this.TextBox2.Text + " ' ";
This statement has potential security hole error called 'SQL Injection Attack'
|
|
|
|
|
ExecuteScalar is a method so it needs () at the end
|
|
|
|
|
Don't delete your original question - It is considered rude.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|