Ramesh S 129 Posting Pro

Hi,

The only requirement to access an asp.net web application (if not web service) from client PC is a browser like IE, Firefox etc. You don't need to install Oracle client at client PCs. If asp.net application and Oracle database are running different servers, you need to install Oracle client in the server where the asp.net application is running.

If the application is a desktop application (Windows Forms), you need to install Oracle client at client PC along with installation of that application.

Ramesh S 129 Posting Pro

Hi,

The AutoCompleteExtender may not work within a UserControl due to its limitations. Refer the following link for more details.

Hot to: user AutoCompleteExtender in a UserControl (ascx) and place the ServiceMethod on its code-behind.

You can try to use jQuery.

Ramesh S 129 Posting Pro

Hi,

Instead of creating all the functional components of the Shopping Cart application by yourself, You can try to use third party/open source tools in your e-commerce site.

You can find some open source/third party tools/kits in the following links

ASP.NET Community - Open Source Projects and Starter Kits (Refer the eCommerce section)

SalesCart

CS-Cart Shopping Cart

Ramesh S 129 Posting Pro

Hi,

Take a look at the following link.

Get GridView selected row DataKey in Javascript

Ramesh S 129 Posting Pro

Hi Kayfar,

Try this code.

private void button1_Click(object sender, EventArgs e)
        {
            OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Northwind.mdb");
            conn.Open();
            String sqlText = "SELECT * FROM Customers WHERE CompanyName LIKE '%" + textBox1.Text + "%'";
            OleDbDataAdapter adapter = new OleDbDataAdapter(sqlText, conn);
            DataTable dtCust = new DataTable();
            adapter.Fill(dtCust);
            conn.Close();
            dataGridView1.DataSource = dtCust;
        }

Also refer this link.

Microsoft Office Access 2007 - Like Operator

Ramesh S 129 Posting Pro

Hi nick3592,

In addition to Lusipu advise, Here is mine,

To develop web applications in asp.net, you need to learn any of the programming languages C# or VB.NET and .NET object model (classes/components) specific to asp.net.

If you learn C# or VB.NET, you can also easily work in the following .NET based application platforms with little learning curve.

1. Desktop Applications (Windows Forms)
2. SharePoint Development
3. Microsoft Dynamics CRM
4. Microsoft BI platform
5. Windows Mobile Development

Also you can work BizTalk Server and Axapta Dynamics development etc . Becuase .NET Framework is the base for all Microsoft based platform customization. All you need to do is you have to learn the platform specific object model to work in that.

Ramesh S 129 Posting Pro

Hi Doug,

StreamReader is one of the good option to parse the csv file. But you need to write extra code to parse each row in the csv file and then post to sql server.

You can also try to use System.Data.OleDb namespace to read and load the csv file content into DataSet/DataTable easily and then update to SQL Server. This approach will help you to avoid writing your own parsing mechanism.

Ramesh S 129 Posting Pro

Hi,

When you run an ASP.NET application from VS 2005 (without using IIS), it runs under your account's security context. Since you may have read/write access to the folder, you are able to upload files to that folder from your application.

But When you deploy and run an ASP.NET application from IIS, It runs under ASPNET account in Windows XP and NT AUTHORITY\Network Service account in Windows 2003.

You need to provide read/write access to 'mainImage' folder to NT AUTHORITY\Network Service account, so that you can save file to that folder from your asp.net application.

Lusiphur commented: Good catch! :) +1
Ramesh S 129 Posting Pro

Hi,

You can look for a third party or open source control to implement the chat functionality in your asp.net site. Check the following links.

Subgurim Chat ASP.NET
CuteChat
JaxterChat
ASP.NET Ajax Chat

Ramesh S 129 Posting Pro

Hi,

You can also try to use jQuery Tab feature.

Ramesh S 129 Posting Pro

Hi,

ASP.NET does not have a built-in text format tool bar/editor in VS 2005/2008. You can try to use a third party or open source controls to format the mail content in your web page. Check the following links.

FreeTextBox - Free HTML Editor.

CKEditor

NicEdit

ASP.NET Ajax Toolkit - HTML Editor

Ramesh S 129 Posting Pro

Hi,

In ASP.NET, a template is property of a server control that describes the static HTML, controls, and script to render within one region of the control.

The EditItemTemplate property lets you specify how the cell will change when a row in a DataBound control such as GridView is put into edit mode.

The ItemTemplate is used to specify how a cell should appear when a row is in normal mode(View mode).

Ramesh S 129 Posting Pro

Hi,

