padtes 30 Junior Poster in Training

I came searching this thread because I found my power to affect someone's reputation is +/- 1. I also observed that some other newbies have less posts or solved less problems and got more points.

The only thread I got negative, in my honest opinion, are from idiots to put it mildly. And I get down graded? The reputation and power to change reputation is really beyond my ability to understand.

If I don't get answer from the community or moderators in next few days, I am going to give good bye salute with you know which finger.

padtes 30 Junior Poster in Training

2 things I can think of: 1. What is data type of h? 2. Is the result "Hits from Admin" null if you run the query (like in SQL query analyzer or Management studio)?
I would try something like this

int iHits = 1;
 if (dr["Hits"] != DBNull.Value) {
   iHits += Convert.ToInt32(dr["Hits"]);
}
//if you need string...
string sHits = iHits.ToString();

Syntax is mostly correct c#, just check spelling / case if there is problem.

kvprajapati commented: Good suggestion. +7
padtes 30 Junior Poster in Training

There are 2 steps:
1. declare parent page (superclass)

public class ParentPage : Page
{
protected override void OnLoad(EventArgs e)
    {
       objLoginUser = (Users)Session["LOGINUSER"];
       if (Session["LOGINUSER"] == null) {
// you got no logged or session expired...refirect etc.
    }  //end if
  }
}

