|
Yes.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
i already done web page but i have a problem..now i have 2 web page window which is button window and graph window....so, i want to make button and graph in a window..the graph always refresh...how can i do that?
|
|
|
|
|
Your question is not very clear, and would probably be better in the ASP.NET or Web Development forums.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
when I start run remoting It show problem:
No connection could be made because the target machine actively refused it 127.0.0.1:8080
how can Fix this Problem...Thank in advanced
|
|
|
|
|
Try remoting to a machine (IP address and port) that will accept your request. Do you have a process listening on port 8080 of your own machine? I assume you understand that 127.0.0.1 is the loopback address.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
there is debate in my local office as whether or not we would benefit from migrating from C++ to C# to work with our SQL Server database.
currently we are using MS SQL Server Express R2 as a test model and making connections and doing some stored procedure work from C++ front end. Eventually, we will work in our customer's environment of the full fledged Microsoft SQL Server.
Can I get some feedback/opinions on the pros and cons of each - C++ and C# ?
Thank you,
JJ Mackey
|
|
|
|
|
If you're using ADO.net with either then there shouldn't be much difference.
My first experiences with SQL Server was with C++ and ODBC to access SQL Server 6; I hope you're not doing that.
|
|
|
|
|
Currently, i am using C++ with ADO commands. My programming team maintains several thousand lines of code in C++ (Visual Studio 2008) and there are roughly 1K-3K lines that interact with external databases in the Microsoft SQL Server environment.
The majority of the system(s) code we maintain don't perform SQL Server interaction - maybe 25% will interact with SQL Server.
Maybe i'm missing the difference between ADO and ADO.net. Also, back to the original question, what do i gain if i choose C# over C++ ?
Most of the team knows C++/MFC and we are clueless on C#.
Thanks.
|
|
|
|
|
john john mackey wrote: what do i gain if i choose C# over C++ ?
Undying gratitude from Microsoft?
john john mackey wrote: Most of the team knows C++/MFC and we are clueless on C#.
Then stick with what you know.
|
|
|
|
|
I don't think there is any difference from the database POV, I doubt there is any difference from the connection and interaction POV either. I'd be astonished if changing from C++ to C# made the slightest difference, changing from ADO to ADO.Net "may" make some slight difference.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for the insight. Now I must look at the differences/advantages of ADO.net v ADO.
Regards,
John John
|
|
|
|
|
ADO.net (DataAdapters and suchlike) is quite nice. And you also have the potential of an entity management system like Entity Framework or NHibernate. However, that's not likely to be practical on a large existing database, and once you've written the queries, things aren't that different.
If you were starting a new project from scratch I'd advise using C# but the gains are not going to pay back the massive cost of moving an existing system, particularly if your team would have to start learning from the ground up.
|
|
|
|
|
Thank you for your comment and some topics to investigate regarding ADO.net.
Yes, the learning curve and porting our existing system is an important consider for staying with C++.
- John John
|
|
|
|
|
john john mackey wrote: Can I get some feedback/opinions on the pros and cons of each - C++ and C# ?
That isn't logical.
You can't make a technological decision wildly. It needs to be based on your business needs.
Some possible considerations.
- You have a team of 10 C++ senior developers with no C# experience. And the application meets all of the current business needs. And the C++ developers want do continue using C++. So the ONLY decision is to keep using C++.
- You have a team of 10 C++ developers with varying experience levels in C++ and C#. The application meets all of the current business needs. But 5 developers with the most business knowledge are threatening to quit unless you start using C#. So the only decision is to use C#.
- Your largest customer produces 80% of your business income and insists that you use either C++ or C#. So that is what you use.
- Your largest customer produces 80% of your business income and insists that you implement a feature that can only be implemented in either C++ or C#. So that is what you use. (This is probably a stretch scenario.)
- Your business plan calls for you selling the company to Microsoft. Then use C#.
- Your business plan calls for you selling the company to Oracle. Then use C++. Or Java. Regardless re-write to use Oracle instead of SQL Server.
- Your application is 1000% slower than it should be. You have a design/architecture/requirements problem. It has NOTHING to do with language choice.
- etc, etc, etc...
|
|
|
|
|
I have a C#.net 2008 desktop application that I need to modify for the first time. This application has a tablelayout panel that I would like to know how to modify. On this tablelayout panel I want to add a textbox and a label control between two existing label and textbox controls that are already on the table layout panel. Since I am new to working with desktop applications, can you tell me and/or show me to a reference on how to modify a existing table layout panenl control?
|
|
|
|
|
Just drag and drop them into the desired location on the designer.
If they are added dynamically via code instead of using the designer, use yourPanel.Controls.Add to put them where they belong.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
A good way to get familiar quickly with how Controls are added, moved, etc. in a container like TableLayoutPanel is to start a new project (we're assuming WinForms here).
Put a TableLayoutPanel on the Form, set up some rows and columns, drag and drop a Label into one cell, and a TextBox into the next cell on the same row you put the Label.
Then open the Designer.cs file, and observe how those controls are added to specific cells in the TableLayoutPanel:
this.tableLayoutPanel1.Controls.Add(this.textBox1, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.label1, 1, 1); An interesting thing is that if you inspect the Controls you've added, you'll see Row and Column properties available in the Property Grid browser, but the Controls themselves are not "extended," i.e., do not expose these properties in code you write.
So how do you move the TextBox to the next cell right of its current location. Like this:
private void MoveTextBox_Click(object sender, EventArgs e)
{
var tbPosition = tableLayoutPanel1.GetPositionFromControl(textBox1);
tbPosition.Column++;
tableLayoutPanel1.SetCellPosition(textBox2, tbPosition);
} This crude example is just to show the basic mechanism; for production code you'd want to write, I think, a generalized procedure with parameters that would include the Control to be moved, and either a fixed location to be moved to, or relative vertical and/or horizontal offsets, and you'd want to error check that you were not trying to move something outside the TableLayoutPanel cell-bounds (which does not throw an error if you do, by the way: the control just stays in the same place).
Another strategy would be to use the 'Remove method of the TableLayOut.Controls collection, and then insert them back in where you wished.
tableLayoutPanel1.Controls.Remove(textBox1);
tableLayoutPanel1.Controls.Add(textBox1,0,0); If you are adding new Controls at run-time, you are, of course, going to need to keep references to those Controls if you wish to re-use them after removing them from your container.
good luck, Bill
"Anyone who shows me my 'blind spots' gives me the gift of sight." ... a thought from the shallows of the deeply shallow mind of ... Bill
modified 30-Nov-11 20:36pm.
|
|
|
|
|
According to the article here:
http://msdn.microsoft.com/en-us/library/t9883dzc.aspx
it is possible to add tasks to a post build event.
I have created a solution with two projects. One for the Test dll and one for a Windows Form application. I have modified the windows form application project file as described in the article above as follows
<UsingTask TaskName="MyTasks.SimpleTask3" AssemblyFile="bin\debug\MyTasks.dll" />
<Target Name="AfterBuild">
<SimpleTask3 MyProperty="Hello!" />
</Target>
and created a task like this.
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Resources;
namespace MyTasks
{
public class SimpleTask3 : Task
{
private string myProperty;
[Required]
public string MyProperty
{
get { myProperty; }
set { myProperty = value; }
}
public override bool Execute()
{
return true;
}
}
}
If I build the task project with return true, then build the Windows Form project, the build succeeds. If I then rebuild the task, then attempt to rebuild the Windows Form project, I get the following error:
Error 1 The command "copy "C:\MyTasks\bin\Debug\MyTasks.dll" "C:\TestApplication\bin\Debug\"" exited with code 1. TestApplication
The only way to get the build to succeed again is to close the solution and re-build. Is this expected behavior? Is there some way to get around this? Having to close and re-open the solution every time the task is changed is annoying.
EDIT:
After some research, trying xcopy, etc... I found that the error has to do with the fact that the MyTask.dll is "in use". Is there a way to force Visual Studio to release the lock on this? This isn't a problem on other projects where there are project references to a dll wit "Copy Local" turned on...
modified 30-Nov-11 12:05pm.
|
|
|
|
|
When i wanna to run script of create/Alter View i get the following error :
My Source is :
SqlConnection con = new SqlConnection(conString);
SqlCommand cmd = new SqlCommand();
try
{
string command = @"create view d_jest
as
SELECT dbo.AccDocumentDetailsVosoolBargasht.VosoolBargashtId, dbo.AccDocumentDetailsVosoolBargasht.AccDocumentDetailsId,
dbo.VosoolBargasht.GhabzDetailsId, dbo.VosoolBargasht.Type, dbo.AccDocumentDetail.AccDocumentID
FROM dbo.AccDocumentDetailsVosoolBargasht INNER JOIN
dbo.VosoolBargasht ON dbo.AccDocumentDetailsVosoolBargasht.VosoolBargashtId = dbo.VosoolBargasht.ID INNER JOIN
dbo.AccDocumentDetail ON dbo.AccDocumentDetailsVosoolBargasht.AccDocumentDetailsId = dbo.AccDocumentDetail.ID
Go
Create view d_kest
as
SELECT dbo.AccDocumentDetail.AccDocumentID, dbo.AccdocumentDetailsTafsiliShenavar.TafsiliShenavarId,
dbo.AccdocumentDetailsTafsiliShenavar.AccDocumentDetailId, dbo.AccdocumentDetailsTafsiliShenavar.ID, dbo.TafsiliShenavar.Name,
dbo.TafsiliShenavar.Code
FROM dbo.AccdocumentDetailsTafsiliShenavar INNER JOIN
dbo.TafsiliShenavar ON dbo.AccdocumentDetailsTafsiliShenavar.TafsiliShenavarId = dbo.TafsiliShenavar.ID INNER JOIN
dbo.AccDocumentDetail ON dbo.AccdocumentDetailsTafsiliShenavar.AccDocumentDetailId = dbo.AccDocumentDetail.ID
Go ";
cmd.CommandText = command;
cmd.Connection = con;
con.Open();
int result = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
if (con.State == ConnectionState.Open)
con.Close();
I get this error :
Incorrect syntax near 'GO'<br />
'CREATE VIEW' must be the first statement in a query batch.<br />
Incorrect syntax near 'GO'
but if i run this script directly in sql i wont get an error and every thing is right there.
|
|
|
|
|
Go is a special word use by SQL Server. It's not part of the T-SQL language per-se, so you can't use it as part of your command text. An easy way to do this is to split the command text out and issue 2 ExecuteNonQuery commands.
|
|
|
|
|
I have just give here two create view..
I have about 100 views to be create ... so i cannot split it (it will take a lot of time and mistake) i wanna to have all in open command text.
Thanks for reply.
Help Please,
modified 30-Nov-11 6:31am.
|
|
|
|
|
Replace the GO statements with ; instead then.
|
|
|
|
|
i get error.
the error is :
Incorrect syntax near the keyword 'Create'
Thanks for reply.
Please Help!
|
|
|
|
|
Hmmm. OK, with a slight change of architecture, you can use the SMO objects in Microsoft.SqlServer.Management.Common and use ServerConnection.ExecuteNonQuery to execute the original (with GO) statements as that does recognise them.
|
|
|
|