Click here to Skip to main content
14,667,656 members

Comments by NightWizzard (Top 65 by date)

NightWizzard 18-Dec-17 12:48pm View
   
As your profile shows, you never gave any helpful answer here nore published any kind of tip or solution to others. But you downvote a solution you don't understand and acting up like a teacher. Don't you have better things to do than getting on my nerves on a question that is 8 month old and nobody had a problem with the solutions until you came along. Go and annoy someone else!
NightWizzard 18-Dec-17 7:11am View
   
If you don't understand what SQL is, you shouldn't post such comments. Entity Framework can be used with pure SQL - even if you're not able to translate the article to this question I don't know, why you associate it with IEnumerable?!
NightWizzard 8-May-17 13:10pm View
   
A simple reason could be, that - when running as admin - the system will use the directory structure of the admin user (c:\users\...) which is not the same as the user you used to login into Windows. Maybe the application or its dependencies and config files are installed in the normal user's structure and doesn't exists/can't be accessed within the admin structure...?
NightWizzard 29-Apr-17 4:24am View
   
Thanks Richard - you're right. I confused this with old VB6/VBA - maybe I'm doing this job too much years. For Michel here the link to the .NET datatype summarize:
https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx
NightWizzard 29-Apr-17 3:39am View
   
Well, I don't know how you came to a total length of 813? If you calculate the byte count in memory, an Integer will take 2 bytes and each double 8 bytes. In your example above this will give a total of 829 bytes in memory: 640 for 80 doubles, 2 for the int and for each string it's length plus 10 bytes overhead. If you're writing a binary file, the record length should be 829. If you're writig a text file, the numeric parameters have to be converted to string - in this case the string length for each numerical value can differ. For example: setting the Integer to 1000 still needs 2 bytes in memory for the Integer but the string will have a length of 4 plus the 10 bytes overhead = 14!!
In VB.NET you also can try to use either the length property:
size = Aliment.Length
or this method:
Marshal.SizeOf(Aliment)
Hope this will help you to solve the problem - good luck!
NightWizzard 26-Apr-17 13:50pm View
   
You'll get a lot of samples how to solve this problem if you google for
sharepoint upload 2Mb

e.g.:
Upload large files sample add-in for SharePoint
NightWizzard 26-Apr-17 13:32pm View
   
I'm glad you've found the answer to solve this problem. Yes, depending on the way the database layer is designed, it may cause those deadlocks. Maybe you should change from SQL Client library to Entity Framework Code First? It's simple to integrate and handles connections automatically. With option
MultipleActiveResultSets=True
within the connection string you may have simultaneous access for multiple concurrent users.
NightWizzard 25-Apr-17 13:23pm View
   
There are several conditions where your code may fail with the mentioned error - e.g. the last char in a token is a & or a =. You should check that each token has a minimum length of 3 and position of the = is not in first or last position before parsing it.
NightWizzard 24-Apr-17 13:28pm View
   
If you bind a grid to a database table (or query result) you can't insert rows directly to the grid - do the neccessary operations direczly at the database table and the grid will update automatically.
NightWizzard 24-Apr-17 13:22pm View
   
Normally a binding doesn't need to be re-binded or refreshed - that's the cause of a binding. After INSERT operation the bound control should update automatically. If not, check the criteria of the SELECT command - maybe you newly inserted data simply doesn't match...?
NightWizzard 24-Apr-17 13:10pm View
   
OK, so it's seems to be clear that there is a deadlock situation if 2 users login at the same time because of the SQL transactions that are started then. As you can read at Microsoft's website, there is no way to avoid deadlocks completely but you can reduce the risk for that by some tipps you can find here:
https://subhrosaha.wordpress.com/2010/06/02/sql-server-avoiding-deadlocks/
or here:
http://stackoverflow.com/questions/40585374/preventing-deadlocks-in-sql-server

There are a lot more matches if you google for
t-sql avoid prevent deadlock
Hope you'll find a solution for your problem - good luck again!
NightWizzard 18-Apr-17 10:02am View
   
Yes, look at your code: you assign the resut of a LINQ query to t (which contains of 2 fields: ID and Firstname). This NOT(!) a string but you handle it as a string the way you assign it to the Viewbag and how passing it to the editor. To show the Firstname, you should pass only that part of the LINQ result to the viewbag.
NightWizzard 18-Apr-17 4:54am View
   
