dickersonka 104 Veteran Poster

You need the user control to save its data, not sure what you need so can't give you any tips there yet. I don't know how they work, but you might be able to make them member variables on the form and never dispose of them.

My advice would be to set your area you want to display the user control in as a panel.
Upon clicking each menu item, you would have something like:

//Create control
//This might be a member variable instead
DeSched Deschedule = new DeSched();
//Clear controls
this.panel.Controls.Clear();
//Add control
this.panel.Controls.Add(Deschedule);
dickersonka 104 Veteran Poster

You really can't do this from the fileupload control. Based on certan ie permission settings, it won't always work in ie either.
My advice is to use either your own control and load the textbox value on postback, or use a 3rd party control.

You normally don't need, care, and so on....of what the path was on the client side.
You might want to rethink the way you are doing things if you need the client path.

dickersonka 104 Veteran Poster

Lots of moving pieces here. This most likely makes me think its a permission issue connecting to the database, but might not be.
Can you make sure your connection string is connecting as a single user to the database with the same host, regardless of the logging in user?
Any mysql errors or exceptions you are getting, other than user name not found?

dickersonka 104 Veteran Poster

You have to show us what you got before we can help you

dickersonka 104 Veteran Poster

you need to have an open connection, just as it says, right before you call execute reader call this

if (conn1.State != ConnectionState.Open)        
{            
conn1.Open();        
}

also it would be a good idea to create a separate class or method for calling all sql functions, that way you don't have to worry about closing and opening except in a single place

dickersonka 104 Veteran Poster

whether it is buttons or textboxes, still the same concept

//form 1
frmKeypad frmKey = new frmKeypad();
frmKey.ShowDialog();
this.btnQuestion.Text = frmKey.SelectedKey;


//form 2
private string selectedKey;
public string SelectedKey
{
get{ return selectedKey; }
}

//sample with just one button
 private void btnOne_Click(object sender, EventArgs e)
{
this.selectedKey = "1";
}

you can get creative with this and use a more generic method of doing this, but those are the basics

dickersonka 104 Veteran Poster

here's a link on a small little sample i did for that

http://alleratech.com/blog/post/Sharing-data-between-forms-with-C.aspx

dickersonka 104 Veteran Poster

you are trying to run the jar file

do you have this in there?

public static void main(String [] args)

i'm assuming you don't, but for a jar file to be run, just like any other code, it needs to start with a main method

dickersonka 104 Veteran Poster

its because you are using an untyped list for one, but you didn't have an else statement

if (yourValue == "b")
{
break;
}
else
{
numbers.Add(Convert.ToInt32(yourValue));
}

also you could use List instead of ArrayList

List<int> numbers = new List<int>();
dickersonka 104 Veteran Poster

there are other ways you could do this, but here's one

select
CAST(Reference AS INT) as REFERENCE
from tablename
dickersonka 104 Veteran Poster

you don't always have to use that way, but you can

you could also do something like this

foreach(int num in numbers)
{
  Console.WriteLine(" " + num);
}
dickersonka 104 Veteran Poster

this will loop through all the values in your array
IEnumerator basically means you can use it to iterate your data

lets say you have 1, 5, 3, 8 in your array

this will print out

1 5 3 8

dickersonka 104 Veteran Poster

also try this statement also

select * FROM assign2 WHERE UPPER(CONVERT(keyword1 USING latin1)) LIKE '%MICROSOFT%';
dickersonka 104 Veteran Poster

What type of collation is this?

run this

SHOW FULL COLUMNS FROM assign2;
dickersonka 104 Veteran Poster

Awesome, you happen to know what the issue was with the one we were working with?

dickersonka 104 Veteran Poster

the stop table is only used in the subquery and can't be referenced outside of it

i don't get why, but it looks like the isdrop =1 is not just joining on those records

try adding this piece in as well

inner join
jobxstop jxs
on jxs.isdrop = 1 and jxs.stopid = stop.stopid
dickersonka 104 Veteran Poster

its not late, only 5, just got a few left before work is done though, there is some data in here that isn't jiving

this will do a partial update, but might help determine what is going on

add this bottom line here and then we can see what rows aren't updated

and jh.jobstatusid = 10
and jobhistory.histjobid = jh.histjobid
and stop.stopcompletiondatetime is not null)
dickersonka 104 Veteran Poster

so close, just something in there i'm just not catching right now, one last try for the evening, cross our fingers

