|
|
it is using file upload html control .i want without it
jagmit
|
|
|
|
|
Hi , I am supposed to work on an already developed project (in VS and SQL 2005). When I open this project on my machine (Project was developed on some other machine), I get the following error (on pages which are connected to DB)
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
In my web.config, Connection string goes like
connectionString="DataSource=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\RealEstate.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"
Anybody facing similar problem before ??? Please help then , its urgent .. Thanks
Kaliem
|
|
|
|
|
Can you connect to the database with Windows Authentification? If not connect with SQL Server Authentification, then right click the connection in Object Explorer, go to the seurity tab and in the "Server Authentification" section select both authentification modes.
If you want your db to be accessable from a remote connection you must change the default option that SQL Server 2005 has:
Go to Start Programs -> sql server 2005 -> configuration tools -> Sql Server Surface Area Configuration. On the "Surface Area Configuration for Services and Connection" option, under SQLEXPRESS -> Database engine -> Remote connections, check "Local and remote connections" and then "Using Both TCP and named pipes.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
SQL got installed on my machine by VS 2005 installer. Now, when I open "Surface Area Configuration for Services and Connection" as you said, "NO SQL Server 2005 components were found on this computer"
Do I need to install VS 2005 again after un-installing SQL and VS ??? But Installer is same as before ...
btw, same error appears when i open my .mdf file in VS environment ...
|
|
|
|
|
kaliem wrote: Do I need to install VS 2005 again after un-installing SQL and VS ??? But Installer is same as before ...
I don't understand what you mean. Have you uninstalled SQL Express?
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Mircea Grelus wrote: Have you uninstalled SQL Express?
No, I havent un-installed anything ... I ran VS 2005 Installer and SQL 2005 was installed by this setup. Now, I get error "No SQL Server 2005 components were found on this computer" I am asking you what should i do now ???
and btw, VS 2005 setup didnt ask me for anything (sa password or server name etc) as it happens with Manual Installation of SQL Express ...
|
|
|
|
|
Fire up SQL Express with Microsoft SQL Server Management Studio Express[^] and see how that goes.
Maybe your installation of SQL Server is corrupted.
Btw, do you have any other SQL Server installed? 2000?
In order for two versions of SQL Server to coexist on one machine, only one can be set as default instance, the other/s must be installed as named instances.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Hi all,
We can secure source code of business login in asp by using DLLs but how can we secure ASPX pages. I had sale a business solution to a company and they just rename the my company's name and logo and sale to other companies. any solution.
|
|
|
|
|
Do you have any kind of formal agreement with your clients? When you sell them an application, do you require them to sign a license agreement that prohibits what you're describing?
The truth is there isn't much that would stop an unethical individual/business from hacking a .NET application and replacing resources (e.g. a logo image) with their own. However, if you have a signed contract with them and can prove they violated the terms of the contract, your lawyer should be able to make a case in court and recover damages.
|
|
|
|
|
Download the deployment plugin for visual studio. Add a deployment project and use that to compile the application for deployment. In the settings you can choose to not make the site editable, which will turn all aspx files into empty placeholders and put the markup in the DLLs.
---
b { font-weight: normal; }
|
|
|
|
|
Thankx all, especialy Guffa, i will go for deployment package for aspx.
thanks alot.
keep Smiling,
Happy Coding.
|
|
|
|
|
If you didn't do what Guffa said ahead of time, you may be screwed.
Being that it's an ASP.NET application, they can simply replace your logo by replacing a graphic file. They could also change the HTML in the aspx page.
When a company buys an application, they usually also want rights to the source code. If that's the case, your price for source code should be a point where you are compensated enough to not care in case this happens.
If it's a generic piece of software, and not a custom built application for them and they didn't agree to the source code, you can use your receipt, and go after them for copyright infringment.
|
|
|
|
|
little relevant to the topic, I have seen people using utility which takes exe file as Input and generates its Source code as output ... now, what would you do there ... Btw, I have seen it for .NET only, any info about other languages ???
|
|
|
|
|
kaliem wrote: now, what would you do there
Obfuscate.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
kaliem wrote: I have seen people using utility which takes exe file as Input and generates its Source code as output
Actually, that is impossible. What you have seen is someone generating source code that will recreate the program, but the original source code can not be recreated that way.
Any program can be reverse engineered like this. However, to recreate the application you have to take all the different parts of source code and try to put it together into an application igain. That takes a lot more effort and knowledge than just opening an aspx file and change some text.
You can never completely protect your program from reverse engineering, but you can at least make sure that it can't be done by someone who has just learned how to use Notepad.
---
b { font-weight: normal; }
|
|
|
|
|
hmm, I see, 'will seek a chance to use that utlity myself and then tell you ... if integrated source code couldnt be obtained directly, thats actually Good to know ...
|
|
|
|
|
Hi guys,
Anybody knows how to add a column to a datagrid?
I want to create a datagrid for database search result. However, I want to check on something with the data and show yes/no in the additional column in the datagrid according to some conditions.
Thank you
|
|
|
|
|
Probably the simplest way to handle this is to add a <TemplateColumn> to your DataGrid's <Columns> collection. You can use a custom function call within the context of a databinding epxression to display "yes" or "no" based on data in the row.
|
|
|
|
|
How do you do that? Sorry, I'm a beginner here.
Thank you
|
|
|
|
|
Well, you have to know how to work with a TemplateColumn in a DataGrid. If you Google for something like "TemplateColumn DataGrid" you'll get lots of hits to articles that will help. Here's one:
http://aspnet.4guysfromrolla.com/articles/061002-1.aspx[^]
You'll notice in the article the use of the DataBinder.Eval() expression syntax. This syntax allows for data values to be evaluated and displayed in the template column. The article shows a good example of this.
Now in your case, you want a custom function that will determine whether a "yes" or a "no" should be outputted in the additional column. For the sake of example, let's say you have a field called "TotalSales" and you want to have a column labeled "Top Seller" show "yes" when the TotalSales value is greater than 1000. Otherwise, the column shows "no". So you might create a function in your script block that looks like this:
string DisplayTopSeller(int totalSales)
{
if (totalSales > 1000)
return "yes";
else
return "no";
} Then, when defining your DataGrid, you would add a <TemplateColumn> in the <Columns> tag and use an expression that calls the DisplayTopSeller function, passing it the value of the TotalSales field:
<asp:datagrid id="myGrid" runat="server"
AutoGenerateColumns="False">
<Columns>
. . . whatever columns come first . . .
<asp:TemplateColumn HeaderText="Top Seller">
<ItemTemplate>
<%# DisplayTopSeller(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "TotalSales"))) %>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid> If you are using .NET 2.0, you can substitute the shorthand Eval("TotalSales") syntax for the longer DataBinder.Eval(Container.DataItem,"TotalSales") . So in 2.0, your databinding expression could look like this:
<%# DisplayTopSeller(Convert.ToInt32(Eval("TotalSales"))) %>
I hope this is helpful.
|
|
|
|
|
Hi,
I have created WSE 3.0 MTOM enabled asp.net 2.0 WebService. My client(Java
Client) which has MTOM enabled on his side is sending the following soap
message. Basically he is sending the soap message with MIME attachment.
------------------------------------------------------------------------------------------------
MIME-Version: 1.0
Content-Type: Multipart/Related;boundary=MIME_boundary;
type="application/xop+xml";
start="<mymessage.xml@ someexample.org="">";
startinfo="application/soap+xml; action=\"ProcessData\""
Content-Description: A SOAP message with a photo and document in it
--MIME_boundary
Content-Type: application/xop+xml;
charset=UTF-8;
type="application/soap+xml; action=\"ProcessData\""
Content-Transfer-Encoding: 8bit
Content-ID: <mymessage....@someexample.org>
<soap:envelope
="" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime">
<soap:body>
<m:data xmlns:m="http:// someexample.org/stuff">
<m:photo><xop:include
="" xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:http:// someexample.org/photo.jpeg">
<m:doc>
|
|
|
|
|
Hello,
I need to get a value which might be on a SQL database or Access database.
My problem is I need to know which is the database type or, even better, create a code which would work for both databases.
Anyway, first of all I am getting my connection string from Web.Config:
Dim connectionString As String = ConfigurationManager.ConnectionStrings("Conn").ConnectionString
Then, if the database is SQL I have the code:
' Define connection
Dim connection As New SqlClient.SqlConnection(connectionString)
' Define command
Dim command As New SqlClient.SqlCommand
With command
.CommandText = "GetValue"
.Connection = connection
.CommandType = CommandType.StoredProcedure
End With
' Add command parameters
With command.Parameters
.Add(New SqlClient.SqlParameter("@Culture", culture))
End With
' Execute the command
connection.Open()
Dim content As SqlClient.SqlDataReader = command.ExecuteReader
If content.Read Then
Return content.Item("Value").ToString()
Else
Return "# Undefined Value#"
End If
content.Close()
connection.Close()
If the database is Access there are a few changes just in types as follows:
' Define connection
Dim connection As New OleDb.OleDbConnection(Me.ConnectionString)
' Define command
Dim command As New OleDb.OleDbCommand
With command
.CommandText = "GetValue"
.Connection = connection
.CommandType = CommandType.StoredProcedure
End With
' Add command parameters
With command.Parameters
.Add(New OleDb.OleDbParameter("@ContentCulture", culture))
End With
' Execute the command
connection.Open()
Dim content As OleDb.OleDbDataReader = command.ExecuteReader
If content.Read Then
Return content.Item("Value").ToString()
Else
Return "# Undefined Value #"
End If
content.Close()
connection.Close()
How should I create this?
Thanks,
Miguel
|
|
|
|
|
Have a look at the DbProviderFactory Class:
http://msdn2.microsoft.com/en-us/library/system.data.common.dbproviderfactory.aspx
http://msdn2.microsoft.com/en-us/library/dd0w4a2z.aspx
|
|
|
|
|
I get a example of FixedDataGrid Written by Alexander Zeitler.His example work well.It is fixed datagrid row height.I want to add some other function to it,such as highlight entire row,The highlight row work well,but the delete ,edit ,update command work failed!
the all code is here,Can anyone give some help?
using System;
using System.IO;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
//using CustomControls;
namespace WinDataGrid
{
public class FixedHeightGrid : System.Web.UI.WebControls.DataGrid
{
private bool _mergePaddingColumns;
private TableItemStyle _paddingItemStyle = new TableItemStyle();
private int _RowHeight = 22;
private string _sRowForColor = "white";
private string _sRowBackColor = "lightblue";
public FixedHeightGrid()
{
this.ShowFooter=false;
this.ShowHeader=true;
this.AllowPaging=true;
}
public bool MergePaddingColumns
{
get {return _mergePaddingColumns;}
set {_mergePaddingColumns = value;}
}
public TableItemStyle PaddingItemStyle
{
get {return _paddingItemStyle;}
set {_paddingItemStyle = value;}
}
public int RowHeight
{
get { return _RowHeight;}
set {_RowHeight = value;}
}
public string RowForColor
{
get { return _sRowForColor;}
set {_sRowForColor = value;}
}
public string RowBackColor
{
get { return _sRowBackColor;}
set {_sRowBackColor = value;}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
AddPaddingItems();
}
protected override void OnItemCreated(DataGridItemEventArgs e)
{
base.OnItemCreated(e);
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
e.Item.Attributes.Add("OnMouseOver", "this.style.backgroundColor = '" + _sRowBackColor + "';");
e.Item.Attributes.Add("OnMouseOut", "this.style.backgroundColor = '" + _sRowForColor + "';");
}
}
private void AddPaddingItems()
{
int indexCount;
int indexStop = this.PageSize;
int indexStart = 1;
if(this.AllowPaging==true)
{
indexStart++;
indexStop++;
}
Table myTable = (Table)this.Controls[0];
for(indexCount=indexStart+this.Items.Count;indexCount<=indexStop;indexCount++)
{
myTable.Controls.AddAt(indexCount,PaddingItem());
}
}
private DataGridItem PaddingItem()
{
DataGridItem myItem = new DataGridItem(0,0,ListItemType.Item);
Table myTable = (Table)this.Controls[0];
int numberOfColumns = myTable.Rows[1].Cells.Count;
if(this.MergePaddingColumns==true)
{
TableCell myCell = new TableCell();
myCell.ColumnSpan = numberOfColumns;
myItem.Cells.Add(myCell);
}
else
{
for(int indexCount=1;indexCount<=numberOfColumns;indexCount++)
{
TableCell myCell = new TableCell();
myCell.Height = _RowHeight;
myItem.Cells.Add(myCell);
}
}
if(this.PaddingItemStyle.CssClass!=null)
{
myItem.ApplyStyle(this.PaddingItemStyle);
}
return myItem;
}
}
public class BoundColumn : System.Web.UI.WebControls.BoundColumn
{
}
public class ButtonColumn : System.Web.UI.WebControls.ButtonColumn
{
}
public class EditCommandColumn : System.Web.UI.WebControls.EditCommandColumn
{
}
public class HyperLinkColumn : System.Web.UI.WebControls.HyperLinkColumn
{
}
public class TemplateColumn : System.Web.UI.WebControls.TemplateColumn
{
}
}
|
|
|
|