|
sorry as a learner i am not able handle with constructor could you please guide me
<br />
Public ConnectionString As New SqlClient.SqlConnection<br />
Public Overloads Sub NitemDAL()<br />
ConnectionString = New SqlClient.SqlConnection(ConfigurationSettings.AppSettings("BBM_CONSTR"))<br />
End Sub<br />
<br />
IN Method i used as follows
<br />
Public Function GetDataSet(ByVal Qry As String, ByVal ConnString As SqlClient.SqlConnection, ByVal ParamArray SqlParams() As SqlClient.SqlParameter) As DataSet<br />
Dim cmd As New SqlClient.SqlCommand<br />
Dim sqladpt As New SqlClient.SqlDataAdapter<br />
Dim ds As New DataSet<br />
NitemDAL()<br />
cmd.Connection = ConnString<br />
cmd.CommandText = Qry<br />
cmd.CommandType = CommandType.StoredProcedure<br />
<br />
Try<br />
Attach(cmd, SqlParams)<br />
sqladpt.SelectCommand = cmd<br />
sqladpt.Fill(ds)<br />
cmd.ExecuteNonQuery()<br />
Catch ex As Exception<br />
ex.Message.ToString()<br />
Finally<br />
ConnString.Close()<br />
ConnString.Dispose()<br />
End Try<br />
<br />
If ds.Tables(0).Rows.Count > 0 Then<br />
Return ds<br />
End If<br />
End Function<br />
how to open and close connection, and also i need to know how to use constructor.
sathimailin
|
|
|
|
|
Hi all,
I am creating an asp button control in my code behind and I need to add the click event to that button and do some database transaction in that event.
Please help me with this...
Thanks in advance...
|
|
|
|
|
Button objButton = new Button();
objButton.Click += new EventHandler(objButton_Click);
You need a method to handle the event
private void objButton_Click(object sender,EventArgs e)
{
}
|
|
|
|
|
Thanks Navaneeth for reply. Actually I am creating this button in Ajax Tab control which is again created in code behind. Now the problem is will I get the tab info and other details on this button click event???
Thanks again...
|
|
|
|
|
ASP.NET 2.0 wrote: Now the problem is will I get the tab info and other details on this button click event???
I think you won't get it. I am not sure on this
|
|
|
|
|
You can do this way
Button btn = new Button();
btn.Click += new EventHandler(btn_click);
public void btn_click(object sender,EventArgs e)
{
//Code;
}
umesh
|
|
|
|
|
Hello coders,
i am working on ASP.NET 2.0, i have aspx page, in which master page, Content Placeholder, in this control one textbox with textbox mode is MultiLine.
my problem is if i execute the page, textbox multiline mode not working, it is behaving like a continues text, Enter key not accepting & not going to next line
what was the problem ? any sounds will be appriciated
thanks
Ramana
|
|
|
|
|
I think u can not give a fix column length to the textbox so, try this it is working
<asp:TextBox ID="txtdesc" runat ="server" MaxLength ="2000" TextMode="MultiLine"Columns ="25" Rows ="4" ></asp:TextBox>
|
|
|
|
|
thx for u r reply
i have added new textbox with specified properties, but still getting the same problem
any idea?
Ramana
|
|
|
|
|
Check your Master page and content page with following.
I am try it now and it is successfull work
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="test.aspx.cs" Title="Welcome to World Class" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:TextBox ID="txtdesc" runat ="server" MaxLength ="2000" TextMode ="MultiLine" Columns ="25" Rows ="4" ></asp:TextBox>
</asp:Content>
|
|
|
|
|
The multiline mode is working fine. Just verify mutiline mode is set or not.
You can't do everything...
But you can do something...
So never refuse to do something that you can.....
|
|
|
|
|
use a regular expression validator to set the maxlength for a multiline taxtbox
kavitha
|
|
|
|
|
how to use paypal payment gateway in website..
for reply
In adavance Thanks
Ajai
chaudhary
|
|
|
|
|
ajau wrote: how to use paypal payment gateway in website..
How to use google[^] to find answers ?
|
|
|
|
|
|
Now we are developing a dotnet system wich follows forms authentication with three type of roles. Now we are in a postion to restict the each role to invade others modules...
means for example The master pages sould be available for admin peoples only, if any other users who held other roles such as clients should not be allowed to browse them.
If possible send me your idea in that...
Also i wish to know how to restict a username being used for multiple login at the same time with the different mechines....
Also we require to count the number of users logged in purticular time and their detail. I humbly request you to send me the ideas to develope them in our project...
JuliusM
|
|
|
|
|
Hi julius
3. Add a field in your database having boolean type. so when a user logon its value will be true otherwise false. so count all true etries to get no. of users logged in particular time and their detail.
2. You also can restrict a username being used for multiple login by checking this boolean variable value, an user can only login if variable's value is false.
1. Add an field in your database named userType (eg. admin or user) and check at the time of login.
If there is some dougth then send your ques on my email add : sumitprakash_sharma@yahoo.com
|
|
|
|
|
I have a UC for editing users (EditUsers.ascx).
The data is loaded into EditUsers.ascx with (plain) AJAX.
EdiUsers.ascx consists of editing form, close btn and submit button (Save)...
Because I have three different types of users (with small differences between them), I have copied (to save time) the code from one UC to another and set it to be special to that type of users.
I have created (double click) event handler for Save button:
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
And in code behind:
protected void btnSave_Click(object sender, EventArgs e)
{
}
And this doesn't seem to work...
I submit a form and nothing happens, no save function call.
I also tried this:
protected override void OnInit(EventArgs e)
{
btnSave.Click += new EventHandler(btnSave_Click);
}
protected void btnSave_Click(object sender, EventArgs e)
{
}
And this doesn't work either.
Can anyone tell me what is the problem and am I missing something?
|
|
|
|
|
Checked <%@Page CodeFile="" Inherits="" %> ,maybe these properties don't correct.
|
|
|
|
|
VS.net has generated this and I didn't modify this and namespace is ePoslovi.Module and EditUsers is a class inherited from UserControl how it should be.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditUsers.ascx.cs" Inherits="ePoslovi.Module.EditUsers" %>
Any clue?
|
|
|
|
|
Debugger says that, when I click on submit button, Page.IsPostBack is false?!
Hows that possible?
I even add a new button, and tried with it and same thing.
|
|
|
|
|
Hi everybody
I have a webapplication project.I make URLFriendly for it as
you writing url on the addressbar like WebSite/JavaScript you will see
WebSite/weblearn.aspx?article=javascript.
It is right in the VS.Net (debug mode),but when publish the webapplication
on the localhost or server application it don't right.
I don't understand problem it.
please help me for it.
Thanks.
|
|
|
|
|
reza toorani wrote: it don't right
Could you be a bit more specific?
In what way is it not right?
What happens, and how does that differ from what you expect?
Do you get any error message?
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Hi
When you use urlfriendly like website\javascript on the localhost or server application you will see message "The page cannot be found
".where as use it when runtime of the webapplication you don't see message error and everything is ok.
I used Application_BeginRequest event in the Global.asax file ,i give
the Request.Path and mapping by url in the site,it is correct in the debug mode,but not correct the publish version.
I think never fire Application_BeginRequest event in the publish version.
I don't understand why don't fire event.
|
|
|
|
|
HI All, How can i develop Message Board in ASP.Net? plz send me Demo project with Code.
Message Board like http://www.atifaslam.com.....
plz relpy as soon as possible... i am waiting
Ramakant Singh
|
|
|
|