Try Running this separately
[CODE]SELECT DISTINCT c.primaryemailaddress, c.companyname, CAST(m.maxdate AS DATETIME ) AS maxDateCreated
FROM companycontact AS c[/CODE]

Then try this separately.

[CODE]SELECT so.companyname, MAX(so.date_created) AS maxdate
FROM ordhed_sales AS so, company AS co
WHERE so.companyname = co.companyname
AND co.isOEM = '1'
GROUP BY so.companyname) AS m[/CODE]

Peace.

Hmm,

Look into Database.

If you are just practicing it may be a good idea to play with MS Access, If you don't mind getting right into it look into SQL.

Here Read these

[URL="

Please Look at [URL="

Post some more of your code.

Provide the data types of the variables.

Don't use Help as a subject Matter.

Peace.

Try this
[CODE=C#]
// Getting Max RecordNo
string maxRec = getMaxRec("12/05/0003");
[/CODE]

which will be followed by

[CODE=C#] //WHERE LNo is your current Loading Number.
private static string getMaxRec(string LNo)
{
string MaxRec;
try
{
MaxRec = new OleDbCommand("Select Max(RecNo) + 1 From LoadItems where LoadingNo="+LNo, con).ExecuteScaler();
}
catch { MaxRec = 1; }

return MaxRec;

}
[/CODE]

The try catch is for the very first entry.

When it tries to fetch the MaxRecNo for the very first entry of the day where RecNo should be 1 it will get nothing and throw an exception where you catch it and set it to 1.

I didn't try the solution so there maybe some punctuation I may have missed please check it.

This code also Assumes you have LNo already set for the day.

I still don't completely understand your code, but I understand the concept.

I assume you are trying to say that one LoadingNo (LNo) has many RecNo. So RecNo is really the count of different Pallets or Items that go into the Lorry but why not keep it the Product/Serial No of the Pallet/Item?

It may be a better idea for you to go with Mitja Bonca advice as it will be a lot simpler to work with in the future.

Peace.

[B]CalculateNewRecordNumber[/B]
You still didn't clarify what this is?

Try this for the textBox
[CODE]textBox2.Text = DateTime.Now.ToString("dd/MM/yy", DateTimeFormatInfo.InvariantInfo);[/CODE]

I still don't understand what you are doing here.

[CODE]string strChechID1 = "select LoadingNo from LoadItems where LoadingNo=LoadingNo";[/CODE]

Please provide the Create Table statement for this table and provide a sample Input/Output.

EDIT

Ok I understand what loadingNo is now, But then what is the point of RecNo.

i.e. if LoadingNo is 12/05/0003 is the third Invoice or Loading that happened that day. When what is Rec?

Won't Rec be 3 as well?

Peace

[QUOTE="sushanth08"]basically can u tell me the code to replace some strings in the rich text box i.e clearing and inserting[/QUOTE]

[CODE]//Clearing
richTextBox1.Clear();

//Inserting
richTextBox1.Text="ABCD\nEFGH";

// Adding /n is to generate a new Line so Output will be
// ABCD
// EFGH
[/CODE]

Peace.

Could you explain what [B]CalculateNewRecordNumber[/B] is supposed to do.

I think it can be done more efficiently.

Why are you doing this?

[CODE]
textBox2.Text = DateTime.Now.ToString(strFormat);

textBox2.Text = record;
[/CODE]

This statement doesn't look right

[CODE]
string strChechID1 = "select LoadingNo from LoadItems where LoadingNo=LoadingNo";
[/CODE]

Ok this is Where you say the problem is.

[CODE]int RecNo = 1;

if (dtrCheckID1.HasRows)
{

RecNo += 1;

comm.Parameters.AddWithValue("@LoadingNo", textBox2.Text);
comm.Parameters.AddWithValue("@RecNo", RecNo);
comm.Parameters.AddWithValue("@PONo", PONO);
comm.Parameters.AddWithValue("@Cust", Customer);
comm.Parameters.AddWithValue("@Item", Item);
comm.Parameters.AddWithValue("@Model", Model);
comm.Parameters.AddWithValue("@Material", FGrade);
comm.Parameters.AddWithValue("@Thk", Thk);
comm.Parameters.AddWithValue("@Width", Width);
comm.Parameters.AddWithValue("@Length", Length);
comm.Parameters.AddWithValue("@Qty", Qty);
comm.Parameters.AddWithValue("@Remark", Remark);

comm.ExecuteNonQuery();
lblMessage.Text = ("Successful Insert!!!");
con.Close();

timer1.Enabled = true;

}

else
{
comm.Parameters.AddWithValue("@LoadingNo", textBox2.Text);
comm.Parameters.AddWithValue("@RecNo", RecNo);
comm.Parameters.AddWithValue("@PONo", PONO);
comm.Parameters.AddWithValue("@Cust", Customer);
comm.Parameters.AddWithValue("@Item", Item);
comm.Parameters.AddWithValue("@Model", Model);
comm.Parameters.AddWithValue("@Material", FGrade);
comm.Parameters.AddWithValue("@Thk", Thk);
comm.Parameters.AddWithValue("@Width", Width);
comm.Parameters.AddWithValue("@Length", Length);
comm.Parameters.AddWithValue("@Qty", Qty);
comm.Parameters.AddWithValue("@Remark", Remark);

comm.ExecuteNonQuery();
lblMessage.Text = ("Successful Insert!!!");
con.Close();

}
[/CODE]

All I see is one statement has RecNo += 1; and the other doesn't.

Could you please clarify what exactly you want, also coding your code would immensely help.

Peace.

[QUOTE=xanawa;1542349]resolved[/QUOTE]

Please Mark as Solved.

Peace.

I think you are asking about the Raw DateTime format as you receive from it from the Database.

This varies on the database itself.

MSSQL spits it out like this: yyyyMMdd HH:mm:sss:hhh

MySQL I believe is yyyyMMddHHmmss

If you mean how to you Enter Date into a DateTime variable

Then you need to use [URL="

You can also use CAST Command

[CODE]CAST(fieldname as VARCHAR[50]) [/CODE]

But this is more useful in using the field as a temporary basis. Like

[CODE]SELECT CAST(fieldname as VARCHAR[50]) from table_name[/CODE]

For Permanent change using the above solution is better. (ALTER TABLE)

Peace.

commented: wrong answer. -3

Can you enter BIOS by pressing F2 or Del it should say how to enter BIOS on the bottom of the screen.

Go in and see if you can "Load Bios Defaults".

BIOS menus are always different you will have to refer your manual.

What happens if you leave the machine on for like 10 minutes on the Blank Screen?

Are you comfortable in Removing your hard drive to document and report the effect?

It may be a simple case of malware simply fixed by Reinstalling the OS (you may loose data).

Peace.

Look at this part alone:
[CODE]SELECT 'ClientDocs', ClientID FROM clients WHERE NOT (clients_ClientID IN (SELECT ClientID FROM clients,folders WHERE clients.ClientID=folders.clients_ClientID))[/CODE]

In your first post you said:
[QUOTE]Client Table: ClientID INT PK AI, ClientName VarChar[/QUOTE]

Look at this part:
[CODE]WHERE NOT (clients_ClientID IN [/CODE]

You are calling for clients_ClientID from the Client Table Where you have said that client_ClientID is from the Folders Table.

After trying to figure this out I have found a solution.

If you want to follow how i concluded the solution it's [URL="

I am having some trouble.

I have a Linux Server hosting 5.1 MySql.

The Windows clients are running a POS Program written in C# using the .Net Connector.

The Problem is that the initial connection takes around 12 Seconds which is not a big problem, but when you let it idle for a couple of minutes it seems to close the connection and requires another 12 seconds to reconnect.

Once connected it works fine and is very snappy.

I read on a few posts it could be a [URL="

Please read the rules, No thread Hijacking.

As for your problem, check the GPU fan, it maybe stuck. if there is no Fan, check the heatsink.

Ask for a refund. No use trying to keep fixing a month old machine. You will keep facing problems.

it is quite possible, but it depends on how many bad sectors we are talking about.

It could also mean that the source is corrupt.

there is a small thin cable that goes from the Cd to the Motherboard for audio.

Have you set the Drive to cable select or Master /Slave? regardless try setting it to CS for both the hard drive and Cd-Rom

I would suggest you start small, gain experience and then goto the bigger stuff.

Fro starting I think you should play with MS Sql Express. There are a lot of tutorials and samples online for this setup.

As for Visual Studio, don't you want to plant your feet in the ground before you go around spending money?

if you goto Menu (where it usually says start in Windows) there is a little search bar on the botton in there type 'Disk Utility' It will show you all the drives on the computer from there click on your drive.

On the right Panel it will show you information on the drive. If Smart is enabled it will give you a light indicator of how your drive is doing.

You want to look for Smart Status for the indicator and right underneath it Click on Smart data for more information, like how long the drive is running, How many bad sectors, etc.

Ok just to make sure your Wave is turned up.

If it is already up, please let me know.

So does your machine boot now or no?

By boot I mean you hear the Post beep. It's a single beep after you switch it on it comes up within a few seconds of switching the machine on.

If it boots, do you see the Dell logo in the beginning? or just "a white mark like a curser point on the screen"?

If you don't get the Dell logo, then your LCD or VGA maybe damaged, if you get the Dell logo then your drivers maybe corrupt.

Maybe a faulty cable?

Try changing the cable.

It sounds like malware.

Read [URL="

Best DB?

That is a debate in it's self.

The Simple answer is it depends, what do you want to do?

Just learn? maybe Access or MS SQL Express.

To Deploy? again depends what sort of scale?

You have to provide more information on what you want to do.

Which line are you getting this error?

[CODE]DataRow dr = dt.Rows[0]; // ???[/CODE]

did you try to generate your stored procedure in the SQL Browser? Do they all give you a result?

Silly me I just noticed you are a spammer..

Well, Honestly XP was the Last Version that I would ever use, but you must understand that using XP is dangerous as Security Vulnerabilities put you on risk of infection or hacking.

I faced this same dilemma at the Launch of Vista, after trying it out I formatted my machine and Broke the CD, so much hate for Vista. Windows 7 maybe faster but I haven't seen that, it just too much bloat for me. Where XP is too dated.

Might I suggest Linux to you? Try it goto [URL="

Well depending on your call or Read Loop.

[CODE] ListViewItem temp;
while (Your Select Loop)
{
temp = new ListViewItem()
temp.Text = ColumnData1
temp.SubItems.Add(ColumnData2)
temp.SubItems.Add(ColumnData3)
'.....
'.....
temp.SubItems.Add(ColumnData8)
temp.SubItems.Add(ColumnData9)
listView1.Items.Add(temp) 'your ListView
}[/CODE]

you don't have to use while, use your own propagation method.

Please mark as solved if solved or ask questions.