UPDATE jobhistory 
SET modifieddt = 
(SELECT top 1 stop.stopcompletiondatetime 
from stop
inner join
jobxstop jxs
on jxs.stopid = stop.stopid
inner join jobhistory jh
on jh.histjobid = jxs.jobid
where jxs.isdrop = 1
and jh.jobstatusid = 10
and jobhistory.histjobid = jh.histjobid)
where jobhistory.jobstatusid = 10
dickersonka 104 Veteran Poster

but all stop.stopcompletiondatetime are not null?

dickersonka 104 Veteran Poster

hmmmm,

run this

select jobhistory.histjobid, stop.stopcompletiondatetime
from jobhistory
inner join jobxstop 
on jobxstop.jobid = jobhistory.histjobid
inner join stop
on stop.stopid = jobxstop.stopid
where jobhistory.JobStatusID = 10
and jobxstop.isdrop = 1

think there might be something funny going on here

dickersonka 104 Veteran Poster

sorry long day already, i didn't have the join on the original table, lets go back to your query the first time with that one line removed

UPDATE jobhistory
SET modifieddt = stop.stopcompletiondatetime
FROM jobhistory
INNER JOIN jobxstop
ON jobxstop.jobid = jobhistory.histjobid
AND jobxstop.isdrop = 1
INNER JOIN stop
ON stop.stopid = jobxstop.stopid
WHERE jobhistory.JobStatusID = 10

does this one complain about the null values?

dickersonka 104 Veteran Poster

i can't completely tell the structure, but i believe this will work, just make sure you do a backup first!!!

UPDATE jobhistory 
SET modifieddt = 
(SELECT stop.stopcompletiondatetime 
from stop
inner join
jobxstop jxs
on jxs.stopid = stop.stopid
inner join jobhistory jh
on jh.histjobid = jxs.jobid
where jxs.isdrop = 1
and jh.jobstatusid = 10)

if it complains about multiple values do a select top 1 from the subquery

dickersonka 104 Veteran Poster

you have this in here
INNER
JOIN stop
ON stop.stopcompletiondatetime = jobhistory.modifieddt

which will not work, because stopcompletiondatetime does not equal your modifieddt

dickersonka 104 Veteran Poster

The exe is the compiled solution, all exes have already been compiled as well

if you are in a winforms app, it needs to be compiled before running it, if you are in asp.net you can set the project not to be built until specifically build the project

if your project is getting to be that large, then possibly separate your reference dlls out into a separate solution, and build those when necessary, and have the main app reference the dlls rather than projects

alc6379 commented: very good real-world use case here. +12
dickersonka 104 Veteran Poster

In the past I have used SharpZipLib

http://www.icsharpcode.net/OpenSource/SharpZipLib/

dickersonka 104 Veteran Poster
select p.ID,
(SELECT SUM(i.IncomeAmount) from Income i where i.PersonId = p.ID) AS INCOME_AMOUNT,
(SELECT SUM(o.OutcomeAmount) from Outcome o where o.PersonId = p.ID) AS OUTCOME_AMOUNT
from Person p
dickersonka 104 Veteran Poster
select top 3 *
from tableName
order by col3 desc
bharatshivram commented: thanx for your reply. +2
dickersonka 104 Veteran Poster
System.Diagnostics.Process.Start("calc")
chitopolo commented: Thank You very much i was looking for this code like since 2 hours ago..! Thank u again! +0
dickersonka 104 Veteran Poster

Ok, just wanted to make sure we aren't chasing a ghost

Rather than just adding the parameters with a name and value, try to add them with a name and type

SqlParameter param1 = new SqlParameter("@RDate", SqlDbType.DateTime);
param1.Value = dtCurrentDate;
sqlCmdCheckDuplicates.Parameters.Add(param1);

and do the same for the other one

dickersonka 104 Veteran Poster

this doesn't have error handling, but here is how you do it following your line

$result = $mysqli->query($queryStr);

$row_count = $result->num_rows;

$result->close();
dickersonka 104 Veteran Poster

For starters lets start off with syntax:

Did you see this line? SqlParameter("@ResultTime", ddRTime.Text.Trim())); your parameter is named @RTime

dickersonka 104 Veteran Poster

Are you sure you set the column's data type to datetime? It sounds like you are using varchar

dickersonka 104 Veteran Poster

Ahhh sorry, forgot you only needed sql server

here's a link that should help
http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html

here it is with modification

