Ramy Mahrous 401 Postaholic Featured Poster

ASP.NET is like C#.NET plus adding some functionalities to handle some web actions. All in all it's exact C# and you can write it by VB.NET
Similar to name because
ASP stands for Active Server Pages
JSP stands for Java Server Pages

Ramy Mahrous 401 Postaholic Featured Poster

thnx for ur guidance, for internet point of view , what features c# provide? what can i create for web using c#?

ny gud and easy book aur tutorial for c# and of course for beginner ??

First, please write proper English to understand you.
http://msdn.microsoft.com/en-us/vcsharp/aa336766.aspx

"you can integrate it with a lot of products via COM,"

what does that means , plz explain it a little...

It's advanced topic don't care to learn it from first days. I just say it has some features over Java.

Ramy Mahrous 401 Postaholic Featured Poster

Both are good for you.
Java: platform independence
C#: Better performance, good GUI, you can integrate it with a lot of products via COM, plus I can help you to learn it.

Ramy Mahrous 401 Postaholic Featured Poster

You should place your value contains dashes in single quote '

string updateCommand = String.Format("UPDATE MyTable SET MyTable.Code  = '{0}' WHERE MyTable.ID = '{1}'","10-5-3","124" )
Ramy Mahrous 401 Postaholic Featured Poster

StreamReader.ReadLine() takes no arguments.
You can hold the text file string into string then cut\split it by '\n' then refer to the index of the array returned.
Here also an example: http://msdn.microsoft.com/en-us/library/system.io.streamreader.readline.aspx

Ramy Mahrous 401 Postaholic Featured Poster

1- Search on theming and skeining product and see the read me file.
Really, I didn't use such methodology in work, usually I don't interfere with UI process.

Ramy Mahrous 401 Postaholic Featured Poster

