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

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
foreach(DataRow row in table.Rows)
{
if(row["columnName"] == value)
//display the row, otherwise escape.
}
Ramy Mahrous 401 Postaholic Featured Poster

onedizzydevil

You are not setting the Num variable to value that was entered into the textbox; therefore, it will always be 0.

By Ramy Mahrous

Hey friends!!!! how could you answer their question without looking at their code?!!!! which line they assigned textbox value to Num object?!!!!!

Didn't you see my reply?!!

Ramy Mahrous 401 Postaholic Featured Poster

You're welcome please mark it as solved.

Ramy Mahrous 401 Postaholic Featured Poster

If it works with you please mark this thread as solved.

Ramy Mahrous 401 Postaholic Featured Poster

Here you're

SELECT     WorkOrders.ID, employees.name, employees_1.name AS Expr1
FROM         WorkOrders LEFT OUTER JOIN
                      employees AS employees_1 ON WorkOrders.submitted_by = employees_1.id LEFT OUTER JOIN
                      employees AS employees ON WorkOrders.completed_by = employees.id
Ramy Mahrous 401 Postaholic Featured Poster

You can use BackgroundWorker component which has something to do and has event "work compeleted"

Ramy Mahrous 401 Postaholic Featured Poster

Remove alias and use the table name directly. Replace every T1 & T2 with tblEmailClub

Ramy Mahrous 401 Postaholic Featured Poster

Look try just to update field "Lock" by "ID" instead of by username.

Ramy Mahrous 401 Postaholic Featured Poster

After digging I came with bad performance solution :s but I think it works,

SELECT 
T1.address1,
tblEmailClub.emailclub_id,
tblEmailClub.firstname,
tblEmailClub.lastname,
tblEmailClub.email,
tblSourceHistory.datereg,
tblEmailClub.active,
tblEmailClub.address2,
tblEmailClub.city,
tblEmailClub.state,
tblEmailClub.zip,
tblSourceHistory.source FROM tblEmailClub
INNER JOIN tblSourceHistory
ON tblEmailClub.emailclub_id = tblSourceHistory.emailclub_id
WHERE tblSourceHistory.dateReg BETWEEN '3/1/2009' AND '4/1/2009' 
AND T1. address1 IN
(SELECT T2.address1 
FROM tblEmailClub AS T2
GROUP BY T2. address1 
HAVING COUNT(T2.address1)=1
)
AND tblSourceHistory.source LIKE '%family.asp%'
ORDER BY tblSourceHistory.datereg ASC

Please check it if you have any problem please contact me.
NOTE: try to read also in distinctrow it may help you http://office.microsoft.com/en-us/access/HP010322051033.aspx

I got this solution from my friend Ahmed Gamal: http://vb4arab.com/vb/member.php?u=3

Ramy Mahrous 401 Postaholic Featured Poster

You've right, I'll try something else and reply you.

Ramy Mahrous 401 Postaholic Featured Poster

No, distinct works on column and it removes the duplication, I tried it myself.

Ramy Mahrous 401 Postaholic Featured Poster

hmmm, That's because of obligation of being distinct in first place

SELECT 
DISTINCT (tblEmailClub.address1),
tblEmailClub.emailclub_id,
tblEmailClub.firstname,
tblEmailClub.lastname,
tblEmailClub.email,
tblSourceHistory.datereg,
tblEmailClub.active,
tblEmailClub.address2,
tblEmailClub.city,
tblEmailClub.state,
tblEmailClub.zip,
tblSourceHistory.source FROM tblEmailClub
INNER JOIN tblSourceHistory
ON tblEmailClub.emailclub_id = tblSourceHistory.emailclub_id
WHERE tblSourceHistory.dateReg BETWEEN '3/1/2009' AND '4/1/2009'
AND tblSourceHistory.source LIKE '%family.asp%'
ORDER BY tblSourceHistory.datereg ASC
Ramy Mahrous 401 Postaholic Featured Poster

I got confused because they mentioned "my sql statement" I didn't recognize they mean: "their sql statement"

Ramy Mahrous 401 Postaholic Featured Poster