And other step is your_page : ParentPage May be all you are asking for is == null (in c#)

please close thread if that helps.

padtes 30 Junior Poster in Training

There is some wiered solution I got in mind. See if it works.

alter table your_table add column tmpSno int identity(1,1)
Go
update your_table set ID = tmpSno 
Go
alter table your_table remove column tmpSno
Go

Get the idea, the syntax might need re-checking

Close this if it works.

padtes 30 Junior Poster in Training

it looks like you got onclick handled. This should be submitting to the same page. I was suggesting more like following:
1. Under <head> add following javascript function:

function callPage(Rowkey) {
  alert ('debug: key=' + Rowkey);
  window.location = "yourOtherPage.aspx?key=' + Rowkey;
}

2. In your current code, replace onClick part as following:

e.Item.Attributes.Add("OnClick", "javascript:callPage ('" + your_key_as_per_row + "')");

The way I have used it is in my project is one cell itself is href. You seem to be doing the whole row clickable. If your alert works, there is hope. As you would notice, "your_key_as_per_row" is your business logic, not just row number (it could be row number if logically that is sufficient).

Here is actual sample code from my project

hlnk.Attributes.Add("OnClick", "OpenWeekRpt('Reports/TestDDL.aspx?showMenu=N&periodID=" + ddlPeriod.SelectedValue
                + "&metCode=" + dr["metricsID"].ToString() + "&SRcode=" +ddlCountryRel.SelectedValue+ "')");

Here hlink is one cell.

As you would notice, there are number of things being passed in the URL (string), the URL is parameter to javascript function: OpenWeekRpt.

Hope this helps.

Traicey commented: Thanks man +2
padtes 30 Junior Poster in Training

Is there a chance of using hyper link? One or all your columns could be hyperlinks and the link itself would be something like

<a href='newWebForm.aspx?key=' <%= bind-key %>'>your column data</a>

Other is, since you are handling color change to show current selected row, you are already handling atleast one mouse event. Same way, you can handle click event in JavaScript. I guess I am missing something; don't know what.

Let us know your solution when you close the thread.

padtes 30 Junior Poster in Training

I wouldn't rely on @@rowCount. Plus, logic for user login / email looks "liberal", one can enter valid login and invalid email. My preferred logic would be:

ALTER procedure [dbo].[users_login] (@username varchar(50),@password varchar(50),
@emailid varchar(50),@ret int output)
as
begin

set @ret=0
if @emailid <> '' or @username <> ''
begin
  select @ret=1, username,password,emailid from users 
   where ( ( username=@username and @username <> '' )or 
 ( emailid= @emailid and @emailid <> '')) and [password]=@password
end

end

Please close thread once you get good enough help.

kvprajapati commented: Good suggestion. +7
padtes 30 Junior Poster in Training

I would like to see stack trace and the corresponding source code with line numbers. Make sure .PDB file is latest.

I guess it is not easy to reproduce, otherwise debugger would have helped.

padtes 30 Junior Poster in Training

There are few suggestion for the post itself. I cannot see the reason for lot of blank lines. Because of that it is very discouraging to try reading the code. User Code tags, edit queries.
Actual DB related GENERAL suggestions
1. reduce the size of your variables, though they are VARCAHR. for ex. @orderBy need not be 4000. On older version, I have seen it making a lot of difference.

2. If you notice @sql 8000 - never used (in the code given). Why declare if not used? Remove all unused variables. Reduce column lengths to meaningful lengths.

3. In joins, that I couldn't really read the queries; but the rule of thumb is start with largest (max number of records) table.

4. is there reason to use @TempReport as opposed to #TempReport ?

5. For advanced topics, study "execution plan", specially if you have 2008, it will suggest you indexes to be added.

Let us know how much this helped. Close thread if this really helps.

padtes 30 Junior Poster in Training

Check if there is divide by zero because TextBox3.Text is blank or 0.

Write you if upfront for that.

In addition, simple int might not be large enough, but that doesn't seem to be the current error.

please mark thread closed if this helps. Otherwise post your solution if any.

padtes 30 Junior Poster in Training
SELECT top 1 product

In above codes What do you mean by TOP 1 PRODUCT

The way my update query is, it uses sub query. In case of update (and Select as well), when such query is used, it must return 0 or 1 record. If the subquery returns more than 1 record then it bombs at run time. To make sure it will work irrespective of your data, I use Top 1. That way it will return no or 1 record.

padtes 30 Junior Poster in Training

Given relational database normalization, you should not do that. What you do is join Sale and Code tables in your select statement.

Select c.code, c.product from code c inner join sale s on c.code=s.code

However for some reason you do want to update the SALE table, just for sake of it here is SQL that works in MS SQL. Nothing to do with VB.net (though you can execute Non Query)

Update Sale set product=(select top 1 product from Code where code.code=sale.code)

And last, Why won't you call these tables as Product and Sales? A code table with Code column? I am sure you are just a student. No programming professsional will use this naming convention.

padtes 30 Junior Poster in Training

The above query by apegram is in general good, except for sort by cost. Typically if there was credit or discount (negative cost). Also grand total shows ugly harcoded custID.
The solution is slight modification to the same, though credit goes to apegram for writing the workable query.

select CustID, Items, Cost, ExtraCharges from (
SELECT '1' orderCol, CustID, Items, Cost, ExtraCharges FROM Sales
Union 
Select '2' orderCol, CustID, 'Subtotal' as Items, Sum(Cost) as Cost, Sum(ExtraCharges) as ExtraCharges
From Sales
Group By CustID
Union 
Select '99' orderCol, '' as CustID, 'GrandTotal' as Items, Sum(Cost) as Cost, Sum(ExtraCharges) as ExtraCharges
From Sales
) as t1
 Order By case when orderCol=99 then 1 else 0 end, CustID, orderCol, items
padtes 30 Junior Poster in Training

I assume you got a form that has City text box, say its <input ID='city' valye='' name='city' /> Now your sql need to be

sql= "select count(city) as cx from NY where CITY='" & request("city") & "'"

Please check / correct syntax. I am kind of out of touch with classic ASP. Please close thread if this helps.

padtes 30 Junior Poster in Training

In addition, as adatapost suggested above, clarify the search requirement, such as what is that the user is searching? Your database? Your site? All of net?

Of course once you try and you share your code, others can discuss further.

padtes 30 Junior Poster in Training

There are so many errors with these, that I don't know how to correct all of it. There are 9 instances, I got tired after 7 I have pointed for some help. Looks like this is your homework. I wonder if it is even Ok to help you. anyway here it is.

1. In line 86, your where condition has comma instead of And or OR
for ex. where AGE > 25, EMP_STATE=C Check your SQL book.

2. In line 91, what are you trying? WHERE EMP_CITY LIKE "E", GENDER In line 106, there is code like this

SELECT LAST_NAME, FIRST_NAME, FROM (EMPLOYEE,JOB_TITLE)GROUP BY STATE HAVING "C"));  
SELECT LAST_NAME, FIRST_NAME, FROM (EMPLOYEE,JOB_TITLE)GROUP BY EMP_EXEMPT_STATUS));

