|
hi
In enterpriselibray 2.0
i add name space
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
this is my code
Database db = DatabaseFactory.CreateDatabase("pubs");
String sqlCommand = "SELECT * FROM TableName" ;
DBCommandWrapper dbCommandWrapper= db.GetSqlStringCommandWrapper(sqlCommand);
DataGrid1.DataSource = db.ExecuteReader(dbCommandWrapper);
DataGrid1.DataBind();
DBCommandWrapper object show the error like this:
The type or namespace name 'DBCommandWrapper' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\admin\My Documents\Visual Studio 2005\WebSite6\Default.aspx.cs 28 6 C:\...\WebSite6\
can u help me??
regards
saravanan
|
|
|
|
|
I had a problem in web.config so I was told to remove
"xmlns ="http://schemas.microsoft.com/.NetConfiguration/v2.0"" so I removed it and now it is giving me errors upon deployment of the website. that it doesn't recognize the connection string.
What should I do?
BiG RaLpH
-- modified at 3:44 Monday 24th September, 2007
|
|
|
|
|
Hi All,
i m sending emails in which i have error:
" The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available"
Write following code:
****************code**************************
msg.To = toemail;
msg.From = fromemailid;
msg.Subject = subject;
msg.BodyFormat = MailFormat.Html;
msg.Body = message;
SmtpMail.SmtpServer = "mail.rsmovie.com";
// Username
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "username");
// Password
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password");
// SMTP Server
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "mail.servername.com");
// Port
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
// These don't normally need changing
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 20);
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", false);
SmtpMail.Send(msg);
plz reply if u have solution.
thanks.
-- modified at 3:22 Monday 24th September, 2007
|
|
|
|
|
try to set the usercredentials property to default....
i am not exactly remembering the syntax.....
or you may follow http://www.codeproject.com/useritems/Send_Emails_in_ASPNET20.asp?print=true
regards
sebastian
-- modified at 5:24 Monday 24th September, 2007
|
|
|
|
|
Hi,
I want to give validation for entered birth date taht age should not be less than 18 years.How can i do this validation.
I have a date in the form 9/25/1980 (mm/dd/yy) I want to validate it
My application is in asp.net 1.0 with vb.net
thanks in advance.
-- modified at 4:05 Monday 24th September, 2007
|
|
|
|
|
U can use Javascript for this ie on textbox onblur event calculate the Age and get check whether its less 18.
|
|
|
|
|
If you want do it using javascript then
Use date object in javascript function
how to use the date object in javascript see the link
http://www.w3schools.com/jsref/jsref_obj_date.asp[^]
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I am doing an application and all the pages work fine.
I am using Infragistics UltraWebgrid control in the form, but it also works fine
in most pages.
The problem is that i am experiencing an error called "Invalid Procedure or argument " in runtime...
The Javascript file in project does not show any error and the line number is showing as 359...
There is no such line in Javascript file attached to the project..
The paging doesnot work because of this...
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
i made a stored procedure.there i wrote the select query and then i code behind file , i wrote the following code.
SqlConnection con;
con = new SqlConnection("connectionstring");
con.Open();
DataSet ds;
ds = new DataSet();
SqlDataAdapter ad;
ad = new SqlDataAdapter("waste");
ad.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
then i added the indert query in the same procedure with the select statement .
problem is in the same function i have to implement the insert query as well as the select query.
using the sqlcommand i passed the parameters.
but how to show the exsiting records
Soniagupta1@yahoo.co.in
|
|
|
|
|
Hello friends..I got following error in as site..
The type or namespace name 'Dbprocess' could not be found (are you missing a using directive or an assembly reference?)
What is the procedure to add reference to your project..Is it necessary to upload dbprocess file in bin folder
|
|
|
|
|
This 'Dbprocess' class file is a part of your webproject or it is in seperate class library project?
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
The Dbprocess class file is put in DBLibrary.dll file and the reference is added to my project. Everything runs fine on local but gives error on server...What is the solution for this..
|
|
|
|
|
Ok I suppose that DBLibrary.dll is Compiled without including the DBProcess class file. To verify this --
Go to Visual Studio .NET command prompt and
Run this Command -- ILDASM
this will open the Intermediate Language Disassembler where you can see all the list of class files included in your DBLibrary.dll. In the list just check DBProcess class file is available or not. If not available then you will have open the DBLibrary class library project and Include the DBProcess class file, compile it, then put the latest build in your BIN folder and reference it.
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Yes Sir You are right ..In The MSIL Disassembler no class file is found..But the class file is present in the DBLibrary project..Is it necessary to include class file in app_code folder...?
|
|
|
|
|
Amit.Jagtap wrote: But the class file is present in the DBLibrary project
Amit.Jagtap wrote: Is it necessary to include class file in app_code folder...?
IF DBLibrary is a seperate class library project and Your DBProcess is a class file part of your DBLibrary then there is no need to include class file in app_code folder.
Amit.Jagtap wrote: Yes Sir You are right ..In The MSIL Disassembler no class file is found..
Did you Do this?
J O N wrote: If not available then you will have to open the DBLibrary class library project and Include the DBProcess class file, compile it, then put the latest build in your BIN folder and reference it.
Also check in the ILDASM by opening the .dll file...
Make sure that class is available...
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Is it necessary to publish a web site before uploading?
|
|
|
|
|
Amit.Jagtap wrote: Is it necessary to publish a web site before uploading?
This question seems to be bit confusing...
As far as I know -- Uploading a site to a server is Publishing a website in a webserver.
Uploading (Publishing)
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
A file can be physical present in the location but may not be actually Included in the project. It has to be explicitly Included in you project (By anychance if it is excluded from the Project for any reason)
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Is it necessary to publish and/or deploy a site before uploading?
|
|
|
|
|
I have a data view and need to get the index of a search value in one of its column .
How can i do it without using for loop ....
Is there some way IndexOf() can be used on a column .....
|
|
|
|
|
Iam having a Employee Form which contains Employee Details and Employee Photo which should be stored in the Oracle table with the Employee Information and while modifying the Data it should be retrieved to the Employee's form
Main things are
All the Photos will be stored in a folder which should be retrieved by the Employee Number.
and how to store the information as well as image into Oracle database.
Next retrieving that info info and image to ASP.Net2.0
thank u in advance
Priya
|
|
|
|
|
Hi priya actuly I don't know it for oracle but i had done it in sql server ok. If u can convert then try to it into oracle. ok
I am explaining step by step.
1. just set datatype as a binary (or somewhat like which support binary data into oracle)of photo field in database.
2. Now convert your employees image into binary using below code.
//For Image storing into database after converting into binary.
// This code is writen in C#.NET.
byte[] binary = null;
if (FileUpload1.HasFile)
{
binary = new byte[FileUpload1.PostedFile.ContentLength];
binary = FileUpload1.FileBytes;
}
// Below line is command parameter it will used while u are inserting data using stored procedure
Cmd.Parameters.AddWithValue("@U_Photo", binary);//Photo
3. The above code will convert into binary and stored it into database.
4. Now retriving it back from database
//For retriving image from database and place into image control
//Below code is function named RetrievedImage()
// put this code into differnt page and set this page as a Image1.ImageUrl(thispage.aspx? pid='pid')
// and Image1 will place on your edit employee page. Ok
private System.Drawing.Image RetrieveImage(int pid)
{
System.Drawing.Image image = null;
try
{
strcon = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
Con = new SqlConnection(strcon);
Con.Open();
Cmd = new SqlCommand("SELECT Photo_Field FROM table_Name where phot_Id='" + pid + "'", Con);
Cmd.CommandType = CommandType.Text;
SqlDataReader Dr = Cmd.ExecuteReader();
if (Dr.Read())
{
byte[] imageData = (byte[])Dr["U_Photo"];
MemoryStream memStream = new MemoryStream(imageData);
image = System.Drawing.Image.FromStream(memStream);
}
}
catch (Exception ex)
{
Session["Error"] = ex.Message.ToString();
}
return image;
}
I hope it will work fine. All the best.
|
|
|
|
|
How can we write textbox keypress event in Asp.net
thanx in advance
prabumj@gmail.com
|
|
|
|
|
DO you want it in javascript or server side
in javacsript Register the client script
TextBoxId.Attributes.Add("OnClick", "javascript:yourfunctionName");
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
can u help me in how to include Javascript Function of keypress in asp.net.
Thanx
prabumj@gmail.com
-- modified at 2:20 Monday 24th September, 2007
|
|
|
|