Hey friends!!!! how could you answer their question without looking at their code?!!!! which line they assigned textbox value to Num object?!!!!!

Ramy Mahrous 401 Postaholic Featured Poster

"data type mismatch in criteria expression"

because you should pass integral value.
So, Doesn't MySQL have profile to log the coming connection\transaction like MS SQL? you can check it, or I do recommend you to use MySQL library for .NET which on http://MySQL.org instead of OLE

Ramy Mahrous 401 Postaholic Featured Poster

So, what happened? exception raises? or it closes the form normally?, I can't admit that MySQL query is correct but it's ANSI-SQL all RDBMS should support it.

Ramy Mahrous 401 Postaholic Featured Poster

To stop it noway else putting it on a specific thread then in some defined cases you kill this thread.

Ramy Mahrous 401 Postaholic Featured Poster

Here you are how to generate rdl Programmatically http://msdn.microsoft.com/en-us/library/aa237432(SQL.80).aspx don't forget to change the OpenConnection and GenerateFields methods to which fits your environment.

Ramy Mahrous 401 Postaholic Featured Poster

Because you didn't assign Num value to TextBox.Text value
you need to modify your code to

Private Sub TxtNum_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtNum.TextChanged
Dim Num As Integer
Num = Int.Parse(TxtNum.Text)
If Num > 100 Then
MsgBox("You win a lucky prize")
ElseIf Num < 100 Then
MsgBox("Better luck next time")
End If
End Sub
End Class
Ramy Mahrous 401 Postaholic Featured Poster

You say it doesn't work in this way

SELECT tblEmailClub.emailclub_id,
tblEmailClub.firstname,
tblEmailClub.lastname,
tblEmailClub.email,
tblSourceHistory.datereg,
tblEmailClub.active,
Distinct (tblEmailClub.address1),
tblEmailClub.address2,
tblEmailClub.city,
tblEmailClub.state,
tblEmailClub.zip,
tblSourceHistory.source FROM tblEmailClub
INNER JOIN tblSourceHistory
ON tblEmailClub.emailclub_id = tblSourceHistory.emailclub_id
WHERE tblSourceHistory.dateReg BETWEEN '3/1/2009' and '4/1/2009'
AND tblSourceHistory.source LIKE '%family.asp%'
ORDER BY tblSourceHistory.datereg asc
Ramy Mahrous 401 Postaholic Featured Poster

Use Distinct keyword

Ramy Mahrous 401 Postaholic Featured Poster

Look, As far I got your scenario, Form2 may have property Number which holds the numbers user enters.
Before closing the Form2 From Form1, read the Form2.Number.

Ramy Mahrous 401 Postaholic Featured Poster

Let me know the exception raises, and if you need to generate rdlc on the fly I can guide you to great way to work in such thing

Ramy Mahrous 401 Postaholic Featured Poster

Yes, you can but it should be registered

Process p = new Process();
p.StartInfo.FileName = "notepad.exe"; // or "WINWORD.exe";
p.StartInfo.Arguments = "C:\\file.txt";
p.Start();
Ramy Mahrous 401 Postaholic Featured Poster

*Not to mention I used Pubs database and worked on Authors table (address column)

Ramy Mahrous 401 Postaholic Featured Poster

Dear Andresasongko,

select 
REVERSE
(
substring(
	REVERSE(address)
	, 0
	, CHARINDEX(' '
				, REVERSE(address)
				,0
				)
)
)
,address from authors

That's what I tried right now, you can work to perform it better.

Ramy Mahrous 401 Postaholic Featured Poster

Yes, it's on 2008

Ramy Mahrous 401 Postaholic Featured Poster

Right Click on Project->Add->Existing Item->Select the file then on Add button you'll find arrow press on it then Add as Link.

Ramy Mahrous 401 Postaholic Featured Poster

And the first too, I didn't mean to use my code as it's!

Ramy Mahrous 401 Postaholic Featured Poster
string[] allData = YourMethodWhichReadFromFile();
foreach (string line in allData)
string[] lineItems = line.Split(' ');
//insert lineItem to database
Ramy Mahrous 401 Postaholic Featured Poster