That error usually appears when you forgot the parenthesis behind a method e.g.:
object.toString
instead of
object.toString()
Check if you're using correct C# syntax and maybe have a look at the examples here:
http://www.tutorialsteacher.com/mvc/htmlhelper-editor-editorfor
NightWizzard 14-Apr-17 10:00am View
   
You have to put the header names the same way you put the data into the cells. Have a closer look to your nested loops and try to imagine, which cells are affected in each step - there's the error! If you use my example with the Range object, you may recognize, what is wrong with your code.
NightWizzard 14-Apr-17 9:34am View
   
Looks as if you are mixing parts of code from different examples or why you declare

MSProject.Project proj = projApp.ActiveProject;

first and later

currProject = MSProjectApp.ActiveProject;

this doesn't make sense because MSProjectApp isn't declared/initialized anywhere while the active project is derived twice from different sources. Think you should have a deeper look at object handling before programming this task.
NightWizzard 14-Apr-17 5:41am View
   
If you try to replace the column headers A, B, C,....(and so forth): you can't. Put your headers in the first row (A1, B1...) and put your data in the following rows.
NightWizzard 14-Apr-17 3:50am View
   
I can't see any line of code where MSProjectApp is either assigned to a running instance of MS Project or launched by creating a new instance....??
NightWizzard 13-Apr-17 17:44pm View
   
I'm glad I could help ;-)
NightWizzard 3-Apr-17 13:02pm View
   
Maybe the Windows account, you Webservice is running in has no permission to access the DLL?
NightWizzard 20-Mar-17 8:20am View
   
OK, I didn't assume that the occuring values may lead to same results from differing values. In this case you have to use any other numeric trick that leads to identically results where the order of the values in col1 and col2 does no matter. You may use a calculated column that concatenates the 2 values into a varchar, beginning with the lower value, convert the resulting string back to int as the result. In this case, the value order does no matter and you have a unique value for each combination that can be used for a DISTINCT query. Example for the formula of the calculated column:
CAST(CASE WHEN (col1 < col2) THEN CAST(col1 AS varchar)) + CAST(col2 AS varchar)) ELSE CAST(col2 AS varchar)) + CAST(col1 AS varchar)) AS int
NightWizzard 1-Mar-17 13:44pm View
   
Maybe one of your parameter values contains a comma and the resulting SQL will lead to something that looks like an additional parameter? In this case ensure, that decimal points in numerical parameters are represented by a point instead of comma.
NightWizzard 20-Feb-17 17:06pm View
   
Think I understand your problem now. In this case and because you can't put the min and max aggregates into a single SELECT statement I would use a stored procedure (or table function) that exepcts the table name and the name of the column containing the age as parameters and uses sp_executesql function to create a dynamic sql statement as shown in my solution above to return the required data. Here you can find all informations how to use sp_executesql: https://msdn.microsoft.com/de-de/library/ms188001.aspx
NightWizzard 19-Feb-17 11:40am View
   
Sorry, but from your improvement I can't understand from which tables you want to read, what age columns they contain and how the listview event will be provided with the data.
NightWizzard 19-Feb-17 10:05am View
   
I don't know your datamodel, so it's difficult to push you to the right direction. If that means, that you have to gather the min and max age from more than one table you might make use of the UNION statement to concatenate the table sources. If it means that you have to get the min max ages for changing tables from their individually related tables you should create the SQL commands dynamically with the use of variables. Hope that helps...? Otherwise it would be a good idea to improve your question with a description of all tables you want to access.
NightWizzard 19-Feb-17 9:30am View
   
Time is a part of a datetime that you have to extract. Sorry, but if you are not able to adapt the samples, you shouldn't deal with programming. I won't do the job for you.
NightWizzard 19-Feb-17 7:58am View
   
The samples demonstrate how to access all single parts (incl. hours, minutes and seconds) from the datetime string. Simply extract the ones you're needing.
NightWizzard 16-Feb-17 13:28pm View
   
Looks as if you tried to access Outlook (which is COM = unmanged code) from managed code without the use of an interop...?
NightWizzard 14-Feb-17 8:24am View
   
Oops...you're right! Typed it quick and dirty :O)
NightWizzard 23-Jan-17 13:33pm View
   