3. One error I see is , (comma) just before from. Unless you copy pasted code wrongly. Remove the comma.

4. In from part of statement, remove the brackets. (starting ine 102)
for ex. ... from (a,b) is wrong. use ... from a,b 5. Your select and group by do not match. You cannot select columns that are not grouped on.

6. state having "C" needs to have a boolean condition for ex. having count(*) > 1 7. line 20. column name Job title cannot have blank.

All the best.

padtes 30 Junior Poster in Training

Okay, I'm still having difficulties.

In the SelectedIndexChanging for my GridView, I Have the following code:

TextBox txtTemp = (TextBox)gvNum.Rows[e.NewSelectedIndex].FindControl("Num");

     string strCopyThis = txtTemp.Text.ToString();

     txtTextBoxOnForm.Text = strCopyThis ;

On the middle line, it tells me that Object reference not set to an instance of an object.

I'm not sure what I'm doing wrong. Isn't the instance created above?

You need to findControl as named, like "IDNum" and not "Num" just the way you named them. Otherwise there is no controlfound and next line you are getting null object (that is txtTemp is null so txtTemp.Text is bombing)

padtes 30 Junior Poster in Training

first doc it to say right hand side by pulling the dialog title bar (here the blue bar that says Solution Explorer), click and hold and drag to one side where there will be an arrow like image will appear once you do this. Or double click on the title bar.
After it is docked, there will minimize like little trangle, a push-pin next to it and x to close window. When the pushpin is pointing side ways, it is stuck "open", when the pin points down it is auto-hide. To toggle the the modes, click on the pin.
Please close the thread if this is what you needed.

padtes 30 Junior Poster in Training

Assuming you want order by date (SQL server 2005 or higher)

select row_number() over (order by [date]) as serNo, * from (
SELECT [date], SUM(Qty) AS Qty, FROM mytable GROUP BY [Date] ) t

For SQL 2000, stored proc with temp table with auto increment column

create table #tmp (sNo int identity(1,1), dt dateTime, qty numeric(12,2) )
insert into #tmp (dt, qty) SELECT [date], SUM(Qty) AS Qty, FROM mytable GROUP BY [Date] 
select * from #tmp 
drop table #tmp

please mark as solved if this helps. If you get other solution, post it here.

padtes 30 Junior Poster in Training

The above post is correct. I want to add when you use arraylist of objects, the public properties of the objects in that arraylist are similar to columns of your SQL queried data.

padtes 30 Junior Poster in Training

ok, as I said before, you need to see sample code I have in the prior post that handles RowEditing event of the grid where you will save the record using values read from the page that was submited by user.

Further there is .._RowCancelingEdit when user cancels edit, when all you need to do is

your_gv.EditIndex = -1;
      your_gv.ShowFooter = false;  //to hide footer template
      BindGridView();//your own method to rebind your grid as you did in the past

2 more points:
1. Binding: After save, you need to rebind anyway. Creating BindGridView() kind of method will come handy. That should take care of deleted/added records etc.
+ as above, hide footer and set editing Off (EditIndex = -1)

2. Now as far as database delete / inserts are concerned, these need to be simple SQLs you can write in C# OR pass all variabels to a stored procedure and write queries/transaction in the stored procedure. Execute that SP from ASP.net.

Trigger is recomended only if there is simple work like flagging a record or inserting audit message is required. You can insert a record into different table before the original record is deleted (that will be separate topic).

padtes 30 Junior Poster in Training

I am not sure how the whole thing is supposed to work, but it being Java, indexes are 0 relative.
try this

if (rs.last()==false){
     tabel.setValueAt(rs.getString(0), 0, 1);
} else {
     tabel.setValueAt("", 0, 1);
}

Close the thread if this helps

padtes 30 Junior Poster in Training

Depending on events (like _RowCancelingEdit or _RowEditing) you want to use true or false for ShowFooter.

gv_Money.ShowFooter = false;

Please mark as solved if this is sufficient.

padtes 30 Junior Poster in Training

From the code snippet it is not clear to me if the asp:TextBox ID="IDNum" is part of edit template or not.
Also it is not clear if your question is related to DB operation or reading data from page or both.
If it is not part of grid's edit template then values are read from for using int anID = convert.toInt32(IDNum.Text) if it is part of EditItemTemplate, you will need a command rather than a button on the form.

