|
It says "Visual studio.NET cannot create or open the application. The likeliest problem is that required components are not installed on the local Web server. Run Visual Studio.NET setup and add the Web Development component". I have IIS installed and localhost is working fine.
please help
|
|
|
|
|
Your question belongs in the ASP.NET forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
from MSDN:
A ListItem control represents an individual data item within a data-bound list control, such as a ListBox or a RadioButtonList control.
There are several ways to specify the text displayed for an item in the list control.
The most common method is by placing text in the inner HTML content. The inner HTML content is the text between the opening and closing tags of the ListItem control.
You can also use the Text property to specify the text displayed in the list control for the item.
The Value property allows you to associate a value with the item in the list control, in addition to the text displayed in the control.
For example, you can display text for an item in the list control,
such as "Item 1", and use the Value property to specify a value for that item,
such as "$1.99".
Which applies to the webforms control.
For the windows forms listbox, you can add any object to its 'Items' collection. The text in the listbox is by default the result of the ToString() method for the added object (which could also have any other public properties such as your index). You can also specify the source of the test in the DisplayMember propery of the ListBox itself (the name of the public string property of your list objects that should be displayed as the text). The ComboBox control works similarly, since it also derives from ListControl.
Why would anyone waste time arguing with an accountant about anything? Their sole function is to record what happenned, and any higher aspirations are mere delusions of grandeur. On the ladder of productive contributions they are the little rubber pads at the bottom that keep the thing from sliding out from under you. - Roger Wright
|
|
|
|
|
Here is what I am trying to do. I have a DataSet that is displayed in a DataGrid. I would like the user to be able to highlight a row and then press the delete button above it, and have the highlighted row be deleted.
I have somewhat accomplished this. My current method is to search the DataGrid for the selected rows and store their index number. Then delete the rows with the corresponding index in the DataSet. This works great as long as the DataSet was not sorted at all while in the DataGrid. If the data was sorted then the index's of the DataGrid are still in ascending order (i.e. 0 for the top row, 1, ...), but the index's of the DataSet are in the order that the row was added. Thus, I delete the wrong row.
The code that I have is below, any help is appreciated.
ArrayList rowsToRemove = new ArrayList();<br />
for(int i = 0; i < myDataSet.Tables[myTableName].Rows.Count; i++)<br />
{<br />
if(myDataGrid.IsSelected(i))<br />
{<br />
rowsToRemove.Add(i);<br />
}<br />
}<br />
int count = 0;<br />
foreach (object j in rowsToRemove)<br />
{<br />
myDataSet.Tables[myTableName].rowsToRemove[(int)j - count].Delete();<br />
count ++;<br />
}
|
|
|
|
|
Why can't you just use the dataAdapter's update method?
|
|
|
|
|
You should use the DataGrid.BindingContext to get a CurrencyManager , which is always the view of the bound DataTable . That means if you sort it, the CurrencyManager will enumerate the rows in the sorted order.
This has been discussed before and I've posted an example several times. Please click "Search comments" above this message board and search for "CurrencyManager". You can also view the documentation for the CurrencyManager example in the .NET Framework SDK, which is installed by default with VS.NET, available as a separate download from http://msdn.microsoft.com/netframework[^], and available to read online at http://msdn.microsoft.com/library[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks! Your response was most helpful, and your right, that did the trick!
|
|
|
|
|
We have Access 2003, and we secured a database using "User Level Security
Wizard". Now we have 2 ".mdw" files,
the original one which we used to secure the database, and another one that
is created when we open the database.
Through connection string we open the database using the original one. My
question is.. is there a way to open the
database using the other ".mdw" (the one that is created by access when the
databse opens) as this is the one that
really enforce the security on the file. Bare in mind that this is a windows
application class so everyone will have a copy
of the original ".mdw" to be able to connect to the database...
|
|
|
|
|
In the connection string you can specify the path to the correct MDW file using the "System Database" property, like:
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4; "
+ "User ID=anon;Password=;Data Source=C:\Data\Database.mdb; "
+ "System Database=C:\Data\Users.mdw"); Any further questions specific to ADO.NET please post in the ADO.NET forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi!
My goal is to create a typed dataset from an XML file at run-time, meaning that I don't want all columns to be strings, but also integers, floats and so on. The thing is that at run-time, I know about the types of the fields to be created, but I don't have this information in a .xsd or .dtd file and don't want to use schemas in other files.
So here is a sample example XML file:
<?xml version="1.0" encoding="utf-8" ?>
<config xmlns="http://tempuri.org/simple.xsd">
<params>
<SomeFloat>0.25</SomeFloat>
<SomeInt>25</SomeInt>
<SomeString>A string</SomeString>
</params>
</config>
which would gives me something like this:
Name: value: type:
SomeFloat 0.25 string
SomeInt 25 string
SomeString A string string
with the following code:
----------
m_Dataset = new DataSet();
m_Dataset.ReadXml("simple.xml");
//Linking dataset to datasource
DataGrid datagrid = new DataGrid();
dataGrid1.DataSource = m_Dataset;
//Selecting the node that is of interest
dataGrid1.DataMember = "params";
dataGrid1.CaptionText = dataGrid1.DataMember;
---------
I know at run-time that SomeFloat is a float, SomeInt an int and son on. So before I load the XML, I would like to specify programmatically the table so it would look like this:
Name: value: type:
SomeFloat 0.25 float
SomeInt 25 int
SomeString A string string
How can I make sure that the type of the columns won't be only strings? How can I specify these types? Should I create the table in the dataset first?
Thanks!
Huck
|
|
|
|
|
how is this done? (its a byte array, if it matters..)
|
|
|
|
|
Depends on how you define compare. If you're checking for total equality of each and every element, a simple for loop could do the trick:
byte[] arr1, arr2;
if(arr1.Length != arr2.Length)
{
}
for(int i = 0; i < arr1.Length; i++)
{
if(arr1[i] != arr2[i])
{
}
}
return true;
Again, this is just some pseudo-code, it really depends on what kind of comparison you want to do.
Any remotely useful information on my blog will be removed immediately. There are 10 kinds of people in the world. Those who have heard of the ubiquitous, overused, worn-out-like-an-old-shoe binary "joke" and those who haven't.
Judah Himango
|
|
|
|
|
Hi,
I was wondering whether is it possible to download a
word .doc file from the webserver, using a webservice, and open it using my local app????
I am quite new to webservice and knows basic webmethods to access the database.
just wondering whether it is possible?
if yes, how ? any code sample? or links to tutorials?
Thanks
JOsh
|
|
|
|
|
Sure it's possible. Define a webmethod in your webservice using the [WebMethod] attribute, that takes a string (file name) and returns a byte array (file contents). Something like:
[WebMethod]
public byte[] GetFile(string fileName)
{
FileStream stream = System.IO.File.Open(fileName);
byte[] fileContents = new byte[stream.Length];
stream.Open(fileContents, 0, fileContents.Length);
return fileContents;
}
And on your client, just call the web method to get the byte array back, then write a new file to the local hard disk and write the bytes to it, VOILA you have a replica of the file on your local system.
Any remotely useful information on my blog will be removed immediately. There are 10 kinds of people in the world. Those who have heard of the ubiquitous, overused, worn-out-like-an-old-shoe binary "joke" and those who haven't.
Judah Himango
|
|
|
|
|
Thanks,
Now that I am clear about the webservice part, how do I write the byte array into the file?? All I know is to write a line to the file...like this
string fileName = "somefile";
Stream s = File.Open(fileName + ".doc", FileMode.Create);
StreamWriter writer = new StreamWriter(s);
writer.WriteLine("Text in file");
Any help would be appreciated...
thank you
Josh
|
|
|
|
|
To write bytes to a file:
FileStream fs = new FileStream("c:\\someFile.dat", FileAccess.Write);
byte[] bytes = new byte[numberOfBytes];
fs.Write(bytes, 0, bytes.Length);
Any remotely useful information on my blog will be removed immediately. There are 10 kinds of people in the world. Those who have heard of the ubiquitous, overused, worn-out-like-an-old-shoe binary "joke" and those who haven't.
Judah Himango
|
|
|
|
|
Lets supose that I have 2 applications, one at C:\app1 and another at C:\app2. At application 2 I have 2 assemblies, app2-1.dll and app2-2.dll. App2-1.dll have a reference to app2-2.dll, so app2-1.dll needs app2-2.dll to work correctly. Ok, at my app1 I use the following code:
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(@"C:\app2\app2-1.dll");
Type classType = assembly.GetType("app2-1.MyClass",true);
At this time I've an error. When my assembly app2-1 tries to call some method from my app2-2 that is referenced it doesn't find my app2-2.dll.
How to change my default assembly path when load it? something like this...
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(@"C:\app2\app2-1.dll");
assembly.DefaultPath = @"C:\app2\";
Some Idea?
Tkx
PS: This property DefaultPath doesn't exist...
Wender Oliveira
.NET Programmer
|
|
|
|
|
Hi,
Is there anyone can help me solve a problem with screen capture?
I found using bitblt to save image in main window I point to, will capture other image which on the top of this window. Is there other way to save main frame image even which is not on the toppest? Thanks in advance.
Amy
|
|
|
|
|
|
Yes. I read it. Let me clear my question. I want to save image in my own application window every 30 seconds for example no matter whether the user actives other applications. I don't think I can make any other window invisible which i may don't know it is on the top of mine, when i am trying to catch the image in my application window. So maybe I should ask this way, is there any way to catch image of one frame window which i specified? Just like I opened calculater and then opened explorer, may I catch calculater image when i know the window handle of calculater, but it is under the explorer window? Or maybe I didn't get the point of the article you told me...Can you tell me more..? Thanks
Amy
|
|
|
|
|
Hi,
i want to make setup for one project for C# 2005,so i had taken a setup and deployment project and added another project for which i want to make setup.
but main problem is that in primary output from project file,i can't able to see the main .exe file.
Now how to see the .exe file of the application?
becoz without exe file i can't able to show the output from the setup application.
regards.,
montu3377
|
|
|
|
|
I am a newbie. I want to stream a video (.wmv) via TCP/IP (not webpage).
I am programming in C#.
- As I know, C++ should be used in Windows Media Format SDK, can it also be used in C#?
- Windows Media Encoder SDK can encode file for streaming, but can it also be used for streaming too?
-Any link can give me to study?
Thank You
|
|
|
|
|
Hello,
I am trying to convert the following c# into j# but I am having difficulties.
C#
e.Graphics.DrawString(listBox1.Items[e.Index].ToString(), e.Font, myBrush,e.Bounds,StringFormat.GenericDefault);
J#
e.get_Graphics().DrawString(listBox1.get_Items[e.get_Index()].ToString(),e.get_Font(), myBrush, e.get_Bounds(), StringFormat.get_GenericDefault());
However I get this error:
Cannot find field 'get_Items' in class 'System.Windows.Forms.ListBox'
Does anyone have any ideas?
Thanks,
Harold Clements
Harold Clements
|
|
|
|
|
I'm no expert for J# (to be honest; I've never used it ), but after taking a quick look I think the following could work:
e.get_Graphics().DrawString(listBox1.get_Items().get_Item(e.get_Index()).ToString(), ...
www.troschuetz.de
|
|
|
|
|
Here's my guess:
Brush myBrush = Brushes.get_Blue();
if( listBox1.get_SelectedItem() != null )
e.get_Graphics().DrawString( listBox1.get_SelectedItem().toString(),
this.get_Font(),
myBrush,
(float)e.get_ClipRectangle().get_X(),
(float)e.get_ClipRectangle().get_Y() );
I simplified a little, because I couldn't tell which overload you wanted; you seemed to want to pass a Rectangle where as it looks like a RectangleF is required in a couple of the overloads.
Matt Gerrans
|
|
|
|