I think I encountered something extraordinary strange in VS 2008.
All the array values are 0x00, but why it is displayed 0x00000008 at the start of the variable?
This is my second post. After learning from my first post how fantastic is to use Linq to SQL, I wanted to try to import data from a Excel sheet into my SQL database.
First My Excel Sheet:
it contains 4 columns namely
ItemNo
ItemSize
ItemPrice
UnitsSold
I have a created a database table with the following fields
table name ProductsSold
Id int not null identity --with auto increment set to true
ItemNo VarChar(10) not null
ItemSize VarChar(4) not null
ItemPrice Decimal(18,2) not null
UnitsSold int not null
Now I created a dal.dbml file based on my database and I am trying to import the data from excel sheet to db table using the code below.
Everything is happening on click of a button.
private const string forecast_query = "SELECT ItemNo, ItemSize, ItemPrice, UnitsSold FROM [Sheet1$]";
protected void btnUpload_Click(object sender, EventArgs e)
{
var importer = new LinqSqlModelImporter();
if (fileUpload.HasFile)
{
var uploadFile = new UploadFile(fileUpload.FileName);
try
{
fileUpload.SaveAs(uploadFile.SavePath);
if(File.Exists(uploadFile.SavePath))
{
importer.SourceConnectionString = uploadFile.GetOleDbConnectionString();
importer.Import(forecast_query);
gvDisplay.DataBind();
pnDisplay.Visible = true;
}
}
catch (Exception ex)
{
Response.Write(ex.Source.ToString());
lblInfo.Text = ex.Message;
}
finally
{
uploadFile.DeleteFileNoException();
}
}
}
// Now here is the code for LinqSqlModelImporter
public class LinqSqlModelImporter : SqlImporter
{
public override void Import(string query)
{
// importing data using oledb command and inserting into db using LINQ to SQL
using (var context = new WSDALDataContext())
{
using (var myConnection = new OleDbConnection(base.SourceConnectionString))
using (var myCommand = new OleDbCommand(query, myConnection))
{
myConnection.Open();
var myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
context.ProductsSolds.InsertOnSubmit(new ProductsSold()
{
ItemNo = myReader.GetString(0),
ItemSize = myReader.GetString(1),
ItemPrice = myReader.GetDecimal(2),
UnitsSold = myReader.GetInt32(3)
});
}
}
context.SubmitChanges();
}
}
}
can someone please tell me where am I making the error or if I am missing something, but this is driving me nuts.
When I debugged I am getting this error
when casting from a number the value must be a number less than infinity
I really appreciate it
I have two textbox .... textbox1 and textbox2
textbox1 == choose from date
textbox2 == choose to date
if user select from date in textbox1 as 01-May-2011 and in textbox2 as 30-May-2011
then all the dates from 01-MAy-2011 to 30-May-2011 will be inserted in each row of mssql2005 datatable...
example. . :
IN database Table1 structure ...
ID Date
1 01-MAy-2011
2 02-MAy-2011
3 03-MAy-2011
4 04-MAy-2011
5 05-MAy-2011
and so on till 30-May-2011
We have a website that is created in VS2005
Recently we upgraded the website to VS2008 with 2.0 framework.
While compiling the website Compilation errors are occuring i.e Licenses.licx file is not compiling, if it compile than it will reproduces an AppLicenses.dll.
In the licensing.licx file containing one class and a namespace(i.e. OSADirectLicensing.OSADirectLicensedClass, OSADirectLicensing).
The compilation error is as follows:
Error 1 C:\Program Files\Sharp\Sharp Developer Tools\OSA SDK\Samples\DirectOSA\ExternalAuthority\licenses.licx: Could not transform licenses file into a binary resource. (1) : error LC0004 : Exception occurred creating type 'OSADirectLicensing.OSADirectLicensedClass, OSADirectLicensing, Version=1.0.4006.31768, Culture=neutral, PublicKeyToken=null System.ComponentModel.LicenseException: Invalid License
at System.ComponentModel.LicenseManager.CreateWithContext(Type type, LicenseContext creationContext, Object[] args)
at System.ComponentModel.LicenseManager.CreateWithContext(Type type, LicenseContext creationContext)
at System.Tools.LicenseCompiler.GenerateLicenses(String fileContents, String targetPE, ITypeResolutionService resolver, DesigntimeLicenseContext ctx)' .
Does VS2008 support licenses.licx or not?
We should not remove this file from website.
How can we solve this issue?
I have a solution which I developed in VS2008 and which I am trying to add to Source Control (TFS 2010, though the issue happened in TFS 2008 as well). I have several TFS workspaces on my computer and I have access to several Team Projects.
When I right click the solution in my Solution Explorer and choose the "Add Solution to Source Control" option I am never given an option of choosing which Workspace or which Team Project to add the existing solution too. VS2008 then proceeds to add it to the same team project every time. I have tried selecting an alternate workspace/team project in every window where I can see an option for it but it always adds it back to the same one. I even tried changing the name of my new workspace so that alphabetically it was the first thinking that it might be somehow related to that... no luck.
I then tried goign to the Change Source Control window where you can add/remove bindings on a solution/project but that window also defaults to the same Team Project as trying to add the solution directly does...
Any help would be greatly appreciated with this, maybe I'm just missing something?
Working on moving some C++ code from Linux over to Windows. The code uses boost 1.4.2, however it keeps failing out on building the boost modules. Basically, every boost hpp file that happens to contain "namespace boost" errors with:
error C2143: syntax error : missing ';' before 'namespace'
Any idea what could be causing this?
I've got a CLI code wrapping a C++ DLL.
When i try to compile it in debug mode, i get the following error:
Error 22 error LNK2022: metadata operation failed (8013118D) :
Inconsistent layout information induplicated types .... MSVCMRTD.lib (locale0_implib.obj)
The weird thing is that on Release mode it compiles OK and works OK.
The only difference i can see that causes the problem is when i change:
Configuration Properties - C/C++ - Code Generation - Runtime Library
When it's set to: Multi-threaded Debug DLL (/MDd) it throws the error.
When it's set to: Multi-threaded DLL (/MD) it compiles fine.
The same settings work for all the other DLLs in the project (CLI and C++) and they inherit the same properties.
I'm using VS2010.
So, how can i solve this ?
And can I get some explanation to WHY this is happening ?
Update:
I've basically tried changing every option in the project's properties with no luck.
I've read somewhere that this might be caused from duplicate declarations of a type of the same name.
But in the CLI file i'm calling std::string etc. explicitly from std.
Any other ideas ?
Hi,
We are using an extractor application that will export data from the database to csv files. Based on some condition variable it extracts data from different tables, and for some conditions we have to use UNION ALL as the data has to be extracted from more than one table. So to satisfy the UNION ALL condition we are using nulls to match the number of columns.
Right now all the queries in the system are pre-built based on the condition variable. The problem is whenever there is change in the table projection (i.e new column added, existing column modified, column dropped) we have to manually change the code in the application.
Can you please give some suggestions how to extract the column names dynamically so that any changes in the table structure do not require change in the code?
My concern is the condition that decides which table to query. The variable condition is
like
if the condition is A, then load from TableX
if the condition is B then load from TableA and TableY.
We must know from which table we need to get data. Once we know the table it is straightforward to query the column names from the data dictionary. But there is one more condition, which is that some columns need to be excluded, and these columns are different for each table.
I am trying to solve the problem only for dynamically generating the list columns. But my manager told me to make solution on the conceptual level rather than just fixing. This is a very big system with providers and consumers constantly loading and consuming data. So he wanted solution that can be general.
So what is the best way for storing condition, tablename, excluded columns? One way is storing in database. Are there any other ways? If yes what is the best? As I have to give at least a couple of ideas before finalizing.
Thanks,
I have problem with displaying Cam on QTLabel using openCV,
Every thing is working fine . except one . I have to call function from open === cvNamedWindow() == in order for program to work properly . its displaying the webcam on the QLabel no problem but if i don't call the cvNamedWindow function then the program is just hanging its just keep displaying the camera which are working on the screen but i can't click on any thing else its getting freeze.
doest any one has any idea why its happening and what i am doing wrong ?
When I build a unit test project before the tests are executed the test output is copied to a TestResults folder and then the tests are executed. The issue I'm having is that not all the files in the Debug/bin directory are copied to the TestResults project.
How can I get a file that is copied to the Debug/bin directory to also be copied to the TestResults folder?
EDIT: Here is a link to a similar question on another site (no answer there though), http://www.eggheadcafe.com/software/aspnet/29316967/files-and-unit-testing-wi.aspx
I am just getting started in ASP.NET and have some existing projects to maintain.
I have read that ASP.NET projects include a folder called app_data, a code behind DLL, .sln project files, .proj files etc
Which of these files are necessary for the continued development of a ASP.NET website?
Also, are there others which are key to building ASP.NET applications?
Hi,
I need to convert char to hex values. Refer to the Ascii table but I have a few examples listed below:
char 1 = 31
2 = 32
3 = 33
4 = 34
5 = 35
A = 41
a = 61 etc
Therefore string str = "12345";
Need to get the converted str = "3132333435"
I am trying to debug a program that unexpectedly shuts down. When I say "shuts down, I mean one moment I am seeing all the windows being displayed, each of which is showing all the right data,then suddenly all the windows disappear. The is no messagebox reporting anything wrong. So I tried running the program in the debugger hoping that it would somehow trap whatever was causing the program to abort, but even within the debugger the program simply ends abruptly. The last line in the debugger is:
The program '[5500] test.exe: Native' has exited with code 0 (0x0).
My program which is extremely large and extremely old has a lot of self diagnostics. My suspicion is that perhaps a self test has failed and maybe I just called "exit()", forgetting to pop up a dialog explaining why.
My question now is, how can I find out from which point in the code, my program quit?
We have a certain application installed on a single machine. I would like to enable/disable a button based on the existence of this application. Is there a way to check for its existence from asp.net?
the app is currently on an XP machine, but want to code for Win7 as well. VS2008 3.51. Asp.net
Hello everyone,
I am building a Httphandler following these instructions here
It manipulates HTTP POST and HTTP GET. I have a client with two buttons two POST and GET.
After i've tested and happy everythings working I move it from localhost to IIS. Now when I do this I get an exception in the POST handler code.
How on earth can I debug this code line by line? I managed to do this awhile ago, I thought it was by attaching to process but I can't work it out. I can emulate GET just by typing address in browser, post im not sure about. I've tried telnetting and sending it from there but haven't had any luck.
I'm working on an app for a mobile device and would like to make a datagrid scrollbar button larger to enhance the touch screen usability. I do not want to alter the system settings windows display properties as this will affect the device as a whole.
Is there an easy way to alter the width of the scrollbar on a datagrid view?
I need to create a pdf file dynamically in vb.net. It needs to contain several images and lines of text.
I am using VS 2003, so whatever solution I use will need to be compatible with the .net 1.1 framework.
The current method I am using is wpcubed, but this requires that all images be converted to bmp format before adding them to the pdf, which can be extremely slow when dealing with a large number of images.
I am aware that there are an awful lot of other 3rd party products that claim to do this, and I have had a search through them. But without registering, downloading, installing and writing code to use each of them in turn, it is very difficult to differentiate between them. So far I have looked into evo pdf and pdfsharp but neither seem to work with .net 1.1. (Although they don't make this abundantly clear.)
Has anyone else found a method that works and they would recommend (a free one-if possible)?
I'm having a problem, I have two different AxShockwaveFlash objects that normally communicate together in a web browser, in my VB 2010 project they don't seem to be able to talk to each other. Does anyone know how to solve this?
I'm drawing a circle in C# and i have divided it into some parts,i want to fill different parts with different colors,is there anyway to do this? and how?i tried using fillpie() but i couldn't get the arguments to work.
I can not find any help on this issue in vs2008 help, Google, or SO.
Scenario:
I'm looking at a source file in vs2008 SP1; Windows 2003 Server SP2 Standard Edition, 1280x1024.
The irrelevant name of this file is index.aspx.
What is relevant is that the file has only 65 lines of code.
The print is unreadably small--less than 4 point. It uses
less than a third of the vs2008 text window vertically and
less that a quarter of the vs2008 text window horizontally.
It's not just index.aspx; e.g. another file with 142 lines
only fills about 3/4 of the vs2008 text window vertically
and less that a quarter of the vs2008 text window horizontally.
Possible cause:
Probably, but not certainly, I found the equivalent of
zoom in/zoom out such as one finds in products like
Microsoft Word.
However, I've explored many vs2008 toolbars and other
customization options and unfortunately I can not find
out how to get myself out of this mess.
Window, Reset Window Layout has no effect on the text size;
my tiny text size did not change.
QUESTION: how do I zoom vs2008 text size in and out and back to normal size?
Thank you.
Regards ~~ Gerry (Lowry)