|
Change:
private void btnSelectServer_Click(object sender, EventArgs e)
{
<<assign values from control boxes>>
frmMain main = new frmMain();
main.Show();
this.Hide();
}
-------
Nguyen Dai Duong
Ha Noi University of Technology
daiduongbk@gmail.com
|
|
|
|
|
Hi,
I am needed to implement an inventory control module but should I apply ORM for it? For the case, if I create a change (e.g. transfer from one warehouse to another warehouse), then the loaded stock value may be change by other, so how to use ORM for this case? or should not use ORM for this case?
Thanks
|
|
|
|
|
I don't see any difference in using an ORM for this or not. ORM are just a kind of tool to prevent you from writing database access code (insert/delete/update).
The question is not really clear. Maybe you could describe your requirements in more detail?
Regards
Sebastian
|
|
|
|
|
In my thinking of using ORM for inventory control, it should be get a stock, minus the request quantity, and then update to the database.
so if
inventory = 6
pc a = 6,
pc b = 6,
then pc a request to remove 2 items and process the value = 4 and then update to db,
but pc b keep the value = 6 and then remove 3 items, and the update to db,
it seen to be value = 3 in the inventory, it's about the concurrency control, how to let it better?
Thanks
|
|
|
|
|
Hi.
I want to know how you make an space between a statement in the code.
for example when i write Console.Writeline("I am john");
i want to leave some space between that statement and the next statement.
how u format it to leave some space between the lines?????
thanks.
|
|
|
|
|
you can writeline (string.empty); or you can put \n in the string (I think)
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Environment.NewLine
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Or even Console.WriteLine(string.Empty);
Duh.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Old age does these things Chris. Not that I'm implying that you old.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
use "system.environment.newline";
wqqwqw
|
|
|
|
|
Please help, encounter the following problem.
I am not able to serialize a custom member in my class that is inherited from collection base.
Samples class:
[Serializable()]
public class Ques
{
public string Descriptions = "";
public string Answer = "";
public Ques(){}
.
.
.
}
[Serializable()]
public class Questions : CollectionBase
{
public string QuestionSetVer = "";
public Questions(){}
public Ques this[int index] { get { return (Ques)List[index]; } set { List[index] = value; } }
.
.
.
}
[Serializable()]
public class Test
{
public Test(){}
private Questions QuestionsCol ;
[XmlArrayItem(typeof(Ques))]
public Questions QuestionsCol
{
get { return QuestionsCol; }
set { QuestionsCol = value;}
}
.
.
.
}
I am able to serialize using XML, but the prob is "QuestionSetVer" will not be part of the XML element.
Hope that someone can help me out on this.
Thanks
|
|
|
|
|
Have you tried assigning a value to QuestionSetVer ? e.g. public string QuestionSetVer = "1.0";
BTW are you inheriting from CollectionBase for a specific reason? It is not Type-safe and will come back to bite you in the end.
If you use generics it all becomes much simpler.
Replacing:
[Serializable()]
public class Questions : CollectionBase
{
public string QuestionSetVer = "";
public Questions(){}
public Ques this[int index] { get { return (Ques)List[index]; } set { List[index] = value; } }
.
.
.
}
with
[Serializable()]
public class Questions : List<ques>
{
private string questionSetVer = "";
.
.
.
public string QuestionSetVer
{
get
{
return this.questionSetVer;
}
set
{
this.questionSetVer = value;
}
}
}
</ques>
will make your life easier in the long run. Notice also that I have replaced your public field with a private field and a public property, so as to conform to the data-hiding principles of OOP.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi friends
Could u plz any body help me to exexcute my exe without windows login. I want to run my C# login Exe before windows log on screen apperas.
|
|
|
|
|
Too bad.
The dll you need to replace is C++
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Dear All,
I am using following code to list directories and show them into to listview.
what happens is sometimes this code shows 1 directory, sometimes 2 directory and sometimes 3 directory while in fact i have 3 directories in ftp (why)?
ftpAddress=new UriBuilder("ftpAddress")
System.Net.FtpWebRequest ftpRequest=(FtpWebRequest)WebRequest.Create(ftpAddress.Uri);
ftpRequest.Credentials=new NetworkCredential("user","pass");
ftpRequest.Method=WebRequestMethods.Ftp.ListDirectory;
StreamReader read=new StreamReader(ftpRequest.GetResponse().GetResponseStream());
while (read.Peek()>-1)
{
ListViewItem item=new ListViewItem(read.ReadLine());
listView1.Items.Add(item);
}
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hi,
not sure, but I wouldn't trust a combination of Peek() and ReadLine(), since Peek() will check availability of any amount, and ReadLine() is to return one line.
rather do fetch all first, then split it into lines.
|
|
|
|
|
thx Luc Pattyn, I used Stream.EndOfStream, it works fine for me.
but now i faced another prob. while listing directory in a listview it takes lots of time, i want to use BackgroundWorker or delegate to add directories in listview.
I googled and gone through MSDN as well, i got some concept of that and
i would realy appreciate demo or any reference about using backworkgroundworker or delegate.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
|
thx dude, good topic.
I am using BGW to connect ftp server, retrieve data and upload to ftp server.
i am uploading files to ftp server and i can get them very fine.
but when i am uploading zip files, it upload the zip file but i can not get the size of zip file while i can get the size of other files. here is the error i am facing
"the remote server returned an error: (550) File unavailable (e.g File not found, no access..)"
I know the error which says invalid file name while the file exists in the server. This is only for zip files not for other files.
here is mypath to server, where ftpServer is the server address as ftp.address.com
ftp://ftpServer/zipFolder.zip
still i dont know my ftp address is invalid, but if its invalid than why i can access other files incase i replace "zipFolder.zip" to "myfile.txt".
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hi,
I'm not sure, but from the symptoms I think the following is probable:
some systems (WinXP, WinVista, ...) know how to look inside a ZIP/RAR file, i.e. they tend to treat them as folders rather than files, hence they don't want to associate a file size with them, etc. Not sure how to overcome this.
|
|
|
|
|
im hoping someone can help me,
for my final year project im using the webcam based laser recognition software by Ashish Derhgawen. I will use this with a PowerPoint Add-in i have created which is a toolbar containing buttons simulating basic operations, next slide, previous slide, highlight, etc. Im having a hard time assigning those actions to the buttons. it was suggested that i should use shortcut keys and pass them from the button but im still having trouble. its probably very simple but i just can get it to work, can anyone help me with this.
khuram
|
|
|
|
|
There's not enough info in your question for me to answer.
Are you saying that you have some buttons which perform some logic, and you want the same logic to be fired when you press a key?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
hi
How to copy some files from one folder to other with multithreading in visual C#?
sample code please.
thx
|
|
|
|
|
|