|
Dear Christian Graus:
I am not sure how I asked twice? It was not my attention.
When we want to remove the caption we need to remove sizeable attribute. After that we will never receive any message or event that tells us that mouse is on edge. Perhaps you have something else in your mind.
Do you any other way to remove caption?
I worked on Fortran while back. I am not sure but you may still ask me any question on FORTRAN. I uesed to be good, but I do not know yet.
Best regards
Agha Khan
agha.khan@hotmail.com
Agha Khan
|
|
|
|
|
AghaKhan wrote: I am not sure how I asked twice? It was not my attention.
Your question was posted twice.
AghaKhan wrote: . After that we will never receive any message or event that tells us that mouse is on edge.
That's right, you need to track this yourself, from the mouse position.
AghaKhan wrote: I worked on Fortran while back.
I never have, you're responding to my sig block, it's not a comment from me to you.
Are you using C# ? I suddenly wonder if you're in the wrong forum, and using C++
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 )
|
|
|
|
|
Hello
i don't know why i can't save this record in the database
there is no error and every thing is fine but i can't see the new data in the database
this is the code:
"con.Open();
str3 = "INSERT INTO [CreditCard].[dbo].[CreditCardInfo] ([CreditTypeID],[CreditcardNumber],[CustomerName],[BankID],[ExpiryDate],[EntryDate],[MachineTypeID]) VALUES((" + crId + "),(" + crNum + "),('" + Name + "'),(" + bnkId + "),('" + dtm + "'),('" + now + "'),(" + mId + "))";
cmd = new SqlCommand(str3, con);
adap.InsertCommand = cmd;"
i verify the insert statment in the SQL and it save the data
any help ???
Thanks in advance
Assaf
|
|
|
|
|
If you grab the SQL from the debugger and paste it into your database, what happens ?
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 )
|
|
|
|
|
the data is inserted in the table
Assaf
|
|
|
|
|
What if you check the DB after running the code, might the issue be that the data has changed and your app is not refreshing it's data source ?
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 )
|
|
|
|
|
I checked but there is no change
Assaf
|
|
|
|
|
Then your code that passes the SQL to the data base is plainly where the problem is. You can check when you call the data layer as to how many rows were affected, that's a good place to start.
Using stored procs is another option worth exploring. Depending on where your data comes from, your current code could have you wide open for injection attacks.
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 )
|
|
|
|
|
The problem is when i execute the code no row is affected un the database
but when i take the insert statment from the watch and execute it in the SQL i can saw that one row is affected
so i wonder do from the code.
Assaf
|
|
|
|
|
Then your SQL is fine, and your code to call the database is broken. As I said.
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 )
|
|
|
|
|
you mean the connection string but i use it before to retreive data from the same database and it succeed
Assaf
|
|
|
|
|
Not necessarily, I mean that somewhere you're supposed to call some code and you're not. I don't use the nasty built in SQL insert/update/delete stuff, so I can't help much more, but that's plainly where the issue is. That's just common sense.
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 )
|
|
|
|
|
let clarify a last question
after i write:
"adap.InsertCommand = cmd;"
should i wite something else ?
and this step isn't the one which give the data into tha database
Thank you very much
Assaf
|
|
|
|
|
Again, I have no idea, I don't use that stuff, I like to write proper data layers.
you should google for docs on the features you're trying to use.
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 )
|
|
|
|
|
did you use Storedprocedure for that
Sorry about the question but i try to learn the best way
Thanks a lot for your help
Assaf
|
|
|
|
|
Yes, I used stored procs, always, and then call them from a data layer ( a seperate dll that handles all database calls )
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 )
|
|
|
|
|
Attach the profiler to SQL server and see what query (if any) actually gets executed by your app.
|
|
|
|
|
Why start a new thread? You already have a thread about this.
Where do you execute the command?
---
single minded; short sighted; long gone;
|
|
|
|
|
what you mean by start a new thread
adap.InsertCommand = cmd;
Should i write something else to save the Data in th database
Assaf
|
|
|
|
|
He means that you asked the same queston again instead of staying where you asked it before.
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 )
|
|
|
|
|
Assaf82 wrote: adap.InsertCommand = cmd;
Should i write something else to save the Data in th database
That is just putting the command in an adapter. You have to do something to execute the command.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Again, google would have answered this long ago. Don't use stuff you don't understand, research it first.
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 )
|
|
|
|
|
Google for ExecuteNonQuery. All you have done is write code that could insert data into the database - you haven't actually told the runtime to perform the insert.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I know entity class name as string ( e.q. "Customer", "Product")
I need to invoke static method in this entity class.
I tried the following code but got compile error shown in comment.
How to invoke static method when type name is known as string ?
using System.Collections.Generic;<br />
using System;<br />
<br />
class TestApplication {<br />
<br />
static void Main() {<br />
FindByTypeName("Customer");<br />
FindByTypeName("Product");<br />
}<br />
<br />
static object[] FindByTypeName(string typename) {<br />
<br />
Type t = Type.GetType(typename);<br />
ActiveRecordBase<object> entity = (ActiveRecordBase<object>)<br />
System.Activator.CreateInstance(t);<br />
<br />
return entity.FindAll();<br />
<br />
}<br />
<br />
}<br />
<br />
class Customer : ActiveRecordBase<Customer> {}<br />
<br />
class Product : ActiveRecordBase<Product> {}<br />
<br />
public class ActiveRecordBase<T> {<br />
public static T[] FindAll() {<br />
return null;<br />
}<br />
}
Andrus
|
|
|
|