Mark this thread as solved if your question is answered.

Ramesh S 129 Posting Pro

Hi,

The ID of the 'chkHomePhone' will be prefixed with the parent control names when you put the control inside containers such as Accordian control. Find the actual ID of the control by opening the aspx page in IE ->Righ click->View Source in IE. The control ID will look like 'ctl00_SomeContent_AccordionPane1_chkHomePhone'. Use this ID in JavaScript.

Ramesh S 129 Posting Pro

Hi,

System.Drawing.Image is an image (store as byte array in memory) where as System.Web.UI.WebControls.Image is a asp.net server control. Both are completely different and you cannot simply convert this. What are you trying to achieve?

You can write a http handler in asp.net which writes the bytes of array to response stream. You can use this http handler like a path to display the image in an asp.net image control. Check the following link.

Http Handlers to handle Images

Ramesh S 129 Posting Pro

Hi,

Refer the following link.

ASP.NET Hosting Tutorials

Ramesh S 129 Posting Pro

Hi,

You need to bind the GridView, after inserting records into the database. Here is the sample code.

Imports System.Data
Imports System.Data.OleDb
Partial Class DemoPage1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            BindGridView()
        End If
    End Sub

    Private Sub BindGridView()
        ' Code to retrieve records from database and fill it in a DataTable and Bind it to GridView
        Dim dt As DataTable = New DataTable()
        Dim conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\Users\user\Desktop\honor.mdb")
        Dim da As OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM Sysdep", conn)
        conn.Open()
        da.Fill(dt)
        da.Dispose()
        conn.Close()

        GridView1.DataSource = dt
        GridView1.DataBind()
    End Sub

    Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
        'Code to add new record to SQL Server table
        Dim con1 As New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\Users\user\Desktop\honor.mdb")

        Dim sqlinsert As String

        sqlinsert = "INSERT INTO sysdep (sysaccount,syspw)" & _
          "VALUES(@sysaccount, @syspw)"

        Dim cmd As New OleDbCommand(sqlinsert, con1)

        cmd.Parameters.Add(New OleDbParameter("@sysaccount", TextBox1.Text))
        cmd.Parameters.Add(New OleDbParameter("@syspw", TextBox2.Text))

        Try
            con1.Open()
            cmd.ExecuteNonQuery()
        Catch ex As OleDbException
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Web Message")
        Catch ex As InvalidOperationException
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Web Message")
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Web Message")
        End Try
        con1.Close()

        BindGridView()
    End Sub
End Class
Ramesh S 129 Posting Pro
Ramesh S 129 Posting Pro

Hi,

You can reset Visual Studio Settings in two ways
1. From Visual Studio IDE
Click Tools Menu->Import and Export Settings->Reset all settings.

2. From Command Prompt
Start Menu->All Programs->Microsoft Visual Studio 2008->Visual Studion Tools-> Visual Studio 2008 Command Prompt. This will open the command prompt. Type the following command: devenv.exe /resetsettings

Ramesh S 129 Posting Pro
Ramesh S 129 Posting Pro

Hi,

ASP.NET 3.5 social Networking by Andrew Siemer is a good book which you guide to building enterprise-ready social networking and community applications with ASP.NET 3.5.

DotNetNuke is the leading open source web content management system (CMS) and application development framework for Microsoft .NET. You can try to implement the Social Networking modules. Smart-Thinker is a free DotNetNuke Social Networking Solution and the DotNetNuke Toolbar.

Also look into this article: Nine Ways to Build Your Own Social Network

Ramesh S 129 Posting Pro

Hi,

You can try to use PickerEntity object to retrieve the values from PeopleEditor control.

For example, To get the Email Address use PickerEntity object to retrieve the values from PeopleEditor control.

PickerEntity pckEntity = (PickerEntity)peResponsible.ResolvedEntities[0];
//Here peResponsible is a PeopleEditor Control

string email = pckEntity.EntityData["Email"].ToString();

Reference: PeopleEditor Class. Refer the content under 'Get e-mail address from PeopleEditor PickerEntity' in Community Content section.

Set value in People Editor control

PeopleEditor Control

How to Use the PeopleEditor Control: Saving Data

Ramesh S 129 Posting Pro

thanx alot sir..
really its work..:)

Hi,

Please mark this thread as solved if you feel that your question has been answered.

Ramesh S 129 Posting Pro

Put the return statement out of else block in GetCounterValue() method.