1- Use paging
2- You'll use QueryString which holds row ID, in this page load handler you will fill DataList\GridView\... with data by this ID (Googlize it)

Ramy Mahrous 401 Postaholic Featured Poster

First based on first post you said you can Just Insert\Delete record and that's enough for my algorithm.

I am unsure how to pursue the steps you stated above, as in trying to do so i ended up damaging the add record function in the process.

debug your code and see from where the damage happen.

When you say Put the Data in memory, do you mean in a Temporary File or a Variable.

YES

Ramy Mahrous 401 Postaholic Featured Poster

ADO.NET used to help you do that.
Go to http://www.asp.net and search on ADO.NET

Ramy Mahrous 401 Postaholic Featured Poster

which border? and where is it if it's not inside the form?!!

Ramy Mahrous 401 Postaholic Featured Poster

Please clarify your question, use code tag, and don't use Caps Lock.
I tried to read it but I didn't mange to.

Ramy Mahrous 401 Postaholic Featured Poster

Update = Get data from file -> put data in memory -> delete data from file -> update the data in memory -> insert data into file.

P.S: data may be record or records.

Ramy Mahrous 401 Postaholic Featured Poster

Good, but where is your questions? Just begin and if you faced any problem drop a question after your approaches to solve it.

Ramy Mahrous 401 Postaholic Featured Poster

Let me see to learn from you, and if it solved please mark it as solved to be used as reference for people facing this problem. Thanks

Ramy Mahrous 401 Postaholic Featured Poster

Yes

Ramy Mahrous 401 Postaholic Featured Poster

Yes, SQL Server 2005 has better performance over SQL Server 2000, and I think migration to 2005 is essentially.
No problem from your side else remove * and replace it with columns names. Yes it makes sense.

Ramy Mahrous 401 Postaholic Featured Poster

My opinion is to remove the initiation of the new thread in the class

Dim ThreadX As New System.Threading.Thread(AddressOf doSomethingElse)
          
          ThreadX.IsBackground = True
          ThreadX.Start()

          While ThreadX.ThreadState <> System.Threading.ThreadState.Aborted AndAlso ThreadX.ThreadState <> System.Threading.ThreadState.Stopped

rather creating this new thread in the class you call DoSomething

1- Dim str As String
2- Dim x As New myClass
3- Dim thrd As new Thread(new ThreadStart(x.DoSomthing)
' Try to modify DoSomthing to be void to work in this wasy
'4- x.closeSomething()

Or you can read more about threading, talk to thread from another, etc.. it may help http://msdn.microsoft.com/en-us/library/system.threading.thread_members.aspx

Ramy Mahrous 401 Postaholic Featured Poster

That's normal because you don't stop the main thread, your process or application in line 3 has 2 threads working in parallel..

Ramy Mahrous 401 Postaholic Featured Poster

the problem is in datRead.GetString(X) you says give me string, he (VS) replies I don't have string, I've Int32 what shall I do for you.
Check the data types in your table if you have column of Int32 use GetInt32(X) or if you've column of bit use GetBoolean(X)

Hope it solve.

Ramy Mahrous 401 Postaholic Featured Poster

Look I tried it myself, it works
I dragged and dropped a DataGridView control, I binded it a datasource, then I dragged and dropped a Button, on its ClickEvent handler I wrote this code

dataGridView1.Columns[2].Visible = false;

It removes this column == it works.
Or I don't understand you.

Ramy Mahrous 401 Postaholic Featured Poster

As you need it in VBA you should ask this question there http://www.daniweb.com/forums/forum4.html

Ramy Mahrous 401 Postaholic Featured Poster

dataGridView1.Columns["column name\ index"].Visible = true\false;

Ramy Mahrous 401 Postaholic Featured Poster
Datanizze commented: Thanks for the helpful linking! :D +1
Ramy Mahrous 401 Postaholic Featured Poster

Look again, in BindingNavigator controls (buttons) modify its modifier access to public, sure you didn't if you did, you'd see them when access this user control