<asp:Button ID="btnUpdate" runat="server" CommandName="Update" Text="Update" />

Then on server site you handle RowEditing event, rather than your current button click handling.

protected void gvYourGrid_RowEditing(object sender, GridViewEditEventArgs e)
    {
        TextBox txtIDNum = (TextBox)gvYourGrid.Rows[e.NewEditIndex].FindControl("IDNum");

int anID = convert.toInt32(IDNum.Text)
//get other fields and insert/update etc.
    }

As far database delete and inserts are concerned, how is it any different than any simple insert/delete? Do you mean to create ALL columns from one table (like audit situation) to be moved to other table? In that case triggers are useful.

padtes 30 Junior Poster in Training

I am not sure how you are loading the dataset that has previously purchased products for the customer. Can you pass that customer ID as parameter and re-query that in you query and use something like ShopCartItem.ProductID not in (select ProductID from pastPurchase where custID=@custID) May be there are more paramters like promotion ID or date etc.

Other option is (a little ugly) is to use a string for whole query and not in will take whole comma seperated product ID string.
for ex.

string sql = "select ... from " 
  + " and productID not in (" + previousProdCSV + ")";

//.executeNonquery(sql)

or same can be passed as param to MS sql query and use exec(@sql) in same fashion.

padtes 30 Junior Poster in Training

try this

int returnVal = 0;
 if (rdr[0] != DBNull.Value) {
   returnVal = Convert.ToInt32(rdr[0]);
}

I wonder how VS did not give you auto suggestion for this.

padtes 30 Junior Poster in Training

I can think of a sotred proc, where you will generate a temp table of 1 column and insert 1 .. max(sno) and then delete existing.

create table #tmpNum (id int)
declare @mx int
select @mx=max(sno) from table1
while @mx >= 1
begin
  insert into #tmpNum values (@mx)
  set @mx = @mx -1
end

delete from #tmpNum where #tmpNum.id in (select sno from table1)
select id from #tmpNum order by id
drop table #tmpNum
Go

I can think of an Excel based solution, if this is one time data fixing. Get all records into excel, sort by sno. Add column in Excel with formula something like (assuming sno is in column b and data starts with row 1)
For added column C: cell c2 formula will be =(b2=b1-1) Then copy the fomula for all of C column, this will fill the column C with TRUE / FALSE.
Then filter on FALSE. These are jumped sNo.
Let us know your solution if any.
Feel free to close thread if this is sufficient.

padtes 30 Junior Poster in Training

I find http://www.fluffycat.com/ very helpful.
I hope it helps you too.

padtes 30 Junior Poster in Training

Would you rather subtract 52 weeks from your @LastBusinessDay? Because, even if today was Wed Jan 13 2010, Last year Jan 13 is Tue. select dateadd(wk, -52, getDate()) See if this is better? If it helps lets close this thread.

padtes 30 Junior Poster in Training

I would personally prefer a console application, not windows application. If you have main logic code extracted outside of form, you can easily put together a console app.

However I do expect WinForm to have .visible = False possible. Problem is on what event of the form are you expecting your code to run? May be form load?

padtes 30 Junior Poster in Training

I think above anser is missing one point:

In the period field, there is time interval for the query to run.

Assuming certain limitations, given below, other solution is to write stored procedure (as given above) and schedule it as a SQL server job.

Limitation 1: you need to know how frequently the job will execute (like every 5 min or 10 min). Though this depends on the data in the table, you can come up with a minimum, such as 5 min, keep an additional column in the table as "execute next time" and SP will look all into this column executing all queries one by one that are past, update this time for next execution

Limitation 2: update column must be same for all queries. If the result is sometimes date-time and sometimes numeric percision, say 4, then there is possiblity of mess. For ex. one query is add 3 days from today select dateadd(d, getDate(), 3) and other query is increase result by 10% select result * 1.1 from calculations .
Of course you can use varchar and converts in the queries.

Advantage: Writing SP is simple. It is already given above.

padtes 30 Junior Poster in Training

If this is stored proc, it is sure simple.

SET @returnValue = 0
    SELECT @returnValue = 1, item FROM TABLE
-- @returnValue = 1 means there were records in the table