private int GetCounterValue()
    {
        StreamReader ctrFile;
        FileStream ctrFileW;
        StreamWriter sw;

        string Path = Server.MapPath("Counter.txt");
        string CounterContents;
        int nCounter;
        if (File.Exists(Path))
        {
            ctrFile = File.OpenText(Path);
            CounterContents = ctrFile.ReadLine().ToString();
            ctrFile.Close();
            nCounter = Convert.ToInt32(CounterContents);
        }
        else
        {
            nCounter = 0;
            nCounter++;
            ctrFileW = new FileStream(Path, FileMode.OpenOrCreate, FileAccess.Write);
            sw = new StreamWriter(ctrFileW);
            sw.WriteLine(Convert.ToString(nCounter));
            sw.Close();
            ctrFileW.Close();
        }
   return nCounter;
    }
Ramesh S 129 Posting Pro

Try this code.

ListItem item = dropdownlist1.Items[dropdownlist1.Items.Count-1];
Ramesh S 129 Posting Pro
Ramesh S 129 Posting Pro

Instead of using Response.Redirect("Some file Name") using Response.WriteFile() method which writes the contents of the specified file directly to an HTTP response output stream as a file block. For example,

Response.WriteFile(@"D:\Temp\Test1.docx") ;
 //Response.WriteFile(path + fileToOpen);
Ramesh S 129 Posting Pro

When adding controls to an asp.net page dynamically, It has to be done in Page_Load or Page_init events. Then only the viewstate will be maintained between postbacks. The events for those conctrol will fire properly.

In which event are you adding table and radio button controls to the page?

Ramesh S 129 Posting Pro

FilterType in ASP.NET Ajax FilteredTextBox will have the following options:
1. Numbers
2. LowercaseLetters
3. UppercaseLetters
4. Custom

You can specify more than one options as a comma-separated combination of them.

If Custom is specified, the ValidChars field will be used in addition to other settings such as Numbers.

Refer the following link.

http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/FilteredTextBox/FilteredTextBox.aspx

Ramesh S 129 Posting Pro

Hi,

Check this link.

Creating Cascading DropDownLists in ASP.Net

It has sample code with table design and asp.net code. It exactly matches with your requirement.

Ramesh S 129 Posting Pro

In line 18, you are using SqlCommand object to open a connection which is wrong. You need to use SqlConnection object to open a databas connection.

SqlCommand represents a Transact-SQL statement or stored procedure to execute against a SQL Server database.

Try the following code.

Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim connStr As String = "Data Source=RAHUL-034890AF0\SERVER2005;Initial Catalog=user_accounts;Integrated Security=True"
        Dim conn As Data.SqlClient.SqlConnection = New Data.SqlClient.SqlConnection(connStr)
        Dim command As Data.SqlClient.SqlCommand = New Data.SqlClient.SqlCommand()
        command.Connection = conn
        conn.Open()
        command.CommandText = "YourProcName"
        command.CommandType = CommandType.StoredProcedure
        command.Parameters.Add(New SqlParameter("@Use_Name", System.Data.SqlDbType.VarChar, 20)).Value = txtUserName.Text
        command.Parameters.Add(New SqlParameter("@Password", System.Data.SqlDbType.VarChar, 6)).Value = txtPasswod.Text

        Dim reader As Data.SqlClient.SqlDataReader = command.ExecuteReader(CommandBehavior.CloseConnection)
        Dim result As Boolean = reader.HasRows
        reader.Close()
        conn.Close()
        If result Then
            Response.Redirect("~/salesbill.aspx")
        Else
            lblError.Text = "Username and password do not match"
        End If
Ramesh S 129 Posting Pro

Hi,

The code that you posted is to be used in WebBrowser control in Windows Forms application. It is not intend to be used in asp.net application.

In what do you want to click link? Server side or cliend side?

If you want to click a link using JavaScript, use the following code.

function ClickLink() { 
  document.getElementById('SomeLinkId').click(); 
}
Ramesh S 129 Posting Pro

When a asp.net web page is accessed remotely by a user, IIS process the request and sends the output to the user. For processing the request, it may create some temprory variables based on the program logic that you have written. The temprory memory data will be cleared by .NET CLR once the response is sent to the client browser.

IIS will not store any data in memory unless you store data specific to users in Session. If you want to save memory, do not store values in Session, Application and Cache objects.

If you want to share the instance of a class in .NET, you need to implement Single Desig Pattern.

Check the following links.
Implementing Singleton in C#

Singleton Design Pattern

Implementing the Singleton Pattern in C#

Ramesh S 129 Posting Pro

Set the customErrors mode to 'off' in the web.config as specified in error message that you posted. It will adisplay actual error occured. Also check if any error message is posted in the Event Viewer.

