Is there anything that stops the DateTime AddDays() method that doesn't run within a while loop. I have this simple bit of code;
DateTime last_day = monthCalendar2.SelectionRange.End;
DateTime first_day = new DateTime(year, month, day);
//Insert dates into vector
while (first_day != last_day)
{
dates.Add(first_day);
first_day.AddDays(1);
}
I step through the program and first_day never changes, anyone know why?!
An insert statement with a large number of values returns 'Error converting data type varchar to numeric.'
How can I find which value actually triggers the error?
MS SQL Server 2008 is used.
it cause from i insert UIViewController to subview of UITabBarController.
once i want to set UIViewController shouldAutorotateToInterfaceOrientation and it not possible because it will call only in UITabBarController.
how can i forward message from UITabBarController to call shouldAutorotateToInterfaceOrientation of each UIViewController instead of call UITabBarController only?
Hi guys.
I want to update a part of a page by PPR.
This is the part of page that i want to update:
<h:panelGroup id="aggiungiAuto"
rendered="#{!autoBean.operazioneOk}">
<ui:include src="../component/aggiungi_auto.xhtml"/>
</h:panelGroup>
While this is the commandButton present in aggiungi_auto.xhtml
<p:commandButton value="Submit"
update="growl aggiungiAuto aggiungiFoto"
actionListener="#{autoBean.insert}"/>
Any Idea?
I have problem querying table with variable in IN function.
SELECT
s.date,
(SELECT
GROUP_CONCAT(value)
FROM value
WHERE id_value
IN(s.ref_values)
)
AS vals
FROM stats s
ORDER BY s.date DESC
LIMIT 1
Where s.ref_values is '12,22,54,15'. I get only one return for first number (12).
When I insert that value directly in IN(12,22,54,15) it finds all 4.
So, there must be problem with using variable in IN. What am I doing wrong?
I am experimenting with SQL Server full text search.
I have a simple Categories table with Id as the primary key:
CREATE TABLE [dbo].[Category](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CategoryName] [varchar](100) NOT NULL,
)
My Query is:
SELECT *
FROM
FREETEXTTABLE (Category, CategoryName, 'music') AS F
INNER JOIN Category C ON F.[Key] = C.Id
ORDER BY F.Rank DESC
This returns me several records with the word music in them, but it does NOT return any record with word ‘musical’.
Although, it can be said that the string being searched is not very big and using the LIKE operator will resolve it. I would like to use fulltext search because this simple example is going to be extended to include other tables and fileds.
How can i concate this string in mysql
desc=desc+$desct
what i want is each time i insert a variable from PHP that the string is added to the string which was already in db and seperated with ||
the field desc should look like this
desc
10||30||90||710
say i want to add the value 20
desc
10||30||90||710||20
then the desc field should look like this
How can i implement this?
Hi,
I'm trying to make wysiwyg editor with content editable divs and I'm inserting html with document.execCommand('insertHTML', false, html); but the problem is, when i insert link, and then i want to write after it continues to write INSIDE that link.
EXAMPLE:
how it does now:
Hello, stackoverflow.com MyTextAfterLink
how it should be:
Hello, stackoverflow.com MyTextAfterLink
How could i fix this? Thanks.
Using logparser to import IIS logs to a db results in one column that has the date value and a second field for time:
2010-05-25 00:00:00.000 2010-01-01 11:11:58.000
I'd like to code an INSERT AFTER trigger that combines the 2 fields.
0
i am get the from the web and store in the rich text field but only one line show other all data is hidden if i hard coded show the all data but when we get the data base through web show only one line.
the code reff is
private RichTextField textOutputField;
textOutputField.insert(""+GlobalDataStore.chatee+":" + bufVal+"\n");
I have a requirement to copy whatever data is getting inserted or updated to a log table to show who updated and when. I was thinking of using triggers for the same. The reason being the insert needed not be only stored procedure but can also be packages. Can I use extended events for the same ?.
I have some code that is accessing Membership.GetUser() to get the current logged in user.
This works fine until I try to access it immediately after logging in with FormsAuth.SignIn(userName, false);
However I noticed that neither Membership.GetUser() nor User.Identity.Name is updated with the newly logged in user until a new request (I assume its reading directly from the Request cookies).
This however kind of screws up my logic that accesses Membership.GetUser() becasue it introduces a special case.
Question: is there a way to read the current logged in user with ASP.NET membership immediately after logging in. Or will I have to introduce my own abstraction layer to allow me to 'set' a user as being logged in ? (This is in an AJAX request - so i'd rather not do a redirect).
Hello,
Is there any way to load an existing index into an instance of MemoryIndex?. I have an application which uses Hibernate Search so I can use index() in FullTextEntityManager instance to index an object. I'd like to recover back the created index and insert it into a MemoryIndex instance to execute several queries over it.
Is it possible?
Thanks.
Is it possible to create a table that has no 'id'? For example, this is my domain:
class SnbrActVector {
int nid
String term
double weight
static mapping = {
version false
id generator: 'identity'
}
static constraints = {
}
}
When I run this SQL statement, it fails:
insert into snbr_act_vector values (5, 'term', 0.5)
I checked the table and 'id' is already set to autoincrement. I'm thinking that another option is to remove the 'id' itself. Or is there another workaround for this? Please assume that it is not an option to change the givent SQL statement.
Hi. Sorry about the vocabulary question but I can't find this anywhere: how do you call this below?
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MyAssembly")]
Is it a statement, a directive, ... ? I want to indicate that you have to insert that line in order to give MyAssembly access to your assembly's internal members, but I'd like to use a more specific term than "line".
Thanks!
How do I insert a subscript charachter in a string in C#? I have nor problems appending a superscript 2 in the same string using char.ConvertFromUtf32(178);, but I struggle with finding a similar solution for the subscripted text. Actually, I'm struggling with finding ANY solution at all to this rather embarrassing issue. :)
What would be appropriate scenario when stored procedures should be used?
I stumbled upon implementation where almost whole data manipulation was handled by store procedures, even simplest form of INSERT/DELETE statements were wrapped and used via SP's.
So, what's the rationale for using stored procedures in general?
Sorry for such a beginners question..
I want to run a javascript snippet inside the <head> tag. Is that possible to do that in Selenium RC+Java?
I understood that if I use getEval or runScript that will insert the code inside the HTML body.
Any Ideas?
Thanks
Lets suppose that $(document).height() is 1000. Then i insert a new div at the bottom of the page with height=100. The $(document).height() should be 1100 but it keeps throwing 1000 to me.
How can i get the new $(document).height() dynamically?
Thank!
Here's the scenario:
I have 2 tables:
CREATE TABLE dbo.API_User
(
id int NOT NULL,
name nvarchar(255) NOT NULL,
authorization_key varchar(255) NOT NULL,
is_active bit NOT NULL
) ON [PRIMARY]
CREATE TABLE dbo.Single_Sign_On_User
(
id int NOT NULL IDENTITY (1, 1),
API_User_id int NOT NULL,
external_id varchar(255) NOT NULL,
user_id int NULL
) ON [PRIMARY]
What I am trying to return is the following:
is_active for a given authorization_key
The Single_Sign_On_User.id that matches the external_id/API_User_id pair if it exists or NULL if there is no such pair
When I try this query:
SELECT Single_Sign_On_User.id, API_User.is_active
FROM API_User LEFT OUTER JOIN
Single_Sign_On_User ON Single_Sign_On_User.API_User_id = API_User.id
WHERE
Single_Sign_On_User.external_id = 'test_ext_id' AND
API_User.authorization_key = 'test'
where the "test" API_User record exists but the "test_ext_id" record does not, and with no other values in either table, I get no records returned.
When I use:
SELECT Single_Sign_On_User.id, API_User.is_active
FROM API_User LEFT OUTER JOIN
Single_Sign_On_User ON Single_Sign_On_User.API_User_id = API_User.id
WHERE
API_User.authorization_key = 'test'
I get the results I expect (NULL, 1), but that query doesn't allow me to find the "test_ext_id" record if it exists but would give me all records associated with the "test" API_User record.
How can I get the results I am after?
My situation is explained in the code below.
I need to send via a socket NSString drawn from a TextBox
Thank you very much
NSString *string = fieldTesto.txt;
// I Find an istruction for insert s string in to the CFSocketSend
UInt8 message[] = "Hello world";
CFDataRef data =
CFDataCreate(NULL, message, sizeof(message));
CFSocketSendData(s, NULL, data, 0);
CFRelease(data);
i have a collection in the mapping:
<bag name="Values" cascade="all-delete-orphan" lazy="false" inverse="true">
<key column="[TemplateId]"/>
<one-to-many class="MyNamespace.Value, MyLib"/>
</bag>
the Value object has a foreign key [TemplateId]. both entities has their generator set to "identity".
when i call session.Save() for the parent Template object, the Value objects has their [TemplateId] (the foreign key) set to zero, so an SQL exception appears.
how do i forse nhibernate to set the FK value for the child items to the value of the inserted parent object?