|
1st Problem
Use ShowDialouge method for open new window.
2nd problem
Set anchor property of cotrol.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hav a habit of putting Full stop at ur problem descriptions.
Solution for 1st problem: use Singleton pattern.You can find them in c-sharpcorner.com
Solution for 2nd problem:I am not getting you???
Regards
Chintan
www.visharadsoft.com
(I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
|
|
|
|
|
I have tried so many different logics to display different values in a datagridview combobox column but with no result.All the rows show the same values.
What am i suppose to do?
Can anyone help me with this thing?
Please someone reply me fast.
|
|
|
|
|
Hello to all,
this is my problem,
I have a list of objects of type message_A. message_A is a specific message with it's own types.
I of course have Message_B and message_C etc.
I now want to create a List to hold all kinds of messages, using polymorphism.
in order to do that, I created an empty class called messages(for instance) and made
every message type inherit from it.
this way I am able to do:
List<messages> myMess = new List<messages>();
messages Amessage = new message_A();
myMess.Add(Amesssage);
this works fine, the problem is when I want to use data from the myMess[i] type, I can't reach
that data.
meaning, this won't work:
DT = myMess[i].timeStemp;
when writing the dot "." I can't access any of the public types of message_A It was created from.
Please Help me.
I am kind of new to C# specifically and Programming all together.
Thank you.
regards.
P.S
all the code snippets I gave were written here and not real code from my program
because it's more scattered there.
the code here is supposed to explain my issue. if you need more info just ask
and I will provide real code if necessary.
|
|
|
|
|
Because you have a list of base objects, the derived properties will not be there. Your best bet is to create an enum of class types, and make each class type tell you what it is via the enum. Or, find a way to offer a common, base interface that can do the different things you want via polymorphism ( so, timeStemp is defined in the base class, and holds a value that's valid relative to the type of object you have ). Only things derived in the base will be visible, your only other route is to use is or as.
As in
MessageB mesB = myMessageA as MessageB;
if (mesB != null)
{
// It was of MessageB type.
// mesB now has the full MessageB interface.
}
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 )
|
|
|
|
|
Thanks for your suggestions,
If I write it that way, is it to costy???????????
PointPairList angleTimeArr = new PointPairList();
for (int i = 0; i < fileMessages.Count; i++)
{
angleTimeArr.Add((fileMessages[i] as Clusters.CSensorStatus).valveAngDeg , )
}
should I instead do as you said and implement a base interface or enum, will it improve
performance in a significant way???
|
|
|
|
|
If you know for sure that they are all of this type, then just make your list of this type. Any that are not, will come back null and throw an exception.
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 ,
Am getting this error, how can I rectify this?
Data is Null. This method or property cannot be called on Null values.
Can anyone help me out in solving this issue?
Thanks,
Mirunab
|
|
|
|
|
By making sure that the method or property you have is not null? You can try giving it a default value at instantiation.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
|
|
|
|
|
Hi,
I am REALLY new to C#, can someone please help...
How do I Insert the values of 2 textboxes directly into a database?
Example:
textbox1 = name
textbox2 = surname
Database has a table caled "test_tbl" with 2 columns. One called "name" the other "surname"
Kind Regards
|
|
|
|
|
|
I found a number of articles regarding inserting into Databases but most of them I did not understand. I appologize if my question is too simple for you. No need to get nasty about it. Everybody needs to learn sometime...
But thank you for your inputs, I did manage to find the following though and got it to work:
SqlConnection conn = new SqlConnection(_connection);
SqlCommand cmd = new SqlCommand(_query, conn);
conn.Open();
object returnVal = cmd.ExecuteScalar();
conn.Close();
Regards
|
|
|
|
|
He didn't get nasty with you. He pointed out a basic fact that there are other things to learn about before you start with database issues. Believe me, you'd know if he'd got nasty.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My apologies then for misunderstanding him.
Unfortunately I have to do the Database thing now, I have something that needs to be done in 2 weeks and is mostly db work and I have to learn it all in 2 weeks.
Thanks anyways
|
|
|
|
|
Is this a class, or paid work ?
Either way, you need to buy a book and get stuck into it. We can't really offer consistent help at the level that you're asking for it, it's just not possible.
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 have two text boxes
int x=int.parse(textbox1.text)
int y=int.parse(textbox2.text)
SqlConnection cn = new SqlConnection(//but here your connection string);
cn.Open();
cm = new SqlCommand("INSERT INTO teble_name VALUES(" + x + "," + y + " ) ", cn);
cm.ExecuteNonQuery();
and here you insert the record you want
If I HaD OnE sInglE wIsh IwIll gO back for thE fIrst tIme i sEE yOu
|
|
|
|
|
Islam9 wrote: int x=int.parse(textbox1.text)
int y=int.parse(textbox2.text)
SqlConnection cn = new SqlConnection(//but here your connection string);
cn.Open();
cm = new SqlCommand("INSERT INTO teble_name VALUES(" + x + "," + y + " ) ", cn);
cm.ExecuteNonQuery();
This has errors:
Parse has a capital P
Text has a capital T
Your insert statement is attempting to concatenate integers into a string.
Your insert statement is susceptable to a SQL Injection Attack. Please learn how to prevent them[^]
|
|
|
|
|
instead of telling me my errors
ihope ou tell us the right way to do the requier
thank you
If I HaD OnE sInglE wIsh IwIll gO back for thE fIrst tIme i sEE yOu
|
|
|
|
|
Islam9 wrote: instead of telling me my errors
ihope ou tell us the right way to do the requier
I did! I gave you a link to an article that tells you what you should be doing.
The other errors highlighted are sufficiently easy to correct I didn't think an explanation was necessary.
int x=int.parse(textbox1.text);
parse should be Parse
text should be Text
The other two errors can be corrected by reading, understanding and implementing the recommendations in the article that was linked: http://www.codeproject.com/cs/database/SqlInjectionAttacks.asp[^]
|
|
|
|
|
Hi
We are using Visual Studio 2005, C# and SQL Server 2005. We are developing a system that is a combination of some Windows Application modules and a Web application (intranet). We have a number of maintenance processes that we would like to schedule to run automatically a few times a day. What is good way of handling scheduling in this type of scenario?
Second questions is whether we could create Web Services to handle these maintenance processes and schedule the system to consume the web services at regular intervals.
Any advice will be appreciated.
Thanks
Kobus
|
|
|
|
|
Your second question answers for the first. That is a good method of creating webservice to handle schedule process. You need to create a windows application too, which request to the webservice frequently.
|
|
|
|
|
For First Question:
Yes we can execute maintenance processes that we would like to schedule to run automatically a few times a day. in sql server by providing a mechanism
SQL SERVER INTEGRATED SERVICE(DTS).
On which you do every code script on the FLY.
Thanks & Regards
Tarini Singh
Sr. Software Engineer. (IT)
tksingh@zentagroup.com
|
|
|
|
|
For First Question:
Yes we can execute maintenance processes that we would like to schedule to run automatically a few times a day. in sql server by providing a mechanism
SQL SERVER INTEGRATED SERVICE(DTS).
On which you do every code script on the FLY.
Thanks & Regards
Tarini Singh
Sr. Software Engineer. (IT)
tksingh@zentagroup.com
|
|
|
|
|
Start|Programs|Accessories|System Tools|Scheduled Tasks
|
|
|
|
|
Hello there,
I have a bunch of tables that must be created in oracle while installing my c# application, any idea how to make that happen?? currently I'm saving my tables ddl statements in a .sql file.
Many thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|