|
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
|
|
|
|
|
Hi. Im making a database application for viewing/editing/searching. Im using the DevAge SourceGrid for database handling. I was told to ask on another forum becouse it was not a SourceGrid related problem. It works as it should in the its current state, but it need to evolve to be able to support more Tabs with grids then only one at a time. so I thought I should solve this dynamicly. I have writen a function that can be used to fill new Tabs, with a Panel and inside this Panel two datagrids. This function can be used to fill these dynamicly created datagrids and fill them with diffrent information from diffrent dataset's.
The problem is Im not sure how to determin what dynamicly created datagrid is currently viewed, and there for be able to be controlled and modefied by new values or what ever should happend with database releated functions as refresh,fitler,update info and so forth.
It is the "maDynamicDataGrid" I belive, I need to know the diffrence between these dynamicly created datagrids.
This is the response line I got before i got here.
"You must read the Tab structure and iterate on all the controls (Tab->Panel->Grid ...)"
Im posting code of the function for creating the dynamic Tab, with the grids.
public void AddNewDefaultDataGridTab( DataSet dynamicDataSet, string dynamicTable, string TabTitle, string columnFileToLoad)<br />
{<br />
dynamicTabNameArrayList.Add(TabTitle);
<br />
#region//-------------------------ADDS-ALL-COMPONENTS-FOR-NEW-TABLE-------------<br />
SourceGrid.DataGrid maDynamicDataGrid = new SourceGrid.DataGrid();<br />
<br />
maDynamicDataGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)<br />
| System.Windows.Forms.AnchorStyles.Left)<br />
| System.Windows.Forms.AnchorStyles.Right)));<br />
maDynamicDataGrid.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;<br />
maDynamicDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;<br />
maDynamicDataGrid.DeleteQuestionMessage = "Are you sure to delete all the selected rows?";<br />
maDynamicDataGrid.DeleteRowsWithDeleteKey = false;<br />
maDynamicDataGrid.FixedRows = 1;<br />
maDynamicDataGrid.Location = new System.Drawing.Point(-1, 18);<br />
maDynamicDataGrid.SelectionMode = SourceGrid.GridSelectionMode.Row;<br />
maDynamicDataGrid.Size = new System.Drawing.Size(202, 83);<br />
maDynamicDataGrid.TabIndex = 9;<br />
maDynamicDataGrid.TabStop = true;<br />
maDynamicDataGrid.ToolTipText = "";<br />
<br />
SourceGrid.Grid maDynamicGroupGrid = new SourceGrid.Grid();<br />
<br />
maDynamicGroupGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)<br />
| System.Windows.Forms.AnchorStyles.Right)));<br />
maDynamicGroupGrid.FixedRows = 1;<br />
maDynamicGroupGrid.Location = new System.Drawing.Point(-1, -1);<br />
maDynamicGroupGrid.Name = "DynamicGroupGrid";<br />
maDynamicGroupGrid.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows;<br />
maDynamicGroupGrid.SelectionMode = SourceGrid.GridSelectionMode.Row;<br />
maDynamicGroupGrid.Size = new System.Drawing.Size(200, 40);<br />
maDynamicGroupGrid.TabIndex = 10;<br />
maDynamicGroupGrid.TabStop = true;<br />
maDynamicGroupGrid.ToolTipText = "";<br />
<br />
System.Windows.Forms.Panel DynamicPanel = new Panel(); <br />
DynamicPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)<br />
| System.Windows.Forms.AnchorStyles.Left)<br />
| System.Windows.Forms.AnchorStyles.Right)));<br />
DynamicPanel.BackColor = System.Drawing.Color.Silver;<br />
DynamicPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;<br />
<br />
DynamicPanel.Controls.Add(maDynamicDataGrid);
DynamicPanel.Controls.Add(maDynamicGroupGrid);
<br />
DynamicPanel.Location = new System.Drawing.Point(-3, -3);<br />
DynamicPanel.Size = new System.Drawing.Size(206, 106);<br />
DynamicPanel.TabIndex = 26;<br />
<br />
System.Windows.Forms.TabPage DynamicTabPage = new TabPage();<br />
<br />
DynamicTabPage.Controls.Add(DynamicPanel);<br />
DynamicTabPage.Location = new System.Drawing.Point(-3, 22);<br />
DynamicTabPage.Padding = new System.Windows.Forms.Padding(3);<br />
DynamicTabPage.Size = new System.Drawing.Size(774, 359);<br />
DynamicTabPage.Text = TabTitle;<br />
DynamicTabPage.UseVisualStyleBackColor = true;<br />
<br />
maDataGridTab.Controls.Add(DynamicTabPage);
<br />
DevAge.ComponentModel.BoundDataView DBSource = new DevAge.ComponentModel.BoundDataView(dynamicDataSet.Tables[dynamicTable].DefaultView);<br />
maDynamicDataGrid.DataSource = DBSource;<br />
maDynamicDataGrid.Name = dynamicTable + "GRID";<br />
ColorOfRows(maDynamicDataGrid.Columns, maDynamicDataGrid);<br />
#endregion<br />
<br />
GroupNamingCtrl = new GroupNaming();<br />
GroupNamingCtrl.RunGetGroupNaming(columnFileToLoad);<br />
<br />
#region //-------------------------------SETS-THE-GROUP-GRID-COLUMNS-------------<br />
int groupCountRow = 0;<br />
int nrOfFixedHeaders = 2;<br />
<br />
maDynamicGroupGrid.Redim(howManyRows + 2, howManyColumns);<br />
maDynamicGroupGrid.FixedRows = nrOfFixedHeaders;<br />
SourceGrid.Grid.MaxSpan = 80;<br />
<br />
for (int header = 0; header < GroupNamingCtrl.infoArrayList.Count; header++)<br />
{<br />
string strConvStartCol = GroupNamingCtrl.StartColArrayList[groupCountRow].ToString();<br />
int intConvStartCol = int.Parse(strConvStartCol);<br />
string srtConvUsesCol = GroupNamingCtrl.UsesColsSArrayList[groupCountRow].ToString();<br />
int intConvUsesCol = int.Parse(srtConvUsesCol);<br />
maDynamicGroupGrid[0, intConvStartCol] = new MyHeader(GroupNamingCtrl.infoArrayList[groupCountRow].ToString());<br />
maDynamicGroupGrid[0, intConvStartCol].ColumnSpan = intConvUsesCol;<br />
groupCountRow++;<br />
}<br />
<br />
int countClos = 0;<br />
foreach (DataColumn DataCom in dynamicDataSet.Tables[dynamicTable].Columns)<br />
{<br />
columnNameString = String.Format(DataCom.ColumnName);
maDynamicGroupGrid[1, countClos] = new MyHeader(columnNameString);<br />
countClos++;<br />
}<br />
<br />
SourceGrid.Cells.Views.Cell viewImage = new SourceGrid.Cells.Views.Cell();<br />
<br />
for (int r = nrOfFixedHeaders; r < 1; r++)<br />
{<br />
maDynamicGroupGrid[r, 0] = new SourceGrid.Cells.CheckBox("", false);<br />
<br />
for (int i = 1; i < dynamicDataSet.Tables[0].Columns.Count; i++)<br />
{<br />
string toRemove = dynamicDataSet.Tables[dynamicTable].Columns[i].ColumnName.ToString().Substring(0, 3);<br />
string dbcolumnNameString = dynamicDataSet.Tables[dynamicTable].Columns[i].ColumnName.ToString();
string afterRemove = dbcolumnNameString.Replace(toRemove, "");<br />
<br />
maDynamicGroupGrid[r, i] = new SourceGrid.Cells.Cell(afterRemove, typeof(string));<br />
}<br />
}
#endregion<br />
<br />
maDynamicDataGrid.HScrollPositionChanged += delegate(object s1, SourceGrid.ScrollPositionChangedEventArgs eScr)<br />
{ maDynamicGroupGrid.CustomScrollPosition = maDynamicDataGrid.CustomScrollPosition; };<br />
maDynamicGroupGrid.HScrollBar.Hide();<br />
maDynamicGroupGrid.VScrollBar.Hide();<br />
}
-- modified at 7:30 Tuesday 26th June, 2007
|
|
|
|
|
I have created an enumeration in the class named abc.cs and placed that in the App_Code directory
<br />
public enum MyEnum<br />
{<br />
alfa = 1,<br />
beta = 2,<br />
gamma = 3<br />
};<br />
I have to access this and display in the list control of a webform .
can anyone help me with the corresponding syntax.
i will be thankful to you.
Sebastian
|
|
|
|
|
You should place it within a namespace:
namespace MyProject.MyEnums
{
public enum MyEnum
{
alfa = 1,
beta = 2,
gamma = 3
};
}
then, you should be able to access it anywhere. To get it's value in your aspx, you need a code block:
<%# MyProject.MyEnums.MyEnum.alfa %>
for example.
In your code behind you can put a using statement for the namespace, or access the enum by the full name.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Thank you very much. Everytime you are there to help me.
In this scenario i have to know all the members of the enum. but if i use a file to store the values the updations will reflect in the webpage automatically. is n't it?
is there any better alternatives?
Thanks once again
sebastian
|
|
|
|
|
Im very new in c#, how do i create an application form with labels and text boxes, listbox, submit and clear in either windows forms or console
csanda
|
|
|
|
|
You are definately new. A console app doesn't have labels or text boxes. In fact, doing this is trival, and doesn't even require code. However, before doing this, you should work through a book that teaches C#, and learn the language, on the console. Either way, your question can't be answered in a forum post, you need to buy some sort of C# book and work through it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|