Although all subqueries will return at least 1 record if executed separately there might no be a record that fullfills the main where clause in conjunction with all 3 subqueries. Did you check your data for this?
BTW: if you replace SELECT * with SELECT 1 in your subqueries your query will need less memory to execute and it will produce the same result.
NightWizzard 21-Jan-17 12:21pm View
   
You won't learn anything if someone else does your job. Look here for more about UNION: https://msdn.microsoft.com/de-de/library/ms180026.aspx
NightWizzard 17-Jan-17 14:20pm View
   
Sorry, the link didn't work - here again the details for DATEPART:
https://msdn.microsoft.com/de-de/library/ms174420.aspx
NightWizzard 6-Jan-17 13:58pm View
   
Did you allow mailing with SP_CONFIGURE and GRANTed user TESTPROFILE to send mails?
NightWizzard 6-Jan-17 12:44pm View
   
Think there may be some bottlenecks. First of all: did you take in account that all of your concurrent requests are using the same network/internet connection that have to transport all the incoming answers? There may be package collisions at Ethernet protcol level which leads to package lost and therfore to timeouts. Second: internet connections and answer times depend on several conditions (how busy is the server you're sending a request to, how stable is the current connection route that will include some other servers that may be busy and how fast is your own current internet connection). This all may lead into a timeout for any single server connection you established. The Ping uses a different protocol layer and may return immediately while the SQL request will take more time.
NightWizzard 6-Jan-17 12:18pm View
   
Maybe the problem isn't the data type but invalid or empty values within your import data?
NightWizzard 10-Mar-16 13:24pm View
   
Did you try a simple
$name = $_POST['name'];
var_dump will display a structure and can't be used to assign it's output to a variable.
NightWizzard 21-Feb-16 7:17am View
   
You call the PHP script via AJAX PUT or GET method - google for examples, there are a lot showing how to do this. One example will be found here: https://www.quora.com/How-do-I-get-variables-from-PHP-through-AJAX
NightWizzard 16-Feb-16 13:27pm View
   
An Outlook Addin will be loaded and will run within the session of a runnning Outlook instance. It needs to be installed as Addin and you can't start it from another application without Outlook.
NightWizzard 10-Feb-16 13:53pm View
   
Please have a look here:
https://msdn.microsoft.com/de-de/library/9k985bc9%28v=vs.110%29.aspx
Actually you can turn on and off each method like (pause, continue, etc.) via class properties instead of removing the interfaces from code. All about creating services can be found at:
https://msdn.microsoft.com/de-de/library/zt39148a%28v=vs.110%29.aspx
NightWizzard 10-Feb-16 2:06am View
   
It has nothing to do with the CSV file - you have to convert each array member of $emapData separately instead of passing the whole array at once.
NightWizzard 10-Feb-16 2:04am View
   
There is no option to grey out the dropdown - you have to remove or disable each method separetely - look at the class that represents the service interface. The VS template provides empty procedures for each of the 4 methods.
NightWizzard 9-Feb-16 13:30pm View
   
I think the line
$emapData = mb_convert_encoding($emapData, "EUC-JP", "auto");
is the problem. You pass $emapData as the first parameter which is an array, but the function expects a single string as first parameter! So the result will be undefined and can't be filled into the SQL query string.
NightWizzard 9-Feb-16 13:19pm View
   
Each windows service have to implement a standard interface with the default methods (Visual Studio provides a template - have a look there). If you don't want to provide a certain method, you can either remove it there or don't enter code to these procedures.
NightWizzard 7-Feb-16 6:17am View
   
See microsoft documentation for T-SQL, for example:
https://technet.microsoft.com/en-us/library/aa214485%28v=sql.80%29.aspx
or the codeprojecr article:
http://www.codeproject.com/Articles/167399/Using-Table-Valued-Functions-in-SQL-Server
NightWizzard 7-Feb-16 6:09am View
   
Error 400 tells you, that your request doesn't match the expected format. Without knowing the interface specification nobody can tell you what's wrong with your code. Use WDSL call to enlist the webservice interface and check if you have provided the correct parameters for the called function and that it really expects data in json format.
NightWizzard 6-Feb-16 10:29am View
   
How should anybody answer your question without knowing which database you're using?
NightWizzard 4-Feb-16 14:14pm View
   
I guess the simple reason is, that you assigned the Button2_Click procedure tho the button click event without any parameters but the procedure itself expects sender and EventArgs objects (like a desktop application) which are not passed to it. Remove the parameters from your CS procedure and it will work.
NightWizzard 4-Feb-16 14:06pm View
   
The column names you use when reading contents to the textboxes doesn't match with the column names of the table. Change UpStreamLevel to UpLevel and TotalDischarge to Discharge and it should work.
NightWizzard 4-Feb-16 13:55pm View
   
I agree with CHill60: can't find any code where datFile array is changed. Calling the method SaveDat would fetch the changed lines from datagridview, concatenate them to a string and write this content to a file - but it's called nowhere..??
NightWizzard 2-Feb-16 13:37pm View
   
Think you'll need a dBase library to do that - but I'm afraid you won't find any that can be used with today's technologies. It's too old and no longer supported.
NightWizzard 2-Feb-16 13:34pm View
   
You can do a reverse loop through all directories and their files using the file system objects and read the content of each file into a string variable in one step (read all bytes). Then use the IndexOf method to check for the searched string.
NightWizzard 2-Feb-16 2:32am View
   
The macro recorder is already part of each ms office program and produces exactly the code sample you need. Have a look to the available menus.
NightWizzard 2-Feb-16 2:10am View
   
You can use the macro recorder while doing it manually to see, how Microsoft would solve the problem :-)
NightWizzard 2-Feb-16 2:10am View
   