If you asked this question to Anders Hejlsberg (The architect of C#) he wouldn't be able answer you. Return back to the example explanation to find out what isRecording is? or at least copy the full code here to be able to guess.
I guess it's to indicate file status (saved\unsaved)

Ramy Mahrous 401 Postaholic Featured Poster

Or delete the Example.cs and repeat the steps to create new code file and paste the code into. Or simply replace existing code with new one.
Actually this is bad comment, ignore it!

Ramy Mahrous 401 Postaholic Featured Poster

And I think it's the only solution if you don't need to use Themes, etc.. because .net controls is sealed; you can't inherit from and do some changes.

Ramy Mahrous 401 Postaholic Featured Poster

Dim 1 As String
Dim 2 As String

Variables can't be numeric, use one or two instead.
And please clarify the question more

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

You can write below code and call it in form load or in the constructor.
Just a demonstration.

foreach(Control c in Controls)
{
if ( c is Label )
{
c.BackColor = Color.White;
}
}
Ramy Mahrous 401 Postaholic Featured Poster

Should I ask you the same questions?
OK, Please tell me what you are going to do?

Ramy Mahrous 401 Postaholic Featured Poster

What were you going to do???

Ramy Mahrous 401 Postaholic Featured Poster

BLL (Business Logic Layer) is Class, Classes, Module, Modules, assembly or assemblies.
Used to perform business logic, business constraints and any business validation.
Used in N-Tier architecture, Always acts as link between GUI and DAL (Data Access Layer). It's under GUI and above DAL. So it just depends on DAL, and takes reference to it.
It's abstract definition, if you need to know more ask again.
Regarding namespaces, it doesn't have default namespace.

Ramy Mahrous 401 Postaholic Featured Poster

For MS SQL Server questions please post it in MS SQL Server forum http://www.daniweb.com/forums/forum127.html
Please tell me the procedures you took to reach this message.

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

Yes, Danny, it's Vista problem (Aero, and Vista basic) color scheme, if you turn it into Windows Classic it'd work.

Or, remove Vista style

[STAThread]
        static void Main()
        {
            //Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
ddanbe commented: Offered a plethora of solutions to the problem! +4
Ramy Mahrous 401 Postaholic Featured Poster

What I know there's two Tree Sort algorithms
1- depends on Binary Tree algorithm
2- depends on Heap Sort algorithm

I see you really need to read in any one. Coding is useless in this case.
http://en.wikipedia.org/wiki/Binary_tree_sort
Implementation in C\C++: http://www.algorithm-code.com/wiki/Binary_tree_sort

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

Jerry, first thanks for great help. But Array.Sort() implements Quick Sort algorithm not Tree Sort algorithm.

Ramy Mahrous 401 Postaholic Featured Poster

I don't know really why people don't ask their questions in true meaning!!

"tree sort" i have to sort and count all of the words.

according to the question no one can debate my answer is wrong!!
To the asker: You should say count the repetition, duplication, recurrence for each word in the text file not to say the count of words I think the difference between two questions likes the difference between sky and earth.

Ramy Mahrous 401 Postaholic Featured Poster

I can't see any icons, can you please clarify the icon by outline it...

Ramy Mahrous 401 Postaholic Featured Poster

I recommend using XML Webservices, it fits your case.

Ramy Mahrous 401 Postaholic Featured Poster

Use cookies!! it's pure C# forum, I recommend you to post your question ASP.NET forum http://www.daniweb.com/forums/forum18.html

Ramy Mahrous 401 Postaholic Featured Poster

You can use simpler code to count the number of words

string textData = File.ReadAllText(filePath);
int count = textData.Split(' ').Count;

Read in the algorithms and understand it well, you'll apply it smoothly... or you can search in the implementation (but I can't recommend that)

Ramy Mahrous 401 Postaholic Featured Poster

As SQL shows date fields in correct format (like you want) so the problem in your third party that maps data types between SQL Server and MySQL. Check if you can configure mapping processing to enforce your third party to convert in that format do or check the technical support of the product .

Ramy Mahrous 401 Postaholic Featured Poster

What's the tool you use to migrate?

Ramy Mahrous 401 Postaholic Featured Poster

Do you have any triggers on those tables?

Ramy Mahrous 401 Postaholic Featured Poster

what a generic answer!!! Yes. search on ClickOnce deployment.

Ramy Mahrous 401 Postaholic Featured Poster
string str;
foreach(object o in yourListBox.Items)
{
str+= o.ToString() + " ";
}
Ramy Mahrous 401 Postaholic Featured Poster

Sorry?
You mean publish website or deploy project as installation file(s)??

Ramy Mahrous 401 Postaholic Featured Poster

Sure it's possible as I don't understand your question!!

Ramy Mahrous 401 Postaholic Featured Poster

I understood you, you can use XMLTextReader

static void Main(string[] args)
        {
            string xmlStr = "<string xmlns=\"http://www.webserviceX.NET/\"><StockQuotes><Stock><Symbol>AAPL</Symbol><Last>121.30</Last><Date>4/21/2009</Date><Time>3:03pm</Time><Change>+0.80</Change><Open>118.95</Open><High>122.14</High><Low>118.60</Low><Volume>13044984</Volume><MktCap>108.0B</MktCap><PreviousClose>120.50</PreviousClose><PercentageChange>+0.66%</PercentageChange><AnnRange>78.20 - 192.24</AnnRange><Earns>5.383</Earns><P-E>22.39</P-E><Name>Apple Inc.</Name></Stock></StockQuotes></string>";
            PrintElmentValue(xmlStr, "Last"); //pass any element name i.e Last, Change, Symbol
        }

        static void PrintElmentValue(string strAsXml, string elmentName)
        {
            XmlTextReader reader = new XmlTextReader(new MemoryStream(new ASCIIEncoding().GetBytes(strAsXml)));

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element && reader.Name == elmentName)
                {
                    Console.WriteLine(reader.ReadInnerXml());
                }
            }
        }
Ramy Mahrous 401 Postaholic Featured Poster

