|
SathyaSiva wrote: i would like to close my application when i click a button
Which application? and On which button click event?
If you are asking about browser close button then you do not need to do anything for this because browser closes itself when you click its close button.
whats your requirement and what do you want to do?
regards
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
using vb
my problems in insertion
ERROR [42000] [Microsoft][ODBC driver for Oracle][Oracle]ORA-00936: missing expression
my code is
<%@ import Namespace="System.Data.ODbc" %>
<%@ Import Namespace=" System.Data"%>
<script runat="server">
Sub submit(sender As Object, e As EventArgs)
dim dbconn
dbconn=New ODbcConnection("dsn=oracle;uid=starter;pwd=starter;")
dbconn.Open()
dim isql,idbread,idbcomm
isql="Insert Into students(id,first_name,last_name,major) values (@fname,@id,@lname,@major)"
idbcomm=new odbccommand(isql,dbconn)
idbcomm.Parameters.Add( "@fname",fname.text)
idbcomm.Parameters.Add( "@id",id.Text)
idbcomm.Parameters.Add( "@lname",lname.Text)
idbcomm.Parameters.Add( "@major",major.Text)
idbcomm.ExecuteNonQuery()
dbconn.Close()
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<th>
Id Number:</th>
<asp:TextBox id="id" runat="server"></asp:TextBox>
<br />
<br />
<th>MaJor:</th>
<asp:TextBox id="major" runat="server"></asp:TextBox>
<br />
<br />
<th>First Name:</th>
<asp:TextBox id="fname" runat="server"></asp:TextBox>
<br />
<br />
<th>Last Name:</th>
<asp:TextBox id="lname" runat="server"></asp:TextBox>
<br />
<br />
<hr />
<asp:Button id="Button1" onclick="submit" runat="server" Text="Submit"></asp:Button>
</form>
</body>
</html>
sanjeev
modified on Saturday, June 28, 2008 2:04 AM
|
|
|
|
|
Which line gives you the error ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
line no not given
sanjeev
|
|
|
|
|
Well, I never put code in the aspx ( what a disaster ), but I'm sure you can set a breakpoint with F9 and step through the code to see which line causes the problem.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have modified my code with only insertion parts
sanjeev
|
|
|
|
|
You don't want me to try to help you then ?
I need to know what line causes the error to try to guess what the problem is.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
EXACTLY I HAVE NOT A LINE NUMBER BUT ERROR IN THIS PART
isql="Insert Into students(id,first_name,last_name,major) values (@fname,@id,@lname,@major)" idbcomm=new odbccommand(isql,dbconn) idbcomm.Parameters.Add( "@fname",fname.text) idbcomm.Parameters.Add( "@id",id.Text) idbcomm.Parameters.Add( "@lname",lname.Text) idbcomm.Parameters.Add( "@major",major.Text) idbcomm.ExecuteNonQuery()
sanjeev
|
|
|
|
|
problems from this part of code
isql="Insert Into students(id,first_name,last_name,major) values (@fname,@id,@lname,@major)"
idbcomm=new odbccommand(isql,dbconn)
idbcomm.Parameters.Add( "@fname",fname.text)
idbcomm.Parameters.Add( "@id",id.Text)
idbcomm.Parameters.Add( "@lname",lname.Text)
idbcomm.Parameters.Add( "@major",major.Text)
idbcomm.ExecuteNonQuery()
sanjeev
|
|
|
|
|
I am new to .Net
In web.conf i have given the connection
<connectionstrings>>
<add name="CS" connectionstring="Data Source=.\SQLExpress;Integrated Security=True;Database=master;Timeout=60;">
<connectionstrings>
Now i want to call the connection to my vb.class and from there i want to use it for my default.aspx page. i dont want to give connections for each of my control.if there is any other alternative kindly suggest me.
Thanks
|
|
|
|
|
|
I've setup a small menu using the WebControls.Menu. It works fine when I run it within VS but when I publish it to the web it does not work. When running the page on the web there is some text next to the root item of the menu which says 'Expand Main topic'. There is also a small white box with a red x inside it. How can I get this to work on the web?
|
|
|
|
|
here is my code
i m trying to insert all the selected files in database having two tables
in First table (Details) columns are ID,Name and Path no
and in second table (Path ) columns are ID
i hav inserted Dataset (Dataset1 ) which is having both tables
btt sumhoww records couldnt be inserted
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Image (*.BMP;)|*.BMP|" + "All files (*.*)|*.*";
openFileDialog1.Multiselect = true;
openFileDialog1.Title = "Select BMP Image Files";
openFileDialog1.ShowDialog();
// string flnm = openFileDialog1.FileName;
flnms = openFileDialog1.FileNames;
int file_number = flnms.Length;
int pathno = 0;
DataSet1 dataset1 = new DataSet1();
DataSet1TableAdapters.DetailsTableAdapter detailsTableAdapter = new DataSet1TableAdapters.DetailsTableAdapter();
DataSet1TableAdapters.PathTableAdapter pathTableAdapter = new DataSet1TableAdapters.PathTableAdapter();
// int row_max = dataset1.Tables["bmpFront"].Rows.Count;
//int row_max = 188;
detailsTableAdapter.Connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"I:\\Picture to DB\\Picture to DB\\All Files.mdb\"");
detailsTableAdapter.Connection.Open();
pathTableAdapter.Connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"I:\\Picture to DB\\Picture to DB\\All Files.mdb\"");
pathTableAdapter.Connection.Open();
pathTableAdapter.Fill(dataset1.Path);
detailsTableAdapter.Fill(dataset1.Details);
int row_max_path = dataset1.Path.Rows.Count;
int row_max_details = dataset1.Details.Rows.Count;
for(int i=0;i<file_number;i++)>
{
string str;
str = flnms[i].ToString();
string[] str1 = str.Split('\\');
string name = str1[str1.Length - 1];
string path = getpath(str1) ;
// DataSet1 dataset1 = new DataSet1();
if (i == 0)
{
pathno = 999;
for (int j = 0; j < dataset1.Tables["Path"].Rows.Count; j++)
{
string str_compare = getpath((dataset1.Path[j][1].ToString()).Split('\\'));
if (str_compare == path)
{
pathno = int.Parse(dataset1.Path[j]["Path Id"].ToString());
}
else
{
continue;
}
}
}
if(pathno == 999)
{
pathTableAdapter.InsertQuery(row_max_path+1, path);
pathno = dataset1.Path.Rows.Count;
}
detailsTableAdapter.InsertQuery(row_max_details+1, name, pathno.ToString());
row_max_path++;
row_max_details++;
}
pathTableAdapter.Connection.Close();
detailsTableAdapter.Connection.Close();
|
|
|
|
|
Are you getting any error ?
IF Yes then on which line.
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
m nt getting error
bt records r nt inserted in table
|
|
|
|
|
paresh_sarjani wrote: m nt getting error
bt records r nt inserted in table
It would appear that some of the vowels are intermittently missing in the above. This makes it difficult to read. Perhaps your keyboard is broken and you need to replace it.
|
|
|
|
|
I want to send an email through my ASP.NET application.
Please help me.
I have the email address stored in the database .
|
|
|
|
|
|
can i send the email through the localhost, i mean through my machine directly ?
I have installed SMTP Virtual Servers in IIS 6.0, through the XP CD !
|
|
|
|
|
I think no but you can verify it whether are you able to send or not.
provide the SMTP server name is 172.0.0.1.
Send mail through the code and check on below location you will found there some file. Open it into the notepad.
C:\Inetpub\mailroot\Queue
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
it is giving
SmtpException<br />
Failure sending mail.
what shall I do ?
|
|
|
|
|
Where you are providing the SMTP Server name in Web.config file ?
IF Yes then examine like this:
<system.net>
<mailsettings>
<smtp from="test@par.com">
<network host="172.0.0.1 OR localhost" port="25" username="" password="" defaultcredentials="true" />
</smtp>
</mailsettings>
</system.net>
OR try external SMTP Server of Gmail
System.Net.Mail.SmtpClient email = new System.Net.Mail.SmtpClient();
email.Host = "smtp.gmail.com";
email.Port = 465 ;
............
............
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
again SmtpException
this time
The operation has timed out.
|
|
|
|
|
|
Parwej Ahamad wrote: which one you are using ?
anti-virus ?
avg free !
|
|
|
|