|
Looks like some firewall is blocking the port on which MySQL is listening.
|
|
|
|
|
i stopped that MySql server pc firewall(Linux machine).but same error comeing.i don't knowy is that???????
|
|
|
|
|
Generally when a user is created using CreateUserWizard control, it automatically loged in. But i want to create user using CreateUserWizard but it will not loged in automatically. It will just create the user. Is it possible?
Thanks for help
|
|
|
|
|
Hi I have developed an asp.net website.In my site there is a secured page in which there is a link of a confidential document(say confidential.pdf),which only authenticated users can download.Upto this point it's ok.
My problem is that whenever I go to google and search for confidential.pdf, it shows the link of my file and from there it's easily downloadable.I want to protect this.I have placed robots.txt in the root directory.Still it's not working.
Can anyone guide me?
ARINDAM
|
|
|
|
|
ARINDAM1981 wrote: I have placed robots.txt in the root director
This will just tell the crawler not to index the file but the file will be still available for download if you provide the full path in URL.
As a remedy, create a HttpHandler and handle all pdf file requests. Goto IIS settings and ask ASP.NET to process PDF extension requests so that your handler gets activated. Do the authentication logic inside this handler and if user is successfully authenticated, provide access to the file.
|
|
|
|
|
Thanks for ur reply..but can you elaborate a bit..or can u give me some link where I can get help about this?
ARINDAM
|
|
|
|
|
ARINDAM1981 wrote: .but can you elaborate a bit.
Which part of my reply is unclear? Creating HttpHandler? Read this[^]. For adding ISAPI extension, check this[^].
|
|
|
|
|
Hi All,
I have a label called lblUserMessage on my asp.net web form developed in vs.net 2003. when a user clicks a button, the lblUsermessage displays the following text:
The hlReportZip is a hyperlink control on web form.
C# code:
lblUserMessage.Text = "Click on" + hlReportZip + "to download store status reports";
Asp.net Code:
<asp:hyperlink id="hlReportZip" navigateurl="https://203.168.125.36" runat="server" forecolor="Black" visible="False" xmlns:asp="#unknown">Report.zip
my question how can i make the hlReportZip clickable in the text like this:
Click on hlReportZip (I want to make this clickable) to download store status reports.
however the clickable ReportZip is going to the end of message like this: Click on to download store status reports ReportZip (The ReportZip is clickable), in which i dont want.
Many thanks
|
|
|
|
|
here[^]
only two letters away from being an asset
|
|
|
|
|
Thanks dude, that this is not what i wanted.
|
|
|
|
|
Then what do you want?
only two letters away from being an asset
|
|
|
|
|
AndieDu wrote: lblUserMessage.Text = "Click on" + hlReportZip + "to download store status reports";
This will not work. To make that clickable, you need to render as a normal hyperlink.
lblUserMessage.Text = "Click on <a href=\"https://203.168.125.36\" /a> to download store status reports";
|
|
|
|
|
|
I have placed the Login, and LoginStatus in the MasterPage.
I have set LoginStatus to false by default.
Once the user has logged in, I want the LoginStatus to become True.
I have tried the following code and it's not working.
I tried to run the debugger and check if the code behind runs, and I haven't seen that it did. Seems that it just skips the code.
Thank you for your time.
MasterPage.Master
<asp:LoginStatus visible="false" CssClass="menu" ID="LoginStatus1" Font-Underline="true" runat="server"/>
<asp:Login OnLoggedIn="LoggedIn" ID="Login1" Width="600" runat="server" ...more code here >
MasterPage.Master.cs
protected void LoggedIn(object sender, EventArgs e)
{
LoginStatus1.Visible = true;
}
|
|
|
|
|
I think the MasterPage.Master runs that line <asp:LoginStatus visible="false" CssClass="menu" ID="LoginStatus1" Font-Underline="true" runat="server"/> again.
I would prefer using a session to store the login status
On the MasterPage.Master Page_Load event, do a check on the status of the Session("loginstatus") so if it's "1" then visible = true if it's "0" then visible = False. Henceforth, and your Login_Authentication you can check if user login success then chagne your session to "1" =)
Cheers hope this helps you~
|
|
|
|
|
Being fairly new to web development, i have an example project that runs against the adventureworks db. I have the db installed, can open it up with sql server (2005 developers edition) and can even test a connection using visualstudio server Explorer
In my projects code however I get access denied error message when the asp.net app tries to access the database. I am not using IIS for this, just the webserver that runs in Vstudio IDE when developing.
I suspect i don't have something setup for the database. I checked and Remote Connections are allowed
Here is ex.message
ex.Message "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)" string
The connection string looks like this
strConn =
get{return "Data Source=DALEHP\SQLDEVELOPER;Initial Catalog=AdventureWorks;Integrated Security=True";}
The connection section looks like this:
public static DataSet GetProducts(String strConn)
{
DataSet ds = null;
SqlConnection conn = null;
try
{
conn = ConnectionInfo.CreateConnection(strConn, true);
SqlCommand cmd = new SqlCommand("SELECT * FROM PRODUCTION.PRODUCT", conn);
SqlDataAdapter sqlDA = new SqlDataAdapter(cmd);
ds = new DataSet("Products_Set");
sqlDA.Fill(ds);
}
catch(SqlException ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
throw ex;
}
finally
{
ConnectionInfo.CloseConnection(conn);
}
return ds;
}
|
|
|
|
|
There are two ways of doing integrated sql security. If you want to set permissions for each user (which I don't recommend) make sure you go into IIS and uncheck the allow anonymous access box for your web application. You will also need
<authentication mode="Windows"/> in your web.config.
What I do in my applications is create one windows account that has access to the database. Use a system account so that no one can use that account to log on to the machine. Then add the following your web.config
<authentication mode="Windows"/>
<identity impersonate="true" userName="yourDomain\yourSQLAccountUserName" password="PA$$word"/>
Then make sure the yourDomain\yourSQLAccountUserName account has appropriate rights in the database. Then if you want to do auditing you can always pass the userName of your current user in a sql parameter and update the table.
Also put your conn string in the web.config and use system.configuration.configurationmanager to get it.
Another thing is that it is best to use using blocks. Then you don't have to call close or dispose methods.
For example
public DataTable GetDataTable(string ProcName, SqlParameter[] parameters)
{
DataTable dt = new DataTable();
using (SqlCommand cmd = new SqlCommand(ProcName))
{
cmd.CommandType = CommandType.StoredProcedure;
using (SqlConnection conn = new SqlConnection(connString))
{
cmd.Connection = conn;
foreach (SqlParameter prm in parameters)
{
cmd.Parameters.Add(prm);
}
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.Connection.Open();
da.Fill(dt);
cmd.Parameters.Clear();
}
}
return dt;
}
I didn't get any requirements for the signature
|
|
|
|
|
Hi guys, how can I open a log.txt file inside the webform.aspx window. I don't open and display inside the TextPad. I tried googling but couldn't find something helpful may be you can redirect me to the helpful resource.
Thanks
|
|
|
|
|
System.IO.File.ReadAllText("C:\yourfilepath");
I didn't get any requirements for the signature
|
|
|
|
|
Thanks for suggestion some ways but that's not what I am looking forward, sorry.
Actually, I have a LinkButton on a aspx page and if that is cliked I want to open any kind of file like txt,bmp,jpg,gif,doc,xls files in an another browser window.
You probably have seen like when we open the .doc from hotmail it open the document file in a browser window same i want something like that.
Thanks once again in advance.
|
|
|
|
|
That should be easy enough. Where is the file coming from?
you need to add the content type to the page that will display the file depending on the file for example
switch ( fileExtension )
{
case "pdf": Response.ContentType = "application/pdf"; break;
case "swf": Response.ContentType = "application/x-shockwave-flash"; break;
case "gif": Response.ContentType = "image/gif"; break;
case "jpeg": Response.ContentType = "image/jpg"; break;
case "jpg": Response.ContentType = "image/jpg"; break;
case "png": Response.ContentType = "image/png"; break;
case "mp4": Response.ContentType = "video/mp4"; break;
case "mpeg": Response.ContentType = "video/mpeg"; break;
case "mov": Response.ContentType = "video/quicktime"; break;
case "wmv":
case "avi": Response.ContentType = "video/x-ms-wmv"; break;
//and so on
default: Response.ContentType = "application/octet-stream"; break;
}
Response.BinaryWrite(btyeArrayOfFile);
I didn't get any requirements for the signature
|
|
|
|
|
string fileContent = System.IO.File.ReadAllText("yourfilepath");
Response.Write(fileContent) This will work only for text files
|
|
|
|
|
Do you mean you want just the text in a
<div><p>...</p></div>
construct?
Or, why not simply use an asp:TextBox control and assign the contents of your text file to its Text property?
Mitchell
|
|
|
|
|
I have the following vb.net code to read the excel data into a dataset. The code works fine and the excel data is converted to a dataset. If the excel file has a data in the same column in which some numbers are formatted as text (eg. 080) and some numbers are not formatted as text but formatted as numbers (eg. 100.01) then the dataset contains empty values for the ones that are formatted as numbers. Is there anyway to get those values as text?
Thanks,
Bharathy.
Public Shared Function GetDataSetFromExcel(ByVal excelFileName As String) As DataSet
Dim con As OleDbConnection
Dim dt As DataTable
Dim conStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + excelFileName + ";Extended Properties=Excel 8.0;"
con = New OleDbConnection(conStr)
Try
con.Open()
dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
If (dt IsNot Nothing) Then
Dim excelSheetNames(dt.Rows.Count) As String
Dim i As Integer = 0
For Each row As DataRow In dt.Rows
excelSheetNames(i) = row("TABLE_NAME").ToString()
i = i + 1
Next
Dim myCommand As OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM [" + excelSheetNames(0) + "]", con)
Dim myDataSet As New DataSet()
myCommand.Fill(myDataSet)
Return myDataSet
Else
Return Nothing
End If
Catch ex As Exception
Throw (ex)
Finally
con.Close()
End Try
End Function
|
|
|
|
|
It sounds like this is an issue with the Excel driver attempting to guess the data type for the column. The driver has probably made the decision, based on sampling an initial number of rows (default is 8) that the column should contain text values. Values that look like they belong to another data type will be disregarded and show up as NULL. If you add the element 'IMEX=1' to your connection string this tells the driver to treat intermixed data in a column as text (see here[^])
If you need to increase the number of rows that the driver uses to guess the data type for a column, you need to make a registry change. See this article[^] for more information.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|