CREATE FUNCTION dbo.AlphaOnly(@value varchar)
RETURNS VARCHAR
AS
BEGIN
DECLARE @returnVar varchar, @i int
SET @returnVar = @value

	select @i = patindex('%[^a-zA-Z]%', @returnVar )
	while @i > 0
	begin
		select  @returnVar  = replace(@returnVar, substring(@returnVar , @i, 1), '')
		select @i = patindex('%[^a-zA-Z]%', @returnVar)
	end

return @returnVar

END

you can use this udf in a trigger

dickersonka 104 Veteran Poster

here is my idea then

select translate('123AB45', 
         'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 
         'ABCDEFGHIJKLMNOPQRSTUVWXYZ') from dual;

i don't necessarily know the context of how you need this, but this will replace all numeric values with '' and leave your string 123AB45 as AB

dickersonka 104 Veteran Poster

of course, the same as you would any other property

public int[] LendMoney
{
get{return lendMoney;}
set{lendMoney = value;}
}

Might want to use an arraylist instead, if its not a fixed length

dickersonka 104 Veteran Poster

would adding a trigger that will format the field to only be characters upon inserts and updates be sufficient?

dickersonka 104 Veteran Poster

well lets start with this

what is the connection string?

dickersonka 104 Veteran Poster

from the ui we get a filepath

string filePath = this.textBoxPath.value;

//We call our class like this from the ui
BusinessLogic logic = new BusinessLogic(filePath);
logic.Load();

we'll pass it into the business logic through a constructor

public class BusinessLogic
{
private string filePath;
  public BusinessLogic(string filePath)
{
this.filePath = filePath;
}

public void Load()
{
//now we use the filepath to load the xml file
}
}
dickersonka 104 Veteran Poster

look at my previous post with a subquery just for you javamedia :-)

i'm not against them at all, just meaning don't shy away from the joins, get a understanding of them and use them in combination with subqueries

dickersonka 104 Veteran Poster

sorry bout that, was a late night and didn't think twice about it

this will work

select
(select count(*) from posts p1 where p1.user_id = u.user_id) as post_count,
u.user_id
from users u
left outer join
posts p
on p.user_id = u.user_id
group by u.user_id
nav33n commented: works great.. +10
dickersonka 104 Veteran Poster

much more clear now, well if you really will have 50000 records at once or a large number of records, i would use the sql bulk insert

here's a link that should get you started in the right direction
http://weblogs.sqlteam.com/mladenp/archive/2006/08/26/11368.aspx

dickersonka 104 Veteran Poster

you are trying to do an inner join on something that isn't there, all users don't have posts

unlike javamedia, i would suggest trying to use inner or outer joins, at least to me it makes life much easier

try this, think it should work

select count(*) as post_count,
u.user_id
from users u
left outer join
posts p
on p.user_id = u.user_id
group by u.user_id
dickersonka 104 Veteran Poster

a couple possible options is dependent on how you are accessing your data

if lets say you are looping through ids and running a select on each id, then that is very inefficient as far as the amount of database calls, i don't know your data structure, nor would i suggest this a final solution but a good start

long[] ids;
//now populate your ids
string idList;
foreach(long id in ids)
{
idList += id + ",";
}

//tip you still need to remove the last comma

string query = "select * from table where id in " + idList;

Another thing you can do is check out how heavyweight your data access objects are, if you only need 2 columns, select those 2 into a class, rather than select *(not recommended to use * as well)

if you only need to load your dataset once, load it into a hashtable stored by primary key and pull from the hashtable once it has been loaded, you want to try and minimize round trips to the database

if you could further clarify your question it would help out a lot

dickersonka 104 Veteran Poster

right, then the exception is correct

uri is expected to be a registered prefix, and javascript is not, things are working properly!!!

dickersonka 104 Veteran Poster

lol whoa, i thought you said it was microsoft

dickersonka 104 Veteran Poster

right, but when that throws an exception, what is the linkItem?

dickersonka 104 Veteran Poster

just to be sure we are still at the same place

what is the exact link that is passed in (what is linkItem)

dickersonka 104 Veteran Poster

what?

are you saying you are modifying the web config file in microsoft.net/framework/v2.0.50727/config ?

it needs to be the web config file in the directory for iis

dickersonka 104 Veteran Poster

and that folder is a web application?

dickersonka 104 Veteran Poster

maybe this is a configuration issue, for sure this folder that the web.config resides as a webapplication?