|
I have the following code (works fine in .NET 1.x) which I believe expects to get the connectionstring from the key-value pair within <appSettings>...</appSettings> block in my web.config file. But I'm using .NET 2.0 now and all of my connection strings are within <connectionstrings>...</connectionstrings> block. How can I convert this line:
string strConnexn = SecureConnection.GetCnxString("cnxNWSecure");
to read my connectionstring from <connectionstrings>...</connectionstrings> block and not from <appsettings>...</appsettings>.
I'm familiar with the following in .NET 2.0 which doesn't involve string encryption & decryption:
string strConnexn = ConfigurationManager.ConnectionStrings["cnxNonSecure"].ToString()
What I'm looking for is something that works for secure connection.
Here's a chunk of code from a function for your review:
...
try
{
// Grab the encrypted connection string and decrypt it
string strConnexn = SecureConnection.GetCnxString("cnxNWSecure");
// Establish DB connection
using(SqlConnection cnxString = new SqlConnection(strConnexn))
{
cnxString.Open();
// Perform operation
...
}
...
Thank you in advance for your advice and support.
Anjani K Shiwakoti
Computer programs and social cultures are the same.
-- modified at 4:48 Saturday 6th October, 2007
|
|
|
|
|
i was using stored procedures in the asp.net and in the stored procedure i am using functions there in the stored procedure i wrote the following line to call he function
@itemid int,
@subitemid int,
@SSubItemId int,
@typeMasterid int,
@subtypeMasterid int
declare @lifeid int
set @lifeid = 0
@lifeid = FLifeId(@itemid,@subitemid,@SSubItemId,@typeMasterid,@subtypeMasterid)
and error occured
incorrect systax near @lifeid
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: set @lifeid = 0
@lifeid = FLifeId(@itemid,@subitemid,@SSubItemId,@typeMasterid,@subtypeMasterid)
set @lifeid = FLifeId(@itemid,@subitemid,@SSubItemId,@typeMasterid,@subtypeMasterid)
bEST rEGARD
pATHAN
please don't forget to vote on the post that helped you.
|
|
|
|
|
now the error is flifeid is not the recognized function name , but it exist in the database, i created a user defined function name
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
it was dbo which was needed to be appended with ehe table name.
well Thanks , the problem is solved.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
It depresses me how few people who use these forums have any idea what ASP.NET is, and is not.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: It depresses me how few people who use these forums have any idea what ASP.NET is, and is not.
Sad but true.
But it could be worse: imagine that these people (with the same knowledge about their occupation) would work on a field that could harm people
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Hello Everyone,
I've stored images in the database and now i want to display them in the grid...
Can anybody tell me how it is done in ASP.NET1.1 .......
|
|
|
|
|
Have you stored path of Images in the database?
bEST rEGARD
pATHAN
please don't forget to vote on the post that helped you.
|
|
|
|
|
No actually i'm storing the images directly in the database
and now i want to fetch all the images stored in the database into the datagrid........
|
|
|
|
|
Get it aspalliance.com
bEST rEGARD
pATHAN
please don't forget to vote on the post that helped you.
|
|
|
|
|
|
Friend,
I've stored the path of the images in my database but i'm not getting how to show the images in the datagrid. And further i've also taken template to show the images in the grid......
Plz letme know how to do it......
|
|
|
|
|
Add a image filed from Editcolum section
provide in Data Section : DataImageUrlFiled= <database filed name>
This is sample code !!!!
-------- This section inside grid view ----------
here pic_name is the filed name of ur database image path
<asp:ImageField DataImageUrlField="pic_name" HeaderText="Image" ReadOnly="True" >
<asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT * FROM [Page_table] WHERE [page_id] = @page_id"
</asp:SqlDataSource>
---------------------------------------------------
Hope now u can understand .... if u have still any problem let me know !!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
|
1 file.SaveAs("F://images/" + file.GetName(), true);
this was successfully stored in folder
but
2 SqlCommand sqlcmd = new SqlCommand("insert into tblCategories (CatImage) values (@CatImage)", sqlcon);
sqlcmd.Parameters.Add("@CatImage", file.GetName ());
sqlcmd.ExecuteNonQuery();
here
error:nvarchar is incompatible with image
I gave datatype for CatImage is image.
so wat i have to do.
regards
kishore
|
|
|
|
|
I wrote a longer answer but the forums crashed and IE lost it.
the error means what it says. Try reading a book on SQL instead of making a wild guess. You're passing a string into a field and instead of a string (nvarchar), it's an image (binary data). Fix your data types, in accordance with your error message, and it will be fine.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to do write protect a drive to all system users using Vb dot net. For that i am using the below code. But I am getting Deny permission for the "special Permission" of the selected Drive. Not for the write permission.
Please see the below code.
======================================================
Dim folderLocation As String = "F:"
Dim mydir As New DirectoryInfo(folderlocation)
Dim dirsecurity As DirectorySecurity = mydir.GetAccessControl
Dim fsec As FileSecurity
Dim domain As String = LCase(Environment.UserDomainName)
Dim username As String = Environment.UserName
Dim Drive As String = "F:"
fsec = File.GetAccessControl(Drive)
For Each rule As FileSystemAccessRule In dirsecurity.GetAccessRules(True, True, GetType(NTAccount))
username = rule.IdentityReference.ToString()
MsgBox(".[" + username + "]")
fsec.SetAccessRule(New FileSystemAccessRule(username, FileSystemRights.WriteData, AccessControlType.Deny))
File.SetAccessControl(Drive, fsec)
Next
==================================================
I want to that am i doing proper method or not. if not please suggest the correct way to me for doing the write protect a single drive .
Gopi Ramanathan,
Life will never be the SAME
|
|
|
|
|
This is obviously not an ASP.NET question. Try the VB forum
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi all,
i developed my application using Asp.Net and Sql Server.
its running fine in my local system and when i move all my content to the server its throwing the following error under web.config file.
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 93:
Line 94: <system.web>
Line 95: <authentication mode="Forms">
Line 96:
|
|
|
|
|
The error means what it says. Do you have a virtual directory set up at the level of the file throwing the error ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I think you have not configured virtual directory.
Shujaat
|
|
|
|
|
can you guide me how to configure Virtual Directory?
I am using Windows Vista, (VS2005)ASP.Net2.0, SQL Server 2005.
please guide me how to configure virtual directory
|
|
|
|
|
Do you have iis installed on your system ? if not get it installed first.
Then Goto Start--> Run and type inetmgr and click ok
This will open iis manager
Now there must be atree with your system name
It will be containing a node name websites under websites there will be a node default web site now under this node find your project folder and right click on it and goto properties and in front of application name click create this will create virtual directory.
Shujaat
|
|
|
|
|
After Creating Virtual directory i am geeting the following error while running the application under Server
Server Error in '/Modules' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The URL specified in the config file is invalid.
Source Error:
Line 63: <system.web>
Line 64: <authentication mode="Forms">
Line 65: <forms name="frmLogin" loginurl="D:\Domains\i-vertys.com\wwwroot\modules\Login.aspx" defaulturl="D:\Domains\i-vertys.com\wwwroot\modules\\Member\Member.aspx">
Line 66:
Line 67: <authorization>
Source File: D:\Domains\i-vertys.com\wwwroot\modules\web.config Line: 65
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
|
|
|
|