if you want this as part of one query, I would like to know how you are using the query? For ex. in c#, or VB or ASP etc. In that case, you can look for record count returned (zero or more).
Hope this helps. If helps, close the thread. Thanks.

padtes 30 Junior Poster in Training

Database cannot really force this (nothing simple or standard way); your programming logic should take care of this by not allowing add sea not possible unless there is country, edit sea record invalid if no country relation is given by user.
As far as database is concerned, this is good.

padtes 30 Junior Poster in Training

I feel current structure is enough, if a country has no sea-border, there will be no record in SEA_BORDER for that country. As far as database is concerned your current structure is perfect.

When finding countries with/without border with sea etc, you need to write correct SQLs (selecs).

padtes 30 Junior Poster in Training

In ASP.net I know of is

lstPlace.selectedValue=yourValue;

as well as

lstPlace.selectedIndex=yourIndex;

depending upon your requirement will select a particular entry in the drop down list.
Note that C# is case sensitive and my code above might be incorrect for that reason.

As far as hashtable goes, you will need different keys, in your example you are using only "0".

You can have data sources such as datatable or arraylist or dataset. In case of arraylist, the objects in the arraylist at runtime, need the public properties named as your strings in DataTextField / DataValueField.

In case of table, the DataTextField/DataValueField column names.

Please close thread if this helps.

padtes 30 Junior Poster in Training

I don't know of printing all months in single row returned (like sale of april, may, june... for each cm.name) dynamically without stored proc.
1. Assuming you want month-year + cm.name + sum() you can group by month(sm.date), year(sm.date)
2. If there are fixed number of months (less likely), you can use subqueries for that:

