|
when i try & get my "objdscolleaguedetails could no tfind a non-generic method 'updcolleaguedetails' that has parametera: strconn, colleaguename, mobile, extension, colleagueid.
I've set the gridview's datakeynames to colleagueid,colleaguename,mobile,extension.
I've set my control parameters to update the three fields.
I just cannot figure out why it does not work.
<pre>Web methods
<webservice(namespace:> _
<webservicebinding(conformsto:> _
<global.microsoft.vi></global.microsoft.vi> sualBasic.CompilerServices.DesignerGenerated()> _
Public Class WAB_DataAccessWS
Inherits System.Web.Services.WebService
<webmethod()> _
Public Function GenericQuery(ByVal strConn As String, ByVal strQuery As String) As DataSet
Return WAB_DataAccess.GenericQuery(strConn, strQuery)
End Function
'Select method
<webmethod()> _
Public Function selColleagueDetails(ByVal strConn As String, ByVal intDepartmentID As Integer) As DataSet
Return WAB_DataAccess.selaColleagueDetails(strConn, intDepartmentID)
End Function
'Update method
<webmethod()> _
Public Function updColleagueDetails(ByVal strConn As String, ByVal intColleagueID As Integer, ByVal strColleagueName AS String, ByVal strMobile As String, ByVal strExtension As String) As Integer
Return WAB_DataAccess.UpdaColleagueDetails(strConn, intColleagueID, strColleagueName, strMobile,strExtension)
End Function
End Class
Class
Public Class WAB_DataAccess
Inherits DataAccessBase_v2
' this will be deprecated
Public Shared Function GenericQuery(ByVal strConn As String, ByVal strQuery As String) As DataSet
Return ExecuteQuery_ds(strConn, strQuery)
End Function
'select method called from the webservice
Public Shared Function selaColleagueDetails(ByVal strConn As String, ByVal intDepartmentID As Integer) As DataSet
Return ExecuteQuery_ds(strConn, "exec p_ColleagueDetails " & CStr(intDepartmentID))
End Function
Public Shared Function UpdaColleagueDetails(ByVal strConn As String, ByVal intColleagueID As Integer, ByVal strColleagueName AS String, ByVal strMobile As String, ByVal strExtension As String) As Integer
Dim conn As SqlConnection = New SqlConnection(strConn)
Dim cmd As SqlCommand = New SqlCommand("exec p_UpdateColleaguesDetails '" & intColleagueID & "', '" & strColleagueName & "', " & strMobile & ", '" & strExtension & "'", conn)
Dim result As Integer = 0
conn.Open()
result = cmd.ExecuteNonQuery()
conn.Close()
Return result
End Function
End Class
]]>
]]>
<asp:content id="topContent" contentplaceholderid="topContent" runat="Server" xmlns:asp="#unknown">
<asp:hiddenfield id="hdnMainConnStr" runat="server">
<asp:hiddenfield id="hdnQueryDepartmentDetails" runat="server">
<asp:hiddenfield id="hdnQueryColleagueDetails" runat="server">
<%--use this hiddenfield to update the values of the datagrid with new colleague details--%>
<asp:hiddenfield id="hdnUpdateColleagues" runat="server">
<%--use this hiddenfield to update the values of the datagrid with new colleague details--%>
<asp:hiddenfield id="hdnParamDeleteColleagues" runat="server">
<asp:hiddenfield id="hdnQueryAddColleague" runat="server">
<asp:label id="lblMsg" runat="server" cssclass="" enableviewstate="false">Please Select Your Department |
<asp:dropdownlist id="ddlDepartment" runat="server" cssclass="" datasourceid="objDepartmentDetails" datatextfield="DepartmentName" datavaluefield="DepartmentID" autopostback="true">
<asp:objectdatasource id="objDepartmentDetails" runat="server" selectmethod="GenericQuery" typename="WAB_DataAccessWS.WAB_DataAccessWS">
<selectparameters>
<asp:controlparameter controlid="hdnMainConnStr" name="strConn" propertyname="Value" type="String">
<asp:parameter defaultvalue="exec p_DepartmentDetails" name="strQuery" type="String">
|
Rows per page:
<asp:textbox id="txtRowsPerPage" runat="server" cssclass="" autopostback="true" columns="4" maxlength="4" tabindex="5">
(<%=intMinRows%>-<%=intMaxRows%>)
|
<asp:gridview id="gvwColleagueDetails" runat="server" emptydatatext="No colleague records were found.">
datasourceid="objdsColleagueDetails" cellpadding="4" gridlines="None"
width="100%" allowsorting="True" allowpaging="True"
autogeneratecolumns="False" ForeColor="#333333" ShowFooter="True" DataKeyNames="ColleagueID,ColleagueName,Mobile,Extension">
<pagersettings position="Top">
<pagerstyle horizontalalign="Center" backcolor="#284775" forecolor="White">
<footerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<headerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<editrowstyle backcolor="#999999">
<alternatingrowstyle backcolor="White" forecolor="#284775">
<selectedrowstyle forecolor="#CCFF99" font-bold="True">
BackColor="#009999">
<rowstyle forecolor="#003399" backcolor="White">
<columns> <asp:commandfield showeditbutton="True" showdeletebutton="True" deletetext="Remove" headertext="Add Remove Collegaue">
<asp:boundfield headertext="ColleagueID" readonly="True" datafield="ColleagueID" sortexpression="ColleagueID">
<asp:templatefield headertext="ColleagueName" sortexpression="ColleagueName">
<edititemtemplate>
<asp:textbox id="txtColleagueName" runat="server" text="<%# Bind(" colleaguename")="" %>"="">
<itemtemplate>
<asp:label id="lblColleagueName" runat="server" text="<%# Eval(" colleaguename")="" %>"="">
<asp:templatefield headertext="Mobile" sortexpression="Mobile">
<edititemtemplate>
<asp:textbox id="txtMobile" runat="server" text="<%# Bind(" mobile")="" %>"="">
<itemtemplate>
<asp:label id="lblMobile" runat="server" text="<%# Eval(" mobile")="" %>"="">
<asp:templatefield headertext="Extension" sortexpression="Extension">
<edititemtemplate>
<asp:textbox id="txtExtension" runat="server" text="<%# Bind(" extension")="" %>"="">
<itemtemplate>
<asp:label id="lblExtension" runat="server" text="<%# Eval(" extension")="" %>"="">
<%--<asp:objectdatasource id="objdsColleagueDetails" runat="server" selectmethod="GenericQuery" updatemethod="hdnUpdateColleagues" typename="WAB_DataAccessWS.WAB_DataAccessWS">--%>
<asp:objectdatasource id="objdsColleagueDetails" runat="server" typename="WAB_DataAccessWS.WAB_DataAccessWS" selectmethod="selColleagueDetails" updatemethod="updColleagueDetails">
<selectparameters>
<asp:controlparameter controlid="hdnMainConnStr" name="strConn" propertyname="Value" type="String">
<asp:controlparameter controlid="ddlDepartment" name="intDepartmentID" propertyname="SelectedValue" type="Int32">
<updateparameters>
<asp:controlparameter controlid="hdnMainConnStr" defaultvalue="" name="strConn" propertyname="Value" type="String">
<asp:parameter name="ColleagueName" type="String">
<asp:parameter name="Mobile" type="String">
<asp:parameter name="Extension" type="String">
|
<asp:label id="Label1" runat="server" cssclass="" enableviewstate="false">Add Colleague Details
|
<asp:dropdownlist id="ddlAddColleague" runat="server" cssclass="" datasourceid="objdsAddColleague" datavaluefield="ColleagueName" autopostback="true">
<asp:objectdatasource id="objdsAddColleague" runat="server" selectmethod="GenericQuery" typename="WAB_DataAccessWS.WAB_DataAccessWS">
<selectparameters>
<asp:controlparameter controlid="hdnMainConnStr" name="strConn" propertyname="Value" type="String">
<asp:parameter defaultvalue="exec p_AddColleague" name="strQuery" type="String">
| <asp:button id="btnAdd" cssclass="" runat="server" text="Add Colleague" tooltip="Add Colleague" onclientclick="return confirmAction('Are you sure you want to Add Colleague"> |
thanks for your help
|
|
|
|
|
when i try & get my "objdscolleaguedetails could no tfind a non-generic method 'updcolleaguedetails' that has parametera: strconn, colleaguename, mobile, extension, colleagueid.
I've set the gridview's datakeynames to colleagueid,colleaguename,mobile,extension.
I've set my control parameters to update the three fields.
I just cannot figure out why it does not work.
Web methods
<webservice(namespace:> _
<webservicebinding(conformsto:> _
<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Public Class WAB_DataAccessWS
Inherits System.Web.Services.WebService
<webmethod()> _
Public Function GenericQuery(ByVal strConn As String, ByVal strQuery As String) As DataSet
Return WAB_DataAccess.GenericQuery(strConn, strQuery)
End Function
'Select method
<webmethod()> _
Public Function selColleagueDetails(ByVal strConn As String, ByVal intDepartmentID As Integer) As DataSet
Return WAB_DataAccess.selaColleagueDetails(strConn, intDepartmentID)
End Function
'Update method
<webmethod()> _
Public Function updColleagueDetails(ByVal strConn As String, ByVal intColleagueID As Integer, ByVal strColleagueName AS String, ByVal strMobile As String, ByVal strExtension As String) As Integer
Return WAB_DataAccess.UpdaColleagueDetails(strConn, intColleagueID, strColleagueName, strMobile,strExtension)
End Function
End Class
Class
Public Class WAB_DataAccess
Inherits DataAccessBase_v2
' this will be deprecated
Public Shared Function GenericQuery(ByVal strConn As String, ByVal strQuery As String) As DataSet
Return ExecuteQuery_ds(strConn, strQuery)
End Function
'select method called from the webservice
Public Shared Function selaColleagueDetails(ByVal strConn As String, ByVal intDepartmentID As Integer) As DataSet
Return ExecuteQuery_ds(strConn, "exec p_ColleagueDetails " & CStr(intDepartmentID))
End Function
Public Shared Function UpdaColleagueDetails(ByVal strConn As String, ByVal intColleagueID As Integer, ByVal strColleagueName AS String, ByVal strMobile As String, ByVal strExtension As String) As Integer
Dim conn As SqlConnection = New SqlConnection(strConn)
Dim cmd As SqlCommand = New SqlCommand("exec p_UpdateColleaguesDetails '" & intColleagueID & "', '" & strColleagueName & "', " & strMobile & ", '" & strExtension & "'", conn)
Dim result As Integer = 0
conn.Open()
result = cmd.ExecuteNonQuery()
conn.Close()
Return result
End Function
End Class
]]>
]]>
<asp:content id="topContent" contentplaceholderid="topContent" runat="Server" xmlns:asp="#unknown">
<asp:hiddenfield id="hdnMainConnStr" runat="server">
<asp:hiddenfield id="hdnQueryDepartmentDetails" runat="server">
<asp:hiddenfield id="hdnQueryColleagueDetails" runat="server">
<%--use this hiddenfield to update the values of the datagrid with new colleague details--%>
<asp:hiddenfield id="hdnUpdateColleagues" runat="server">
<%--use this hiddenfield to update the values of the datagrid with new colleague details--%>
<asp:hiddenfield id="hdnParamDeleteColleagues" runat="server">
<asp:hiddenfield id="hdnQueryAddColleague" runat="server">
<asp:label id="lblMsg" runat="server" cssclass="" enableviewstate="false">Please Select Your Department |
<asp:dropdownlist id="ddlDepartment" runat="server" cssclass="" datasourceid="objDepartmentDetails" datatextfield="DepartmentName" datavaluefield="DepartmentID" autopostback="true">
<asp:objectdatasource id="objDepartmentDetails" runat="server" selectmethod="GenericQuery" typename="WAB_DataAccessWS.WAB_DataAccessWS">
<selectparameters>
<asp:controlparameter controlid="hdnMainConnStr" name="strConn" propertyname="Value" type="String">
<asp:parameter defaultvalue="exec p_DepartmentDetails" name="strQuery" type="String">
|
Rows per page:
<asp:textbox id="txtRowsPerPage" runat="server" cssclass="" autopostback="true" columns="4" maxlength="4" tabindex="5">
(<%=intMinRows%>-<%=intMaxRows%>)
|
<asp:gridview id="gvwColleagueDetails" runat="server" emptydatatext="No colleague records were found.">
datasourceid="objdsColleagueDetails" cellpadding="4" gridlines="None"
width="100%" allowsorting="True" allowpaging="True"
autogeneratecolumns="False" ForeColor="#333333" ShowFooter="True" DataKeyNames="ColleagueID,ColleagueName,Mobile,Extension">
<pagersettings position="Top">
<pagerstyle horizontalalign="Center" backcolor="#284775" forecolor="White">
<footerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<headerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<editrowstyle backcolor="#999999">
<alternatingrowstyle backcolor="White" forecolor="#284775">
<selectedrowstyle forecolor="#CCFF99" font-bold="True">
BackColor="#009999">
<rowstyle forecolor="#003399" backcolor="White">
<columns> <asp:commandfield showeditbutton="True" showdeletebutton="True" deletetext="Remove" headertext="Add Remove Collegaue">
<asp:boundfield headertext="ColleagueID" readonly="True" datafield="ColleagueID" sortexpression="ColleagueID">
<asp:templatefield headertext="ColleagueName" sortexpression="ColleagueName">
<edititemtemplate>
<asp:textbox id="txtColleagueName" runat="server" text="<%# Bind(" colleaguename")="" %>"="">
<itemtemplate>
<asp:label id="lblColleagueName" runat="server" text="<%# Eval(" colleaguename")="" %>"="">
<asp:templatefield headertext="Mobile" sortexpression="Mobile">
<edititemtemplate>
<asp:textbox id="txtMobile" runat="server" text="<%# Bind(" mobile")="" %>"="">
<itemtemplate>
<asp:label id="lblMobile" runat="server" text="<%# Eval(" mobile")="" %>"="">
<asp:templatefield headertext="Extension" sortexpression="Extension">
<edititemtemplate>
<asp:textbox id="txtExtension" runat="server" text="<%# Bind(" extension")="" %>"="">
<itemtemplate>
<asp:label id="lblExtension" runat="server" text="<%# Eval(" extension")="" %>"="">
<%--<asp:objectdatasource id="objdsColleagueDetails" runat="server" selectmethod="GenericQuery" updatemethod="hdnUpdateColleagues" typename="WAB_DataAccessWS.WAB_DataAccessWS">--%>
<asp:objectdatasource id="objdsColleagueDetails" runat="server" typename="WAB_DataAccessWS.WAB_DataAccessWS" selectmethod="selColleagueDetails" updatemethod="updColleagueDetails">
<selectparameters>
<asp:controlparameter controlid="hdnMainConnStr" name="strConn" propertyname="Value" type="String">
<asp:controlparameter controlid="ddlDepartment" name="intDepartmentID" propertyname="SelectedValue" type="Int32">
<updateparameters>
<asp:controlparameter controlid="hdnMainConnStr" defaultvalue="" name="strConn" propertyname="Value" type="String">
<asp:parameter name="ColleagueName" type="String">
<asp:parameter name="Mobile" type="String">
<asp:parameter name="Extension" type="String">
|
<asp:label id="Label1" runat="server" cssclass="" enableviewstate="false">Add Colleague Details
|
<asp:dropdownlist id="ddlAddColleague" runat="server" cssclass="" datasourceid="objdsAddColleague" datavaluefield="ColleagueName" autopostback="true">
<asp:objectdatasource id="objdsAddColleague" runat="server" selectmethod="GenericQuery" typename="WAB_DataAccessWS.WAB_DataAccessWS">
<selectparameters>
<asp:controlparameter controlid="hdnMainConnStr" name="strConn" propertyname="Value" type="String">
<asp:parameter defaultvalue="exec p_AddColleague" name="strQuery" type="String">
| <asp:button id="btnAdd" cssclass="" runat="server" text="Add Colleague" tooltip="Add Colleague" onclientclick="return confirmAction('Are you sure you want to Add Colleague"> |
thanks for your help
|
|
|
|
|
Hallo,
I have a textbox with onblur event handled with javascript.
I have asp.net button. When i chage the text in textbox and directly click the button, i get a confirm box from the onblur event. How can i make the button event to fire after answering the confirm box.
In other cases like press tab or clicking some other control is not a problem.
example code:
Textbox txt = new TextBox
txt.id = "txt";
txt.attributes.add("onblur","showmsg(this.id)")
Javascript:
function showmsg(id)
{
var x = document.getElementById(id).value;
if (x != "") {
var res = confirm("msg");
if (res == true) {
document.getElementById(id).value = x;
}
else {
document.getElementById(id).value = "";
}
}
}
|
|
|
|
|
document.getelementbyid('yourButtonId').click();
I didn't get any requirements for the signature
|
|
|
|
|
Thanks,
But how to detect that it is button click event after onblur event.
I mean i want to fire the button click event only if the button is pressed immediately after changing text in textbox.
|
|
|
|
|
How come you can not do this the easy way and set the autopostaback of the textbox to true and use the code behind for that event?
I don't have a good answer for you to know if an event occurs immediately after another event. You may have to use a global variable and a javascript timer. I have no idea.
I didn't get any requirements for the signature
|
|
|
|
|
I do not want autopostback on textbox. There should be some way to detect button click event in javascript.
|
|
|
|
|
|
hello
Can any one help me how to work with web parts with sql server 2000.
By default web parts using sql express
|
|
|
|
|
Webparts have nothing to do with your database.
I didn't get any requirements for the signature
|
|
|
|
|
How to trigger postback for a javascript
<br />
<script language="javascript" type="text/javascript"><br />
function Button1_onclick()<br />
{<br />
document.forms[0]['fileBrowse'].click();<br />
document.forms[0]['TextBox1'].value = document.forms[0]['fileBrowse'].value;<br />
__doPostBack( 'TextBox1','');<br />
}<br />
<br />
</script><br />
<br />
<br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<input id="fileBrowse" type="file" style="visibility: hidden" /><br />
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /><br />
<input id="TextBox1" type="text" /><br />
</div><br />
</form><br />
</body><br />
this code showing an error "object expected" while debugging javascript
Regards,
Radhakrishnan
|
|
|
|
|
Hi,
i'm not sure, but maybe you have to use
document.getElementById()
and the onclick doesn't seem correct:
onclick="javascript:Button1_onclick();"
Do you get the error on your server or on the client?
Regards
Sebastian
|
|
|
|
|
Error at client side
on that __doPostBack()
|
|
|
|
|
You can use the Firefox error console to get the line and a detailed error message.
|
|
|
|
|
document.getelementbyid('yourButtonId').click();
I didn't get any requirements for the signature
|
|
|
|
|
Error is at line __doPostBack( 'TextBox1','');
"object expected"
|
|
|
|
|
That's not what I meant.
Drag a button onto your form. Double click the button in design view to generate server side method.
Add the following in the page_load (server side code)
this.Button1.Style.Add("display", "none");
Add the following javascript to your page.
function CallServerMethod() {
var Button1 = document.getElementById("<%=Button1.ClientID %>");
Button1.click();
}
In your javascript replace
__doPostBack( 'TextBox1','');
with
CallServerMethod()
Add server side code to Button1_Click() event
I didn't get any requirements for the signature
|
|
|
|
|
I want to convert my database of SQL server 2000 (.mdf) File to MS Access Database(.mdb)File using C# Code.
|
|
|
|
|
Vishal09 wrote: I want to convert my database of SQL server 2000 (.mdf) File to MS Access Database(.mdb)File using C# Code.
Why don't you export the data directly?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Why??
If you just need to access the data in Access, you can set up tables that link to the SQL server database...
|
|
|
|
|
Stop trying to make sense and supply the code for him. Now get on it.
I didn't get any requirements for the signature
|
|
|
|
|
ASALAMOALEKUM All,
I am working with video chat.. (web application ASP.NET with C#)
For this I am using VidGrab SDK... refernces have been added successfully but the problem is control is not visible in the toolbox.
(where as when i go with it on windows application in the same way, its control is visible)
As far as i have searched, with web application, controls are added in different ways but those ways are not defined..
can anyone help me out..
if we have to write some html code for designing control, then please refer any article which explains how to write... coz i didnt get related article!
"If there is anyother SDK or way for online video chat please recommend"
waiting for reply !
Thanks!
take care
Regards,
SANA
$@N@
|
|
|
|
|
So, does this SDK have a web control, or just a windows one ? Why not ask they people who wrote the SDK you bought for help ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm having an unusual problem where a control of type System.Web.UI.WebControls.Dropdownlist is somehow disappearing when I select 'Save' on my form. I've gone through my code a couple of times and I'm not explicitly altering its Visible property.
Control ProductVersion is disappearing when I select 'Save'. In the code this is captured within protected void btnMultifunction_Click(object sender, EventArgs e)
Here's the code ...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
public partial class TaskEntry : System.Web.UI.Page
{
private const string _DBConnString = "Data Source=JCAMILLERI\\SQLEXPRESS;Initial Catalog=teamwiki;User ID=teamwiki;Password=password;";
private SqlConnection _conAppDB = new SqlConnection(_DBConnString);
private enum multifunctionButtonFunction {Create, Update, NoUpdate}
private int _selectedProduct = 0;
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack) {
_conAppDB.Open();
Product.Items.Clear();
SqlCommand _getProductSQL = new SqlCommand
(@"select [productID_PK], [product] + ' (' + [product_shortname] + ')' as product
from [teamwiki].[dbo].[product_L]
where [in_use] = 1
order by [product] ASC", _conAppDB);
SqlDataReader _ProductNames = _getProductSQL.ExecuteReader();
Product.DataSource = _ProductNames;
Product.DataTextField = "product";
Product.DataValueField = "productID_PK";
Product.DataBind();
_ProductNames.Close();
}
}
catch (Exception ex) {
throw ex; }
finally {
if (_conAppDB.State == ConnectionState.Open)
{ _conAppDB.Close(); }
}
}
protected void btnMultifunction_Click(object sender, EventArgs e)
{
multifunctionButtonFunction ButtonMode = multifunctionButtonFunction.Create;
if (btnMultifunction.Text == "Create new task")
{
Product.Enabled = true;
calIdealDeliveryDate.Enabled = true;
calLatestDeliveryDate.Enabled = true;
txtRequestedBy.Enabled = true;
lstTaskSubCategory.Enabled = true;
txtTaskDescription.Enabled = true;
lstPriority.Enabled = true;
btnMultifunction.Text = "Save";
ButtonMode = multifunctionButtonFunction.Update;
}
else if (btnMultifunction.Text == "Save") {
Product.Enabled = false;
ProductVersion.Visible = true;
ProductVersion.Enabled = false;
calIdealDeliveryDate.Enabled = false;
calLatestDeliveryDate.Enabled = false;
txtRequestedBy.Enabled = false;
lstTaskSubCategory.Enabled = false;
txtTaskDescription.Enabled = false;
lstPriority.Enabled = false;
if (calIdealDeliveryDate.SelectedDate < DateTime.Now && ButtonMode == multifunctionButtonFunction.Update)
{
Response.Write("Dates cannot be in the past");
ButtonMode = multifunctionButtonFunction.NoUpdate;
}
if (calLatestDeliveryDate.SelectedDate < DateTime.Now)
{
Response.Write("Date cannot be in the past");
ButtonMode = multifunctionButtonFunction.NoUpdate;
}
if (ButtonMode != multifunctionButtonFunction.NoUpdate) {
try
{
_conAppDB.Open();
string _createNewTaskQuery = (@"INSERT INTO [teamwiki].[dbo].[task]
([category_FK1]
,[sub_category_FK2]
,[task_description]
,[priority_FK3]
,[status_FK4]
,[start_date]
,[ideal_delivery_date]
,[latest_delivery_date]
,[task_deadline]
,[request_date]
,[requesting_user]
,[assigned_to]
,[managed_by]
,[implementor_notes]
,[attachment]
,[last_update]
,[in_use]
,[productID_FK5]
,[product_release_FK6])
VALUES ( @category,
@sub_category,
@task_description,
@priority,
@status,
NULL,
@ideal_delivery_date,
@latest_delivery_date,
NULL,
GETDATE(),
@requesting_user,
NULL,
NULL,
NULL,
NULL,
GETDATE(),
@in_use,
@product,
@product_release)");
SqlCommand cmdCreateNewTaskQuery = new SqlCommand(_createNewTaskQuery, _conAppDB);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@category", Global.TaskCategory);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@sub_category", lstTaskSubCategory.SelectedValue);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@task_description", txtTaskDescription.Text);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@priority", 1);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@status", 1);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@ideal_delivery_date", calIdealDeliveryDate.SelectedDate);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@latest_delivery_date", calLatestDeliveryDate.SelectedDate);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@requesting_user", txtRequestedBy.Text);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@in_use", 1);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@product", 1);
cmdCreateNewTaskQuery.Parameters.AddWithValue("@product_release", 1);
cmdCreateNewTaskQuery.ExecuteNonQuery();
string getTaskRef = @"SELECT MAX([taskID_PK]) FROM [teamwiki].[dbo].[task];";
SqlCommand getTaskRefSQL = new SqlCommand(getTaskRef, _conAppDB);
object taskRef = getTaskRefSQL.ExecuteScalar();
if (taskRef != DBNull.Value)
{
txtTaskRef.Text = taskRef.ToString();
}
btnMultifunction.Enabled = false;
}
catch (InvalidCastException)
{
}
catch (Exception ex)
{
throw ex;
}
finally {
_conAppDB.Close();
}
}
}
}
protected void lstPriority_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void txtIdealDeliveryDate_TextChanged(object sender, EventArgs e)
{
}
protected void calLatestDeliveryDate_SelectionChanged(object sender, EventArgs e)
{
}
protected void Products_SelectedIndexChanged(object sender, EventArgs e)
{
if (ProductVersion.Visible == false){
ProductVersion.Visible = true;
ProductVersion.Enabled = true;
string _selectedProduct_s = Product.SelectedValue.ToString();
if (int.TryParse(_selectedProduct_s, out _selectedProduct) == false)
{
throw new Exception();
}
try
{
_conAppDB.Open();
ProductVersion.Items.Clear();
SqlCommand _getProductVersionSQL = new SqlCommand
(@"select product_releaseID_PK, version
from [teamwiki].[dbo].[product_release]
where [in_use] = 1
and productID_FK2 = @productID;", _conAppDB);
_getProductVersionSQL.Parameters.AddWithValue("@productID", _selectedProduct);
SqlDataReader _ProductVersion = _getProductVersionSQL.ExecuteReader();
ProductVersion.DataSource = _ProductVersion;
ProductVersion.DataTextField = "version";
ProductVersion.DataValueField = "product_releaseID_PK";
ProductVersion.DataBind();
_ProductVersion.Close();
}
catch (Exception ex) {
throw ex;
}
finally {
_conAppDB.Close();
}
}
}
protected void ProductVersion_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
Jon
|
|
|
|
|
So why do you post your whole code, noone is going to read this long thing, you should have shown us only the code in the button.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|