|
I am using VS2005 with SQLServer Express Edition. Select SQL statement work fine but not Insert or update. Is there something am doing wrong?
Sample insert code.
DataSet.DatabaseDataSetTableAdapters.SaleTransactionTableTableAdapter SaleTransAdapter = new DataSet.DatabaseDataSetTableAdapters.SaleTransactionTableTableAdapter();
SaleTransAdapter.Insert(7, (decimal)NetTotal, DateTime.Now);
Nana
|
|
|
|
|
i add the same problem with i think.
the problem is when you create the DB, it make a copy of it in your bin/debug forder and every update are in this DB
the one you create is the basic one and every time you run the debugger, he takes all the info in the basic one to overwrite the bin/debug one but the screen result show you the bin/debug DB.
so, it look like the add you made are not working
in your db explorer, create a new connection and link it to the bin/debug one then when you add something, check in this one
hope it help you !
have a good one
|
|
|
|
|
Thank you for your help. I am afraid to say its still not working. Only select statements work after i have manually populated the database. Insert and updates still don't. i added a connection to the copy in the debug. It also has the same data as the one in the local folder. Insert still not working on that one too. I will appreciate anymore suggestions
Nana
|
|
|
|
|
Well thanks for your suggestion. I tried it and its still not working. Insert and update statement do not work on the database cope in the debug directory too. The select statement works if i populate the database manually. I create insert and update commands to no success. I will appreciate anymore sugestions. Thanks
Nana
|
|
|
|
|
You need to set insert and update commands
|
|
|
|
|
Well thanks for your suggestion. I tried it and its still not working. Insert and update statement do not work on the database cope in the debug directory too. The select statement works if i populate the database manually. I create insert and update commands to no success. I will appreciate anymore sugestions. Thanks
Nana
|
|
|
|
|
Hi
I'm currently developing a windows application in c#. I have a set of static libraries written in c++ which I used in a VC++ application. The libraries have numerous classes which would be useful. So I'd like to instantiate object of these classes in my c# code. The question is should I discard the libraries and re-write the code or can I make this into managed code or can I leave it and use it as is.
Any suggestions would be great!
Cheers
|
|
|
|
|
From managed code in C# you can only use PInvoke to call 'C' functions exported from DLLs. If you have exported C++ classes you cannot interact with them at all using PInvoke.
Using VC++/CLI in a mixed mode project you can access both the managed world and the native world. If you use C++/CLI to wrap the old classes in managed classes you will be able to reuse the code as is and expose it to C# code through the new managed class or classes. There are many articles here and on MSDN about C++/CLI and there is a forum for it on CodeProject as well.
led mike
|
|
|
|
|
hi
i need a Vs2005 richTextBox component that has background image capability.
thanks
|
|
|
|
|
I create stord procedure in SQL 2000
Select_Cost
@day1 int,
@month1 int,
@year1 int,
@day2 int,
@month2 int,
@year2 int
AS
Select aa,ab,autoclave,fz,ez,liquidglue,pearlglue,hh,pva
from CostDetails
where
datepart(day, costdate ) >= @day1
and
datepart(month, costdate ) >= @month1
and
datepart(year, costdate ) >= @year1
and
datepart(day, costdate ) >= @day2
and
datepart(month, costdate ) >= @month2
and
datepart(year, costdate ) >= @year2
GO
and i want shoe result in Crystal report
i try it in C#.net 2005 and write this code but crystal report load empty :
private void button1_Click(object sender, EventArgs e)
{
SqlConnection con =new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=cost;Integrated Security=True";
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Select_Cost";
SqlParameter par1 = new SqlParameter("@day1", dateTimePicker1.Value.Day);
SqlParameter par2 = new SqlParameter("@month1", dateTimePicker1.Value.Month);
SqlParameter par3 = new SqlParameter("@year1", dateTimePicker1.Value.Year);
SqlParameter par4 = new SqlParameter("@day2", dateTimePicker2.Value.Day);
SqlParameter par5 = new SqlParameter("@month2", dateTimePicker2.Value.Month);
SqlParameter par6 = new SqlParameter("@year2", dateTimePicker2.Value.Year);
cmd.Parameters.Add(par1);
cmd.Parameters.Add(par2);
cmd.Parameters.Add(par3);
cmd.Parameters.Add(par4);
cmd.Parameters.Add(par5);
cmd.Parameters.Add(par6);
SqlDataAdapter datadp = new SqlDataAdapter();
datadp.SelectCommand=cmd;
ChamberDataSet ds = new ChamberDataSet();
con.Open();
datadp.Fill(ds);
con.Close();
crystalReportViewer1.Visible = true;
CrystalReport1 report1 = new CrystalReport1();
report1.SetDataSource(ds);
this.crystalReportViewer1.ReportSource = report1;
THANK U
|
|
|
|
|
Afternoon All,
This has maybe been asked a million times so apologies in advance.
Does anyone have a tried and tested way of converting a decimal to a fraction (including negative decimals) or better still can you point me in the direction of an article explaining how to do this? I have tried google but can find nothing on C#. I did convert a program written in VB, but only to find that the logic therein was wrong.
Really appreciate any help
Thanks in advance
Colin
|
|
|
|
|
Just search cp for fraction class
|
|
|
|
|
Thats excellent. Just what I was looking for. I had come across another one in CP but not this one.
Many thanks
Colin
|
|
|
|
|
There are a few, mine and others (which were of assistance to me). Which did you find easiest or most helpful?
|
|
|
|
|
Hi
I went with the one supplied by Giorgi and although I am making headway. it is a bot complicated for one of limited experience. Do you have something else?
Many tahnks
Colin
|
|
|
|
|
|
I'm creating WinForms ERP application.
This application need to run custom scripts in may places like:
retrieving list of invoices
before adding invoice
before saving invoice
after saving invoice
before posting invoice
after posing etc.
etc.
I'm looking for script engine which simplifies this.
Features I need to embed into application are:
1. Syntax coloring script editor
2. Syntax check on script save
3. Executing scripts with error reporting
4. Passsing parameters to/from scripts
5. Allowing scripts to access application objects.
6. Maybe binding scripts to Winforms control events.
Any framework, idea, or sample code how to implement this ?
Andrus
|
|
|
|
|
You can use the Microsoft Scripting engines. I don't know if any licensing is involved.
led mike
|
|
|
|
|
I'm implementing entity object which should populate its properties from
database when property is first referenced.
In RDL reports I use object properties like
MyObject.MyProperty
MyObject is instance of entity class. There is no MyProperty property in MyObject at design time.
I need to catch missing object reference and provide object value at run time. Something line
public class MyEntity {
override Exception Exception.MissingPropertyGetException {
return dbo.ExecuteScalar("SELECT "+Exception.UnreferencedPropertyName+
" FROM myEntity");
}
}
Any idea how to implement this ?
Andrus
|
|
|
|
|
I don't know if properties can be added at run time.
What I would do is have a dictionary (e.g. System.Collections.Generic.Dictionary<string,object>) for various values the object may hold.
You can then have a property that exposes the dictionary and access the values like
myobj.Properties [ "SomeProperty" ]
|
|
|
|
|
There are so many different ways of adding help and documentation to an application that I am confused and don't know where to start.
Have you got experience with adding help that you would like to share? I'd be interested in hearing about approaches that create the help directly in the source code as well as 3rd party applications that claim to make writing help and documentation easier.
Here is what I'm trying to achieve:
1) Help for the user directly within the application.
2) Have the possibility of adding web-based help for things like 'How to ...' that can be added after an application has been released.
3) Write a manual for the end user.
I'm particularly keen on keeping the effort for writing this documentation as small as possible, i.e. I don't want to write the same thing two or three times.
Any feedback is appreciated.
|
|
|
|
|
|
Thanks for that, though I am looking for documentation for the end user of the software, not for the software developer.
This documentation or manual should include images, cross references, etc.
|
|
|
|
|
how can i use the code for vc++ .NET in c# .NET????
|
|
|
|
|
what do you mean?
rather have something you don't need, than need something you don't have
|
|
|
|