|
I am using the ASP.Net property (the build in update that comes with the GridView itself). I didn't write any query because when we use the GridView, the update comes with it because it is one of its property.
|
|
|
|
|
I'd thought you use your own ObjectDataSource because the exception message said so.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Then, I tried to use my own ObjectDataSource which refer to the table wanted. I created new update method (which you can choose it from the window that ask you which method you want to do such as DELETE, INSERT UPDATE and etc…) I chose UPDATE to be generated by the system.
Thanks for your help.
|
|
|
|
|
Hi friends
I have one textbox and one button.
I have many html pages in my application.
Now I want to search text from the html pages content.
Suppose I find "category" text and this text is present all Html pages then I want to find out all that html page's title,related url and starting content of this text.
Thanks in advance
Pathan
---------------------------------------------------
|
|
|
|
|
I think that this topic is pretty wide to cover.
I suggest you to give a try "Microsoft Indexing Service"..
OR Google it "Internal Search Engine"[^]
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
This code is for creating subdomain in IIS for example user logs in to any website.
Domain will be created like this username.website.com.
So can any one help me to write this VB code in C#.
Thank you in advance.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
CreateVirtualDir("savan", "sampletest", "D:\Savan\Backup\ChoicesWildNet\Application Sohel")
End Sub
Private Sub CreateVirtualDir(ByVal WebSite As String, ByVal AppName As String, ByVal Path As String)
Dim IISSchema As New System.DirectoryServices.DirectoryEntry("IIS://" & WebSite & "/Schema/AppIsolated")
'Dim CanCreate As Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "BOOLEAN"
IISSchema.Dispose()
' If CanCreate Then
Dim PathCreated As Boolean
Try
Dim IISAdmin As New System.DirectoryServices.DirectoryEntry("IIS://" & WebSite & "/W3SVC/1/Root")
'make sure folder exists
If Not System.IO.Directory.Exists(Path) Then
System.IO.Directory.CreateDirectory(Path)
PathCreated = True
End If
'If the virtual directory already exists then delete it
For Each VD As System.DirectoryServices.DirectoryEntry In IISAdmin.Children
If VD.Name = AppName Then
IISAdmin.Invoke("Delete", New String() {VD.SchemaClassName, AppName})
IISAdmin.CommitChanges()
Exit For
End If
Next VD
'Create and setup new virtual directory
Dim VDir As System.DirectoryServices.DirectoryEntry = IISAdmin.Children.Add(AppName, "IIsWebVirtualDir")
VDir.Properties("Path").Item(0) = Path
VDir.Properties("AppFriendlyName").Item(0) = AppName
VDir.Properties("EnableDirBrowsing").Item(0) = False
VDir.Properties("AccessRead").Item(0) = True
VDir.Properties("AccessExecute").Item(0) = True
VDir.Properties("AccessWrite").Item(0) = False
VDir.Properties("AccessScript").Item(0) = True
VDir.Properties("AuthNTLM").Item(0) = True
VDir.Properties("EnableDefaultDoc").Item(0) = True
VDir.Properties("DefaultDoc").Item(0) = "default.htm,default.aspx,default.asp"
VDir.Properties("AspEnableParentPaths").Item(0) = True
VDir.CommitChanges()
'the following are acceptable params
'INPROC = 0
'OUTPROC = 1
'POOLED = 2
VDir.Invoke("AppCreate", 1)
Catch Ex As Exception
If PathCreated Then
System.IO.Directory.Delete(Path)
End If
Response.Write(Ex.Message.ToString())
End Try
' End If
End Sub
santosh
|
|
|
|
|
santoshkumarB wrote: So can any one help me to write this VB code in C#.
Sure. What parts of the code is it that you have problems with?
---
single minded; short sighted; long gone;
|
|
|
|
|
thank you,
full because iam not used to vb coding. iam working only with C#.
can u help please..
santosh
|
|
|
|
|
Come on, most of the code is so obvious that you should be able to convert it even without knowing what VB is.
For example:
PathCreated = True
converts to:
PathCreated = true;
and
If VD.Name = AppName Then
converts to:
if (VD.Name == AppName) {
and
VDir.Invoke("AppCreate", 1)
converts to:
VDir.Invoke("AppCreate", 1);
There are a lot of people here who can help you, but noone will do all the work for you if you don't even try for yourself.
---
single minded; short sighted; long gone;
|
|
|
|
|
How much you pay for me ?
SSK.
|
|
|
|
|
C'mon, it's not so different from C#. Just change some of the round brackets to square and add a few more semi-colons...
|
|
|
|
|
|
//TODO: INSTANT C# TODO TASK: Insert the following converted event handlers at the end of the 'InitializeComponent' method for forms, 'Page_Init' for web pages, or into a constructor for other classes:
Button2.Click += new System.EventHandler(Button2_Click);
private void Button2_Click(object sender, System.EventArgs e)
{
CreateVirtualDir("savan", "sampletest", "D:\\Savan\\Backup\\ChoicesWildNet\\Application Sohel");
}
private void CreateVirtualDir(string WebSite, string AppName, string Path)
{
System.DirectoryServices.DirectoryEntry IISSchema = new System.DirectoryServices.DirectoryEntry("IIS://" + WebSite + "/Schema/AppIsolated");
//Dim CanCreate As Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "BOOLEAN"
IISSchema.Dispose();
// If CanCreate Then
bool PathCreated = false;
try
{
System.DirectoryServices.DirectoryEntry IISAdmin = new System.DirectoryServices.DirectoryEntry("IIS://" + WebSite + "/W3SVC/1/Root");
//make sure folder exists
if (! (System.IO.Directory.Exists(Path)))
{
System.IO.Directory.CreateDirectory(Path);
PathCreated = true;
}
//If the virtual directory already exists then delete it
foreach (System.DirectoryServices.DirectoryEntry VD in IISAdmin.Children)
{
if (VD.Name == AppName)
{
IISAdmin.Invoke("Delete", new string[] {VD.SchemaClassName, AppName});
IISAdmin.CommitChanges();
break;
}
}
//Create and setup new virtual directory
System.DirectoryServices.DirectoryEntry VDir = IISAdmin.Children.Add(AppName, "IIsWebVirtualDir");
VDir.Properties["Path"][0] = Path;
VDir.Properties["AppFriendlyName"][0] = AppName;
VDir.Properties["EnableDirBrowsing"][0] = false;
VDir.Properties["AccessRead"][0] = true;
VDir.Properties["AccessExecute"][0] = true;
VDir.Properties["AccessWrite"][0] = false;
VDir.Properties["AccessScript"][0] = true;
VDir.Properties["AuthNTLM"][0] = true;
VDir.Properties["EnableDefaultDoc"][0] = true;
VDir.Properties["DefaultDoc"][0] = "default.htm,default.aspx,default.asp";
VDir.Properties["AspEnableParentPaths"][0] = true;
VDir.CommitChanges();
//the following are acceptable params
//INPROC = 0
//OUTPROC = 1
//POOLED = 2
VDir.Invoke("AppCreate", 1);
}
catch (Exception Ex)
{
if (PathCreated)
{
System.IO.Directory.Delete(Path);
}
Response.Write(Ex.Message.ToString());
}
// End If
}
David Anton
http://www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
C++ to Java Converter: converts C++ to Java
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
|
I am using Response.write to use google maps javascript to put markers on a map, reading latitude and longitude from a SQL Server database. I read the values from the database creating values Lat and Lng and use these in the javascript. However the values of Lat and Lng are not recognised in the javascript. If I hard-code values eg GLatLng(50.953,-4.123) and 1 for userID, a marker is set OK. Can anyone help? I've tried using ClientScript.RegisterClientScriptBlock but got nothing.
<% Dim conn As SqlConnection
conn = New SqlConnection("Data Source=beish2;Initial Catalog=HA4;Integrated Security=True")
conn.Open()
Dim sqlComm As New SqlCommand("SELECT PlaceID,PlaceName, PlaceLat, PlaceLng FROM Places ORDER BY PlaceName", conn)
Dim r As SqlDataReader = sqlComm.ExecuteReader()
While r.Read()
Dim username As String = CStr(r("PlaceName"))
Dim userID As Integer = CInt(r("PlaceID"))
Dim Lat As Double = CDbl(r("PlaceLat"))
Dim Lng As Double = CDbl(r("PlaceLng"))
Response.Write("" & vbCrLf)
Response.Write("//<![CDATA[" & vbCrLf)
Response.Write("map.addControl(new GScaleControl());" & vbCrLf)
Response.Write("var point = new GLatLng(Lat,Lng);" & vbCrLf)
Response.Write("var marker = createMarker(point, userID);" & vbCrLf)
Response.Write("map.addOverlay(marker);" & vbCrLf)
Response.Write("//]]>" & vbCrLf)
Response.Write("" & vbCrLf)
Response.Write(userID)
End While
r.Close()%>
|
|
|
|
|
You can't use VB variables in the Javascript code. They don't exist in the same place, and they don't exist at the same time. Add code to create the variables in the Javascript code. Example:
Response.Write("var Lat = " & Lat.ToString(CultureInfo.InvariantCulture) & ";")
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for reply. Not sure how I get the values from the database (MS SQL Server). Do I need to have the database connection, SQL code and reading of records all within the javascript. If so, do you have any sample code for doing this type of action, or a web site where there are decemt tutorials. I'm not too familiar with javascript
Ken
|
|
|
|
|
beish1 wrote: Thanks for reply. Not sure how I get the values from the database (MS SQL Server).
But you already have code that reads the values from the database. What's wrong with that code?
beish1 wrote: Do I need to have the database connection, SQL code and reading of records all within the javascript.
No, you should absolutely not call the database from the Javascript. It's possible to do so, but that means that anyone can read the database login in the page source.
I showed you how to create a Javascript variable that contains the value from your VB variable. Is there something in that example that you don't understand?
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks for your info - and patience! I wasn't sure what CultureInfo.InvariantCulture
was - do I use that expression everytime for each variable?
Ken
|
|
|
|
|
beish1 wrote: I wasn't sure what CultureInfo.InvariantCulture
was
That's a neutral culture. Among other things it specifies the decimal separator to be a period, which is useful when you format a floating point number to be used in Javascript code.
beish1 wrote: do I use that expression everytime for each variable?
You only need to specify a culture or format when you convert a value where the format depends on the culture. An integer value, for example, is formatted the same regardless of the culture.
---
single minded; short sighted; long gone;
|
|
|
|
|
Could not copy temporary files to the output directory.
hello can any one solve this i made copy local true but it dident work
|
|
|
|
|
Hey all. Im trying to consume RSS feeds in my app but it doesnt seem to work.
No matter which feed i use i get the same error message. The error message is:
"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
Does anyone know if there is a setting i must change, or some kind of codeline to add to the config file?
Dazz
|
|
|
|
|
Hrrmmm.... Ik looks like a firewall blocking outbound traffic may cause this problem..?
|
|
|
|
|
hi friends
i am using telerik component in my aspx page. it work properly in internet explorer-6 but it not work in Mozillafirefox. how i manage all the control in firefox explorer aand how to manage all control of asp.net for Mozilla firefox
please help me
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
Well, either the control is FF compatible, or it isn't. ASP.NET actually detects the capabilities of the browser, and modifies it's controls to suit. My experience with Telerik is that their controls work fine in FF. I'd recommend going to their support page and asking them about the specific problem you have with a specific control.
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 )
|
|
|
|