|
Open notepad, enter the following code and save the file "YourFileName.cs" without the quote marks. This should ensure using C#.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleTest
{
class Program
{
static void Main(string[] args)
{
}
}
}
HTH :P
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
Hi guys
I have to fetch data from my database in treeview pattern. If anyone is familiar with this please help me out. And i want to make that treeview control sizeable. I mean like property and solution explorer in Visual Studio.So that any one can make it hide or change its size
please help me
Dj Rock
|
|
|
|
|
Include Microsoft.Web.UI.WebControls.dll in your project.
For runtime addition of nodes for TreeView control do following steps
//On aspx page register TreeView as
<%@ Page language="c#" Codebehind="TreeControl.aspx.cs" AutoEventWireup="false" Inherits="UserControlApplication.TreeControl" %>
//Treeview Control
<tc:treeview class="link" id="tree1" runat="server" indent="15">
//Add the root node for User Control Tree1 in .cs file
TreeNode tNode = new TreeNode();
tNode.Text="Root";
tree1.Nodes.Add(tNode);
//Add Child Node to root node tNode
TreeNode tChileNode1 = new TreeNode();
tChileNode1.Text = str;//This string is the information retrieved form database
tNode.Nodes.Add(tChileNode1);
#Abhi#
|
|
|
|
|
hey abhi thank you so much
i was not getting value before but now i made some changes and then its working great
Thanks once again
|
|
|
|
|
hai every one
im doing asp web application.im using asp control for file uploading that is <asp:fileupload id="fileup" runat="server">. it will create one browse button. if i click that browse button one remove label should be visible. how i do this.please any one help me?
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
i m facing problem when uploading excel file from my local system to web server.can any one plz give me solution this problem.
Thank you
srinivas
|
|
|
|
|
Might help if you can tell us what the problem is. What I have done in the past is to upload the file, then read it using OLE DB.
|
|
|
|
|
Launch Excel 2003 then open the workbook file you'd like to upload. Choose from the menu File-->Save as Web Page.
Then using IE7(or IE6 if you want) direct your browser to the ftp://your_ftp_addy . Drag the Excel file that you have saved as a web page from your machine directory to the web directory of your choice.
The rest is simple...or should be intuitive.
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
Hello,
I have created a function which creates a DataTable from a Database.
However, I want to be able to use an Access or aSQL database.
Do I need to create 2 complete different functions?
The method is the same, only the types change.
Here is my code:
' Define connection
Dim connection As New SqlClient.SqlConnection(connectionString.ToString)
' Define command
Dim command As New SqlClient.SqlCommand
With command
.CommandText = "GetRecords"
.Connection = connection
.CommandType = CommandType.StoredProcedure
End With
' Add command parameters
With command.Parameters
.Add(New SqlClient.SqlParameter("@Value", Value))
End With
connection.Open()
...
Create DataTable
...
connection.Close()
Thanks,
Miguel
|
|
|
|
|
In the data access layer create data objects of SQL and Access depending on the type and in the business layer access the object through nterfaces IDataSource, ICommand etc.
|
|
|
|
|
shapper wrote: ' Define connection
Dim connection As New SqlClient.SqlConnection(connectionString.ToString)
' Define command
Dim command As New SqlClient.SqlCommand
With command
.CommandText = "GetRecords"
.Connection = connection
.CommandType = CommandType.StoredProcedure
End With
' Add command parameters
With command.Parameters
.Add(New SqlClient.SqlParameter("@Value", Value))
End With
connection.Open()
...
Create DataTable
...
connection.Close()
That pro'ly will not work if you're looking to use a Microsoft Access database.
Here's a bit of code for you that should help connect to your Access db.
/ Assumes connectionString is a valid connection string.<br />
using (OleDbConnection connection = <br />
new OleDbConnection(connectionString))<br />
{<br />
connection.Open();<br />
Remember to add the OleDb namespace with the following: using System.Data.OleDb; or all your coding will be for naught.
For further reading on the subject direct your browser of choice (I recommend IE7) to http://msdn2.microsoft.com/en-us/library/system.data.oledb.aspx[^]
Good Luck!
Jerry Hammond
Applications Instructor
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
I am having with problem in browsing multidimensional data cube from asp.net (in c#)pages. could u help me please with sending those all important material to my email id :- dhami_524@hotmail.com.
it's very much urgent to me
with best regard
bct524
naresh is testing the site.
|
|
|
|
|
The purpose of this message board is to post messages here, not email correspondence. This way, others can use this board as a reference, thus minimizing repeat questions.
|
|
|
|
|
I have an ASP.Net web application with a few pages. I have centered the buttons, textboxes, and images on the pages at the resolution of 1024 X 768. I use VS2003 Designer to create the pages. The problem I have is that whenever the pages are displayed at a different resolution, like 800 X 600 or 1280 X 1024 the buttons, textboxes, and images are not displayed correctly. They are too large and off center at the lower resolution and too small and off center at the higher resolution. Is there a way for me to display my pages correctly at whatever the resolution is using C# in the codebehind, set some property for the controls, or using javascript to adjust the controls at the appropriate resolution? Any help would be appreciated, thanks.
|
|
|
|
|
You can try placing a gridlayout panel in a table and center the panel.
|
|
|
|
|
Target your web application for a particulare resolution or control the UI properties by using % (percentage) instead of px (pixels)
|
|
|
|
|
I'm trying to create an installer project that takes the output from building my webapp and creates an installer.
Everything works fine, the only issue is that I have to manually go into the IIS configuration tool and change the asp.NET version number from 1.1 to 2.0 in the webapp properties.
Is there any way to make it so the webapp is automatically configured to use asp.net 2.0?
|
|
|
|
|
|
I have set up a page to preview images and then upload them. Using VB in a .NET page. All is good. However, some images do not display, the only common theme I have been able to find is that all the images that do display correctly have camera information attached. I don't get it, and I am feeling veeeeery shtupid. Can anyone tell me why this is and if there is a way to get around it, without uploading the file first?
A newbie (but working on it!)
|
|
|
|
|
Hello,
I need to create a new XML document.
I believe I need to do this at runtime because the new XML document uses two sources for its data:
1. ASP.NET 2.0 Web.sitemap (It is a XML file)
2. Data which is stored in AppSettings Keys on Web.Config.
The ASP.NET 2.0 Web.sitemap looks as follows:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode
url = "~/default.aspx"
changefreq = "Daily"
description = "My Desgription"
priority = "0.5"
title = "Description"
google = "true" />
</siteMapNode>
<siteMapNode
... />
</siteMapNode>
</siteMap>
My questions are:
1. How to create the new XML document and add the following:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
2. How to loop through all "siteMapNode" nodes of Web.sitemap and create the following transformation:
<siteMapNode
url = "~/default.aspx"
changefreq = "Daily"
description = "My Desgription"
priority = "0.5"
title = "Description"
google = "true" />
TO ( IF google EQUALS "true")
<siteMapNode
url = "~/default.aspx"
changefreq = "Daily"
description = "My Desgription"
priority = "0.5"
title = "Description"
google = "true" />
< url>
< loc> # Value created from AppSettings Key + Web Site Map "URL" Attribute # </loc>
< changefreq> # Value created from Web Site Map "ChangeFreq" Attribute # </changefreq>
< priority> # Value created from Web Site Map "Priority" Attribute # </priority>
</url>
Yes, I know I could do this with a XSLT file. In fact I did that and it is working.
My problem is that I need to introduce some data which I get from AppSettings Keys in my Web.Config.
For that reason I think I completly lost that possibility.
UNLESS I would be able to, in my XSLT file, access an Application Setting Key from my web.config file. I believe this is impossible, right?
Thanks,
Miguel
|
|
|
|
|
Maybe this is the wrong forum, but there isn't an IIS one.
Anyway, I just got a new dev machine and IIS won't serve a page at all. I have added a virtual directory to IIS, modified the permissions on the directory the actual site is in to allow IUSR_machine and ASPNET to have Read & Execute permissions on those files, I have run aspnet_iisreg -ga [username] on IUSR_machine, ASPNET, and my own local account like MS KB page suggests to no avail. I just get that ASP.NET error page that says "Failed to access IIS metabase" and suggests I go: here to KB.
Any suggestions on what is wrong?
If its important, and I think it might be, IT installed IIS after installing ASP.NET (any version) when they were setting up my machine.
|
|
|
|
|
We're creating a site for our client and need to allow them to view scanned order form images. These order form images are stored on servers within our corporate network however, for obvious reasons, our clients' intranet site will be stored on a server outside of our network (i.e. outside of our firewall).
So we're having problems trying to give permissions to this intranet site to be able to view these images within our company's firewall.
Has anyone ever encountered this issue?
Also, if it helps, the app is developed in the 1.1 framework and the server storing the images is using Sql Server 2000 and IIS 5.0.
Thanks.
-Goalie35
|
|
|
|
|
You shouldn't really be trying tp make the images directly accessible outside the firewall. The best way to handle this is to create a distributed architecture in which a machine inside the firewall streams the images to a machine in the DMZ which can then be streamed to the client. A simple web service should be sufficient.
On your machine inside the firewall, create a web service that, given an image name/path, reads the file and returns a byte array representing the file data.
On the web machine, call this web service and perform a BinaryWrite of the byte array.
|
|
|
|
|
hi
In my database table with some fields i have STATUS field it contains 0 or 1.Now i want to display these details in a datagrid .and this datagrid contains a column with checkboxes.these check boxes will be checked or unchecked based on the value STATUS which is in database.After displaying the check boxes properly i want to allow the user to edit these checkboxes and update these edited checkbox values again into database .How to do this in C#.
If it is vb.net i have some idea.But iam new to C#.net. Iam stuggling with this syntaxes please help me.
thanks
vijay
|
|
|
|
|
I have 2 Frames.One of the frame has Treeview control and another Frame will have the respective aspx page of the Node of the treeview control placed in frame.When i perform some action(eg:Adding of 'user') on the particular aspx page,that added user is added to xml.
I want the first Frame (Treeview control) to be updated.So it need to reload.
How to reload first Frame when some modifications are done in second frame using javascript.
|
|
|
|