You can use the macro recorder while doing it manually to see, how Microsoft would nsolve the problem :-)
NightWizzard 1-Feb-16 16:26pm View
   
Sorry, no more suggestions except to read the documentation carefully as recommended within the error message (http://go.microsoft.com/fwlink/?LinkId=65455).
NightWizzard 30-Jan-16 11:26am View
   
Not a webpage but a webservice. If you want the UWP app to be used from anywhere, this is neccessary and PHP would be more simple and quicker, but if your UWP is for personal/local use only, it would be more simple to use the VS webservice and IIS than to install PHP and get it running.
NightWizzard 30-Jan-16 11:04am View
   
Now you're mentioned it...right: VS doesn't provide db libraries for UWP. So there's only one way left: you have to create a web service to access the database. You may create one with VS (it provides solution templates for this) or you can do it with PHP very simply.
NightWizzard 30-Jan-16 10:22am View
   
Hope the solution below helps. Otherwise it would be difficult to help you if you even don't know what you're doing and what library you're using. Maybe best idea is to use the server dialog of Visual Studio to create the connection.
NightWizzard 30-Jan-16 9:56am View
   
To get an answer you have to be more specific. Please explain what exactly your problem is: do you get any error or don't you know how to connect from UWP? Where is your SQL server located: somewhere in the web or local host? Which library do you use: ADO.NET, Entity Framework, Linq?
NightWizzard 28-Jan-16 3:13am View
   
Same way as before - print command is sent by code. The only difference is that the IE window is at a location outside the screen's display area (and therefore invisible to the user).
NightWizzard 27-Jan-16 13:17pm View
   
Maybe localhost is the problem? I would prefer to set the corect url of the server where the service is executed and the schema is located.
NightWizzard 27-Jan-16 13:10pm View
   
No idea why IE is shown only for non-admins but how about moving the IE window out of the display area of the screen instead of setting visible property to false?
NightWizzard 27-Jan-16 13:03pm View
   
Sorry, I don't understand what your problem is or what you want to do...?? And why you first add results to a combo and then from combo to Richtextbox? Why don't put the results directly to the Richtextbox?
NightWizzard 26-Jan-16 16:03pm View
   
Yeah, seems to be a bit uncomfortable on first sight, but works fine. You can access nearly all informations about mails and other items, that aren't provided by high-level API. I started with an Outlook addin some years ago and made use of PA's for several infos like SMTP formated addresses of all mail recipients and so on. MS API's sometimes appear worse but wait until you face API's of other software (e.g. Tobit) and you'll praise it! :-)
NightWizzard 25-Jan-16 15:42pm View
   
Thanks Sergey, you're right and that's what I meant but couldn't find the right word that moment.
NightWizzard 25-Jan-16 14:01pm View
   
look here: http://stackoverflow.com/questions/13802587/how-convert-string-hhmmss-181902-to-javascript-date-object