Ramesh S 129 Posting Pro

You should add dynamic controls in Page_Load or Page_Int events. You are trying to add dymic controls in LoadViewState method by caling getcontrol() method. Try to avoid it. It may cause the error.

Ramesh S 129 Posting Pro

What you mean custom paging in user control?

Paging is basically used with controls like GridView, FormView and DetailsView. Are you asking abotu custom paging in GridView which is placed in a user control.

If yes, look into the following links.

Custom Paging for GridView
Custom Paging in ASP.NET 2.0 with SQL Server 2005
Neat Solution to GridView Custom Paging

Ramesh S 129 Posting Pro
Ramesh S 129 Posting Pro

Try this code.

var t1 = "10/10/2009" ;
var t2 = "15/10/2009";
var one_day=1000*60*60*24; //Total time for one day

var x=t1.split("/");     
var y=t2.split("/");

var date1=new Date(x[2],(x[1]-1),x[0]); //date format(Fullyear,month,date)   
var date2=new Date(y[2],(y[1]-1),y[0])
var month1=x[1]-1;
var month2=y[1]-1;
               
var _Diff=Math.ceil((date2.getTime()-date1.getTime())/(one_day));

Reference: How to calculate difference between two dates using JavaScript

Calculating date differences using JavaScript

Ramesh S 129 Posting Pro

Page.User.Identity.Name will return the name of the current user in asp.net

Ramesh S 129 Posting Pro

Decided to do it like this:

if (Request.QueryString["ID"] != null)
            {
                command.Parameters.AddWithValue("@supplier_id", Convert.ToInt32(Request.QueryString["ID"]));
            }
            else
            {
                command.Parameters.AddWithValue("@supplier_id", 2);
            }

If theres a better way let me know!

Grant

Hi Grant,

The above approach seems to be okay. But still you can reduce the number of lines in the following way.

int supplierId = (Request.QueryString["ID"] != null) ? Convert.ToInt32(Request.QueryString["ID"]) : 2;        
command.Parameters.AddWithValue("@supplier_id", Convert.ToInt32(supplierId);
Ramesh S 129 Posting Pro

1. Tools->Internet Options->Security->Internet(zone)->Custom Level-> Under ActiveX controls and plug-ins, Enable the options.
2. It would be better to add your site to the Trsuted sites list and configure activex for that zone.

Ramesh S 129 Posting Pro

Hi Grant,
Request.QueryString["ID"] is read only collection which means that you cannot set/insert a value to the collection. But you can retrieve the value from the collection if exists. Request.QueryString is internally populated by ASP.NET when you pass query strings explicitly from a page.

Ramesh S 129 Posting Pro
Ramesh S 129 Posting Pro

When you view the contenr of an asp.net web page from browser, It will show the HTML content generated by the web server. It will not show the actual asp.net content.

Ramesh S 129 Posting Pro

Regular expression are used to validate inputs such as email, phone numbers etc. Basically they are used to validate if the input is in a pre-defined format.

In your case, the login control's input are validated against the user id and password which are stored in the backend database. Why do you need to use regular expression validators for this scenario?

Ramesh S 129 Posting Pro

You can use Query String to pass a data beween the parent page and the popup window.

Check these links.

Passing variables between pages using QueryString
How to: Pass Values Between ASP.NET Web Pages

Ramesh S 129 Posting Pro

Is there any error message show on the serve?

You are trying to call a process in your asp.net code. When you run this code in your development PC, you can see the output as the application itself is running and the output is seen in the same PC.

When you deploy the application in a server , the process will start in the server itself and cannot be seen from the browser running in a client PC.

Also if the application is trying to access a file, you need to provide read/write access to the folder where the file exists to the Network Service account if your application is deployed in IIS in Windows 2003 and ASPNET account if deployed in IIS in Window XP.

Ramesh S 129 Posting Pro
Ramesh S 129 Posting Pro

Hi nverma ,
Do you want to add empty row to datalist at run time? If so, you need to store the data source(such as DataTable, collection etc) which is bound to the DataList in Session. As adatapost said, add a button control to the ItemTemplate appropriately. When the button is clicked, retrieve the data source from session and add an empty record to it and rebind it to DataList again.

Ramesh S 129 Posting Pro

OpenContacts.NET is open-source library for importing contacts from popular web-mail services. Now supports: GMail, Yahoo! Mail, Live (Hotmail).

Check this link.

OpenContacts.NET

kvprajapati commented: Thanks! +8