select cm.name
, (select sum(sm.amount from...sm... where sm.joinCol = cm.join_col... and month(sm.date)=4) april_amt, (select sum(sm.amount from...sm... where sm.joinCol = cm.join_col...and month(sm.date)=5) may_amt 
from ...cm...
padtes 30 Junior Poster in Training

This is not to tell you how to do full-text search. You can find that on MSDN (google it). There must be step-by-step help out there.

I suggest that you need to maintain a "keywords" table and other table as where the keyword appears in the source. These tables are populated when main source is updated (use triggers if you are ok). So a search will lookup the keywords first and then the usage.

padtes 30 Junior Poster in Training
cmd.Parameters.AddWithValue(IIf(Val(Me.TxtCod) = 0, "Null", "@code", Val(Me.TxtCod)))

Note that IIF takes 3 parameters, adjust parenthesis of that.

cmd.Parameters.AddWithValue("@code", IIf(Val(Me.TxtCod) = 0, "Null", Val(Me.TxtCod)))

Please mark trhread closed if this helps.

padtes 30 Junior Poster in Training

SELECT HomePageSectionDescr,URL FROM HomePageSectionT System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

Which means your database is either not installed at all or your application is trying to connect to that database with user-code / password / server name etc, that is not as per the installed database.

See if you can connect to your database using tool like query analyzer using same connection information said above.

Contact your vendor of the software you bought, for how to configure the connection information. For connection information (like server name/login name/password) you will need help from your DBA or hosting service provider of your site.

padtes 30 Junior Poster in Training

I wrote a console app and printed the HTML output. This is 6048 number of characters, all plain HTML. So there is no problem with the method get_url.
I disagree with above (adatapost) post because you are seeing the output of "-". that leaves 2 possibilities: 1. jTextArea1 has character limit or special characters/char combination or quotesare causing trouble
2. For applet, for security reasons, URL connection to third party site is being stopped. Thouh I would expect exception in that case.

I suggest, for test sake, return a huge hard coded string from get_url and see if setText still works.
If that works, see if current get_URL works for you in console mode like I idid.
If that works, see if some local URL can be used with applet.
All the best

padtes 30 Junior Poster in Training

I am not sure if you are ok with one plain average: here is SQL for one student (paramter = @yourInput)

select avg(marks) 
from exam-class-section-subject-student 
where student_ID = @yourInput

if you wanted average for all sytudents

select student_ID, avg(marks) 
from exam-class-section-subject-student 
group by student_ID

and so on.. Of course there needs to be more than this in any real-life application, like getting student name or average by exam type, year (like 2009 / 2010 etc) and more where conditions.
I advise you refresh you SQL.

padtes 30 Junior Poster in Training

A simplistic solution, if you are not going to use contents of the Word file (such as for search) then you can ask user to upload the file(s) and provide with hyper links (href) for downloading.
You may also use other option of upload the file and use MS Word (office) component. I know this can be done, will have to google /MSDN for that.
Third option is (if content is small enough), as users to copy-paste from word into text area.
One thing for sure, you cannot read word document from your browser.
All the best. Let us know if you find a solution.

padtes 30 Junior Poster in Training

Can you also post code behind? Looks like terminal condition is not handled properly and instead of adding children to Level 3, Children are being added to root. Also I notice School level is not "Root". Level 1..3 are not children of School level (may be it is by design as per requirements).

padtes 30 Junior Poster in Training

I am assuming this is ASP.net question. I am further assuming that user enters comment and submits page. At this point, alongwith the comment, you would save time of entry.

Now there is another action (like click of button) user will perform in order to edit the comment. On click of that, on server side, you can check if it is already 30 min or less.

Same way, again on save of edited comment, you might want to check if change was submitted within 30 min from original request. You might not want to check (it depends on your requirements). For ex. if user asks edit on 28th min and doesn't submit till 32nd min. You might want to reset time stamp as well (again upto your requirements).

One can always use javascript, sending time of creation as hidden variable and start timer on load of page that will disable edit button after 30 min. The problem could be in time-zones. Like server is in California where your record added is in West-coast time. User is in New york. Half hr is already gone from your browser-to-server setting.

If this meets your requirements, glad I helped. Otherwise post what is missing (like "as admin" you mean soft coding 30min, you can use web.config or database etc)

padtes 30 Junior Poster in Training

I have a T-SQL function (transact SQL is SQL server 2005 programming language, with many limitations compared to say C# or Java). It currently works but has severe limitations.

Its input is string (formula) that has ternary operators used in it. The function converts it into CASE statement and returns it.
For ex. input: a>0?111:222 will be output as case when a>0 then 111 else 222 end The function works as long as there is no brackets nesting in various levels alongwith use of use of math binary operators. For ex. (a>0?(b>0?2:3):(c=1?(d=1?4:5)+(e=1?6:7):8)) and output expected is (with or withour brackets is Ok. Formatting /indetations optional)

case 
 when a>0 then 
  case when b>0 then 2 else 3 end
 else
  case when c=1 then
    case when d=1 then 4 else 5 end 
 + case when e=1 then 6 else 7 end 
  else
    8 end

This can get as complex as allowed.

If there are any points that will help are greatly appreciated. If there are code samples of similar problems (or URL to) is equally appreciated.

padtes 30 Junior Poster in Training

You are having

MsgBox(ssql)

Can you seen that query and run directly? Or through debugger, set a break point and get value of ssql and post it?

Do you have single quotes as part of data? Does it always fail? Id passwrd a valid table, and other 2 columns Ok?

padtes 30 Junior Poster in Training

One can always use temp variables. That will make life way easier to read and debug. For ex.

string chanName;
TextBox txtChannelName = ((TextBox)gvYourGrid.Rows[e.RowIndex].FindControl("txtEWidgetName"));
chanName = txtChannelName.Text;
...
//use chanName in your command

ALSO note that this command string is not recomended practice. Use SQL parameters. Simplest of the bugs will be when channel name contains single quote as part of name.

padtes 30 Junior Poster in Training

There are 2 things I observerd: 1. Look at the stack trace when the code bombs. There will be line number (typically I would expect row.Cells[...] to be invalid index. Since the grid view itself is not posted, I cannot see which one it is.
Second is: one should not use

((TextBox)(row.Cells[7].Controls[0])).Text

syntax, but should use

TextBox txtChannelName = ((TextBox)gvYourGrid.Rows[e.RowIndex].FindControl("txtEWidgetName"));

If you get null pointer error, check spelling of your widget: in this case -txtEWidgetName

padtes 30 Junior Poster in Training
padtes 30 Junior Poster in Training
UPDATE Table1 
SET comment = isnull((select comment FROM Table1 y WHERE y.Idx=1234 and table1.vin = y.vin),comment),
author = isnull((select author FROM Table1 y WHERE y.Idx=1234 and table1.vin = y.vin), author)
WHERE vin like '%WLS%'

Check the logic, test. Close thread if this solves it.