|
No Just not intrested
|
|
|
|
|
'Getting a file path
If Not FILE1.PostedFile.FileName = "" Then
FilePath = FILE1.PostedFile.FileName
End If
'Excel Work Sheet Database Connection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=" & FilePath & "; " & _
"Extended Properties=Excel 8.0;")
'Select the data from Sheet1 of the workbook.
'FilePath comes as c:\export\mydata.xls
'now i am going to retrive the "mydata" name only
because of while iam storing the excel file,it is being stored as mydata.xls and at the same time sheet name also being changed as mydata
whenever i am going to retrieve the data, i have to specify the sheet name
for that i am doing the below code, but i am getting an error, it is alreday open by another user or some other error is displayed
Dim f As Array
f = Split(FilePath, "\")
Dim k As Integer = f.Length
Dim str As String = f(k - 1)
Dim filename As String = str.Substring(0, str.LastIndexOf("."))
'' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [" & filename & "$]", MyConnection)
DS = New System.Data.DataSet 'DataSet
MyCommand.Fill(DS) 'Filling The dataset
please help me, when iam going to export the data from database to excel, it is storing it as c1.xls(we give) and sheet1 name is also stored as c1.xls
when i am going to retrieve the data from it, it is giving an error(as above said)
please help me
regards
kishore
go2kish@yahoo.com
kishore
|
|
|
|
|
Dear Friends,
I have an asp.net page, which contains a dropdownlist.
I've inserted 30 items in the dropdown list.
When i click the dropdown list, it shows entire(30) items.
But it should display only 10 items and remaining items should be shown when the scroll bar is scrolled.
If anybody knows the answer for my question, please send the answer as soon as possible.
Senthil Kumar Murugan.
-- modified at 3:01 Thursday 19th April, 2007
|
|
|
|
|
Hi,
I bild an asp.net 2.0 web application, on my develop pc it work right..., I only set the right parser for the application on IIS console... on my home pc it don't work... it' s bad!
the exception text is:
Server Error in '/WSConcessionaria' Application.
--------------------------------------------------------------------------------
Failed to map the path '/WSConcessionaria/App_GlobalResources/'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Failed to map the path '/WSConcessionaria/App_GlobalResources/'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Failed to map the path '/WSConcessionaria/App_GlobalResources/'.]
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +3521404
System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(StandardDiskBuildResultCache diskCache) +306
System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(StandardDiskBuildResultCache diskCache) +46
System.Web.Compilation.BuildManager.PrecompiledAppRuntimeModeInitialize() +708
System.Web.Compilation.BuildManager.Initialize() +3466117
System.Web.Compilation.BuildManager.InitializeBuildManager() +228
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +310
[HttpException (0x80004005): Failed to map the path '/WSConcessionaria/App_GlobalResources/'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3426887
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +149
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
|
|
|
|
|
Hi i am beginner in net developing, and since what have a common question.
Supposed what my web page have an set of images, which will be displayed in browser for user. Also intended what to this set will be supplied other images enough frequently. And the question is in which manner i should store
this images on server part - in database, or simplesmente in separated files
together with pathes to those files in database.
What is the best solution.
Regrat.
|
|
|
|
|
It is great in debug mode, but in IIS dont run the batch file, create a file but dont insert text. Is it a bad setup or code???
I tried dont use dsget but it gets "ASPNET" as username.
Please help me!!!
Thanks and sorry my english...
Imports System.DirectoryServices
Partial Class _Default
Inherits System.Web.UI.Page
Dim Grp As String
Protected Sub GetName()
Dim al As New ArrayList()
Dim line, Name As String
Dim writeName As System.IO.StreamWriter
writeName = IO.File.CreateText("c:\getname.bat")
'Dim strUserName As String
'strUserName = HttpContext.Current.User.Identity.Name
'If InStr(strUserName, "XX") Then
'strUserName = strUserName.Replace("XX\", "")
'End If
writeName.WriteLine("%systemroot%\adlsbin\dsget.exe USER " & """CN=%USERNAME%,OU=Users,OU=XXX,DC=XX,DC=XXXXXXXXXX,DC=XX"" -fn -ln > c:\user.txt")
writeName.Close()
CmdStart("c:\getname.bat")
Dim readUser As System.IO.StreamReader
readUser = IO.File.OpenText("C:\user.txt")
While readUser.Peek <> -1
line = readUser.ReadLine()
If line <> Nothing Then
al.Add(line)
End If
End While
readUser.Close()
If al.Count = 0 Then
'Response.Write(" alert(""user.txt is Empty!"")")
Return
Else
Name = Trim(Replace(al.Item(1), " ", " "))
TxtName.Text = Name
End If
End Sub
Protected Sub CmdStart(ByVal Str As String)
Dim exec As System.Diagnostics.Process = New System.Diagnostics.Process
exec.StartInfo.FileName = Str
exec.StartInfo.WindowStyle = Diagnostics.ProcessWindowStyle.Hidden
exec.Start()
exec.WaitForExit()
End Sub
Protected Sub ExecGroup(ByVal StrGroup As String)
CmdStart(StrGroup)
GetFTID("c:\members.txt")
IO.File.Delete("c:\members.txt")
End Sub
Protected Sub GetID(ByVal MembersTXT As String)
Dim line, s, ID, name, message As String
Dim al As ArrayList = New ArrayList
Dim al2 As ArrayList = New ArrayList
Dim cont, i As Integer
cont = 0
Dim readMembers As System.IO.StreamReader
readMembers = IO.File.OpenText(MembersTXT)
While readMembers.Peek <> -1
line = readMembers.ReadLine()
If line <> Nothing Then
al.Add(line)
End If
End While
readMembers.Close()
For Each s In al
ID = s.Substring(4, 8)
cont = cont + 1
al2.Add(ID)
Next
name = TxtName.Text
'Replace Enter to space
message = Trim(Replace(msg.Text, vbNewLine, " "))
Dim Data As String = Now()
Dim Datestr As String = DateString()
'Declare variables
Dim sFileName As String = "c:\log" & Datestr & ".txt"
Dim myFileStream As New System.IO.FileStream(sFileName, _
IO.FileMode.Append, IO.FileAccess.Write, IO.FileShare.None)
'Create the stream writer
Dim myWriter As New System.IO.StreamWriter(myFileStream)
myWriter.WriteLine("******************************************************")
myWriter.WriteLine(vbCr)
myWriter.WriteLine(Data)
myWriter.WriteLine("--------------------")
myWriter.WriteLine(vbCr)
'Flush before close
myWriter.Flush()
'Close everything
myWriter.Close()
myFileStream.Close()
Dim netSend As System.IO.StreamWriter
netSend = IO.File.CreateText("c:\netsend.bat")
For i = 0 To cont - 1
netSend.WriteLine("net send " & al2(i) & " " & name & ": " & message & " >> c:\log" & Datestr & ".txt")
Next
netSend.Close()
ExecNetSend("c:\netsend.bat")
End Sub
Protected Sub ExecNetSend(ByVal StrNS As String)
CmdStart(StrNS)
Response.Write(" alert(""Message has been Sent!"")")
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles Button1.Click
Dim G As String
Dim group As System.IO.StreamWriter
group = IO.File.CreateText("c:\group.bat")
If Grp = "XXXX" Then
G = "CN=XXXXXXXXX"
ElseIf Grp = "XXXX" Then
G = "CN=XXXXXXXXX"
ElseIf Grp = "XXXX" Then
G = "CN=XXXXXXXXX"
Else
Response.Write(" alert(""Please Select a Destination Group"")")
group.Close()
Return
End If
group.WriteLine("%systemroot%\adlsbin\dsget.exe group " & """" & G & ",OU=Groups,OU=XXX,DC=XX,DC=XXXXX,DC=XX"" -members > c:\members.txt")
group.Close()
ExecGroup("c:\group.bat")
IO.File.Delete("c:\group.bat")
IO.File.Delete("c:\netsend.bat")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles Button2.Click
msg.Text() = ""
End Sub
Protected Sub GBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GBox.SelectedIndexChanged
Grp = GBox.SelectedValue
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles Button3.Click
Response.Write(" { window.close();}")
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
GetName()
IO.File.Delete("c:\getname.bat")
IO.File.Delete("c:\user.txt")
End Sub
End Class
|
|
|
|
|
Hello all,
this problem is my first time to face.
i have iis o my pc and i've browsed my website by http://localhost/sitename
sitename:is the name of my virtual directory
the problem is that i can't browse it from another pc writting http://mypcname/sitename
can anyone help me plz
thnx alot
Ola
|
|
|
|
|
It would have said "Access Denied"
Give anonymous access to your web application, u need to have either form based authentication or something to protect your system!
regards
Karam C Bose
|
|
|
|
|
It's allready having anonymous access
sometimes error is page cannot be displayed
and sometimes it's time out
if u know what is that or it's a network problem plz tell me cause i need this very much
thnx
Ola
|
|
|
|
|
OlaMohammed wrote: that i can't browse it from another pc
this description is not sufficient, you should tell us what happens when you try to browse it from another pc, what kind of error page is displayed.
Pilo
|
|
|
|
|
please give us a detailed error report.
|
|
|
|
|
please give us a detailed error report..
|
|
|
|
|
Hi,
If i select particular date in calendar control it returns in m/d/yyyy format. but i want in mm/dd/yyyy format. Please guide me how to set this format.
i am using,
TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
Thanks in Advance,
Regards,
Prya
|
|
|
|
|
TextBox1.Text = Calendar1.SelectedDate.ToString("MM/dd/yyyy");
Pilo
|
|
|
|
|
Hi Pilo,
Thanks. Its working.
Regards,
Prya
|
|
|
|
|
please give a simple code to understand easy since i am a beeginner ain asp.net
|
|
|
|
|
|
|
Hi i am using System.Data.OracleClient.dll file, on development computer its work fine.but when i deploy on server i am getting following error in web.config file in assembly section
The format of file System.Data.OracleClient is invalid
Any idea please.
Know Yourself Then Grow Yourself.
|
|
|
|
|
what version of .Net ur using and what version of SQL?
|
|
|
|
|
Windows Server 2003.
Framework 2.0
I am using Access database, and SQL Server 2000 also installed on server.
Know Yourself Then Grow Yourself.
|
|
|
|
|
Hi,
I am developing a web appication using asp.net with c#.
I am updating Dataset using datgrid EditItemTemplate and storing in cache.
finally i want to update my table using SqlAdaptor Update mathod but i am gatting error.Please help me..
This is my Dataset Update mathod:
public void grdEmployee_Update(Object o,DataGridCommandEventArgs e)
{
int id = (int)grdEmployee.DataKeys[e.Item.ItemIndex];
TextBox txtName,txtDesignation,txtSex,txtAge,txtSalary;
txtName =(TextBox)e.Item.Cells[0].Controls[0];
txtDesignation =(TextBox)e.Item.Cells[1].Controls[0];
txtSex =(TextBox)e.Item.Cells[2].Controls[0];
txtAge =(TextBox)e.Item.Cells[3].Controls[0];
txtSalary =(TextBox)e.Item.Cells[4].Controls[0];
if (Cache["EMPCACHE"]!=null)
{
DataSet dsUpdate= (DataSet)Cache["EMPCACHE"];
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["NAME"]=txtName.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["DESIGNATION"]=txtDesignation.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["SEX"]=txtSex.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["AGE"]=Convert.ToInt32(txtAge.Text);
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["SALARY"]=Convert.ToSingle(txtSalary.Text);
dsUpdate.AcceptChanges();
Cache["EMPCACHE"]=dsUpdate;
grdEmployee.EditItemIndex = -1 ;
grdEmployee.DataSource = dsUpdate;
grdEmployee.DataBind();
}}
Finally i am going to update on Database using this code
private void btnDatabaseUpdate_Click(object sender, System.EventArgs e)
{
try
{
string strConnection= System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString");
SqlConnection con = new SqlConnection();
con.ConnectionString = strConnection;
SqlDataAdapter sda = new SqlDataAdapter("select ID,NAME,DESIGNATION,SEX,AGE,SALARY from EMPLOYEEDETAILS",con);
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
sda.Fill(dsObj,"EMPLOYEEDETAILS");
DataSet dsUpdate = (DataSet)Cache["EMPCACHE"];
dsObj = dsUpdate.Copy();
int success=sda.Update(dsObj,"EMPLOYEEDETAILS");
dsObj.AcceptChanges();
grdEmployee.DataSource = dsObj;
grdEmployee.DataBind();
}
catch (Exception ex)
{
Response.Write("
" + ex.Message.ToString());
}
}
I am gatting this error:
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.
waiting for promp reply
|
|
|
|
|
Hi all,
I am using validation controls on one of my pages. They work properly the first time and validation is done correctly. After I put all the right values in the fields and the fields are validates and the pages is posted to the server, the validation controls dont work anymore. If i mess up the fields, the validation controls dont catch the errors and allow the page to be posted to the server - this should not be happening.
Anyone ever had a problem like this? Any ideas on how i can conquer this.
Thanks in advance
Kulile --- RSA
|
|
|
|
|
Hey everyone,
Im pretty much a n00b to asp but have a bit of programming experience. Im currently workin on a little project for work which is driving me insane! I didnt want it to come to this (asking experts for help) but i feel the project needs some fresh eyes to guide me to a better solution. So let me just outline what im trying to do;
First, we have a large list of customers on our server, approx 1316 customers. Now on our intranet webpage i wish to create a fast way of finding customers using an ASP tree. So consider a list of customer names returned from an SQL query into a large array. I then wish to check the first couple of letters of each customer, and group customers with similiar names together under one branch in the tree.
The Result would look something like this;
Customers
|
|-A
___|-ar
______-arson, pat
______-arson, mick
______-arsen, jon
______...
______...
___|-as
______-asnot, mark
______...
______...
___|-Other A's
______...
______...
|-B
___|-ba
______|-bai
__________-bailey, john
__________-bailey, mark
__________...
__________...
______|-bar
__________-barker, paul
__________-barton, mike
__________...
__________...
___|-br
______-bromich, dave
______-brockurst, mick
______...
______...
___|-Other B's
______...
______...
|-C
___-charles, john
___-chaplin, pat
______-chan, johnny
|-D
___|-da
.
.
.
....
just to explain anything with a | beside it represents a branch which has leaves while anythin with just - represents a leaf which will hold a customer name
One main important thing about this code is that i want it to be very dynamic and one important feature is groups of similar names, being grouped in their own branch. For example the code should read like;
if there are less than X names beginning with 'ar' then group these names under a branch called 'ar'
But if there are more than X names beginning with 'ar' then search again through this group and compare the first 3 letters for similarity.
This idea is shown in the B section, here the code found more than X names with -ba as the first two letters, and so and the code ran again comparing the first three letters, these groups of three letters had less hits than X and so are plotted in their own trees -bai and -bar.
I hope you can follow me now as you read this and it makes some sort of sense!
I want it to be so dynamic that lets say, we enter many customers with names starting with -bai, the program will then scan the first four letters of the name and if this is over X, it will scan the first five letters of each name, if again theres more than X it will move onto scanning 6 letters.
Thats is why i call it 'intelligent sorting' i want it to be so streamlined that you could have 200 -bai customers sorted into 5 or 6 branches, while you may have only 5 -D customers which will only fall under the -D branch!
I've been trying to do this with a simple checkltr = left(myarray(1,k),3) command and lots of array sorting, which works. but when i move onto checking 4 letters and 5 letters the code gets way too big and eventually just becomes inefficient, there has to be a way of doing this with not much code.
Please, please, please if anyone can help it would be great!
|
|
|
|
|
Can any1 help please, i just need some advice on the best approach to this problem!
|
|
|
|
|