Please tell me what string you get, and how you need it to be. Because messages (return value) from XML Webservice be in SOAP format, so I'm confused.

Ramy Mahrous 401 Postaholic Featured Poster

Did you mention you work with multithreading technique?
Please mark it as solved.

Ramy Mahrous 401 Postaholic Featured Poster

Strange!! Did you debug it?

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

I don't want user open many form2 so I use a private boolean variable. When the button is clicked, it call the function to check the bool variable, if false then show form 1 and set the bool variable to true. And form2 open, and that works to prevent user open many form

What about using ShowDialog() instead of Show() without using any variables it'll enforce user to not open more than 1 instance of form2

Ramy Mahrous 401 Postaholic Featured Poster

Debug your code to know which line raises this exception.
- Put breakpoint at ConnString and begin debugging.

Ramy Mahrous 401 Postaholic Featured Poster

What's the exception?

Ramy Mahrous 401 Postaholic Featured Poster

First your question should be in C# Forum http://www.daniweb.com/forums/forum61.html
Second, it should raise exception but you don't show it "blank catch block" modify it to

catch (Exception ex)
{
MessageBox.Show(ex.Message);           
}

I believe that the problem in the connection string. make sure it connects to the server by debugging your code.

Ramy Mahrous 401 Postaholic Featured Poster

So, mark this thread as solved.

Ramy Mahrous 401 Postaholic Featured Poster

Jerry I don't agree with you to override ToString method for such reason.

I don't show any objection to override ToString but I don't override it to bound it to Control. Any control bound data it should know what to display and what to represent as value.
1- Yes, you've right I wrote two statement which one is enough
2-

The student class does not contain any null-able properties, so this simple class would work fine, however if there are null-able objects that are used in the display, you could end up with an exception.

Once the ToString() method is overridden, then comboBox1.SelectedItem.ToString() cannot throw an exception, and will always return the correct Text.

You can handle it in its properties too, Jerry like what you write in ToString implementation you can right it too in any property.

Thanks Jerry for the great reply, it's so valuable.

Ramy Mahrous 401 Postaholic Featured Poster

Jerry I don't agree with you to override ToString method for such reason.
Let the ComboBox SelectedValue, SelectedText properties assigned to some Class properties that's better. http://fci-h.blogspot.com/2008/04/how-to-bind-combobox-to-array-of-object.html

Ramy Mahrous 401 Postaholic Featured Poster

It's not the best, it's what we wrote when I was student, and I didn't work in this algorithm I was in GUI Layer.

Ramy Mahrous 401 Postaholic Featured Poster

I read your question more and more and I didn't know what you need or what your problem is!
But if you need to show selected file's path

Dim openFile As New OpenFileDialog()
        openFile.Filter = "XML Files(*.xml)|*.xml"  'Only show XML files in Open Dialog Window
        openFile.InitialDirectory = "/My Documents"
        If openFile.ShowDialog() = DialogResult.OK Then
            MessageBox.Show(openFile.FileName)
        End If
Ramy Mahrous 401 Postaholic Featured Poster

What came to my mind when I see your question is to generate day number (1, 31) - Month (1,12) - year* (1900, 2009)
Say this method GenerateDate
Write method to CheckIsValidDate(day, month, year)
because it may you have 31-2-2008 which is wrong date. if CheckIsValidDate returns false call GenerateDate again untill CheckIsValidDate returns true

*Any mini-max number set it as you like

Ramy Mahrous 401 Postaholic Featured Poster

Please use ASP.NET FORUM http://www.daniweb.com/forums/forum18.html they will answer you.

Ramy Mahrous 401 Postaholic Featured Poster

Yes, and it's very easy too.
Say we have table Student (ID#, FirstName, LastName)

SqlDataSource.SelectCommand = "SELECT FirstName + ' ' + LastName AS FullName, ID FROM Student";
ComboBox.DataSource = SqlDataSource;
ComboBox.SelectedText = "FullName";
ComboBox.SelectedValue = "ID";
ComboBox.DataBind();