Click here to Skip to main content
15,895,283 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Get Loggedin Domain\Username Pin
Richard Deeming7-Jun-13 3:52
mveRichard Deeming7-Jun-13 3:52 
GeneralRe: Get Loggedin Domain\Username Pin
V R Shukla10-Jun-13 1:35
V R Shukla10-Jun-13 1:35 
GeneralRe: Get Loggedin Domain\Username Pin
raesark11-Jun-13 20:18
raesark11-Jun-13 20:18 
AnswerRe: Get Loggedin Domain\Username Pin
jkirkerx8-Jun-13 8:27
professionaljkirkerx8-Jun-13 8:27 
GeneralRe: Get Loggedin Domain\Username Pin
raesark11-Jun-13 20:20
raesark11-Jun-13 20:20 
GeneralRe: Get Loggedin Domain\Username Pin
jkirkerx12-Jun-13 6:46
professionaljkirkerx12-Jun-13 6:46 
QuestionDrop Down Listnot updating when item deleted from GridView Pin
WickedFooker6-Jun-13 4:59
WickedFooker6-Jun-13 4:59 
AnswerRe: Drop Down Listnot updating when item deleted from GridView Pin
WickedFooker7-Jun-13 3:08
WickedFooker7-Jun-13 3:08 
FIXED!

I hard coded the Delete Command to the Grid like this:

C#
<asp:LinkButton runat="server" 
                                            CommandArgument='<%# Eval("class_ID")+ "&" + Eval("stud_ID") %>' 
                                            OnCommand="LinkButton_Click" Text="Delete">
                                        </asp:LinkButton>


In the code back did this:

C#
protected void LinkButton_Click(Object sender, CommandEventArgs e)
    {

        if (e.CommandArgument != null)
        {
            
            string MainString = e.CommandArgument.ToString();
            string[] Split = MainString.Split(new Char[] { '&' });
            //SHOW RESULT of SPLIT
            Session["ClassID"] = (Convert.ToString(Split[0]));
            Session["StudID"] =  (Convert.ToString(Split[1]));
                        
            clsDataLayer.RemoveSchedule(Server.MapPath("eAcademy_DB.mdb"),(String)Session["StudID"],(String)Session["ClassID"]);

            PopClass();
            PopStud();
            gvTeachers.DataBind();
            Session["ClassID"] = null;
            Session["StudID"] = null;    
        }

    }


AND Lastly in my clsdatalayer:
C#
public static void RemoveSchedule(String path, String StudX, String ClassX)
        {
            //declaring database variables to access the database Addressbook
            OleDbConnection dbConn = null;
            OleDbCommand dbCmd;
            OleDbDataReader dr;
            String strConnection;
            String strSQL;
            
            {
                strConnection = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + path;
                dbConn = new OleDbConnection(strConnection);
                dbConn.Open();
                strSQL = "DELETE * FROM tblSchedule WHERE (class_ID=? and stud_ID=?)";
                dbCmd = new OleDbCommand(strSQL, dbConn);
                dbCmd.Parameters.Add(new OleDbParameter("class_ID", ClassX));
                dbCmd.Parameters.Add(new OleDbParameter("stud_ID", StudX));
                dr = dbCmd.ExecuteReader();
                dr.Read();
                dbConn.Close();
                

            }
            
        }


Now to just add back the TRY Catch and it should be working nicely.
QuestionGrid View Pin
Kaushik.Subramanian6-Jun-13 3:22
Kaushik.Subramanian6-Jun-13 3:22 
AnswerRe: Grid View Pin
Richard MacCutchan6-Jun-13 4:41
mveRichard MacCutchan6-Jun-13 4:41 
QuestionGrid View Pin
Kaushik.Subramanian5-Jun-13 22:24
Kaushik.Subramanian5-Jun-13 22:24 
QuestionHow do you run the program for downloading financial data from yahoo ? Pin
forte745-Jun-13 15:51
forte745-Jun-13 15:51 
QuestionAdd Live TV in Asp.Net Pin
Jak Anil4-Jun-13 2:10
Jak Anil4-Jun-13 2:10 
AnswerRe: Add Live TV in Asp.Net Pin
Chetan Talwar6-Jun-13 17:17
Chetan Talwar6-Jun-13 17:17 
GeneralRe: Add Live TV in Asp.Net Pin
Jak Anil7-Jun-13 1:56
Jak Anil7-Jun-13 1:56 
QuestionValidationExpression complexity Pin
VikramKumarJ4-Jun-13 1:53
VikramKumarJ4-Jun-13 1:53 
AnswerRe: ValidationExpression complexity Pin
Richard Deeming4-Jun-13 1:58
mveRichard Deeming4-Jun-13 1:58 
GeneralRe: ValidationExpression complexity Pin
VikramKumarJ4-Jun-13 18:23
VikramKumarJ4-Jun-13 18:23 
QuestionBackend Image creation and loading in webpage Pin
bigjfunk3-Jun-13 17:18
bigjfunk3-Jun-13 17:18 
AnswerRe: Backend Image creation and loading in webpage Pin
Bernhard Hiller3-Jun-13 21:26
Bernhard Hiller3-Jun-13 21:26 
AnswerRe: Backend Image creation and loading in webpage Pin
Jasmine25015-Jun-13 12:34
Jasmine25015-Jun-13 12:34 
QuestionMini-registration Check if Room is booked or open Pin
WickedFooker2-Jun-13 11:11
WickedFooker2-Jun-13 11:11 
AnswerRe: Mini-registration Check if Room is booked or open Pin
Bernard Grosperrin8-Jun-13 1:30
Bernard Grosperrin8-Jun-13 1:30 
QuestionLooking for ideas for custom WYSIWYG editor for LED display Pin
Member 1008696031-May-13 10:15
Member 1008696031-May-13 10:15 
AnswerRe: Looking for ideas for custom WYSIWYG editor for LED display Pin
Jasmine25015-Jun-13 12:30
Jasmine25015-Jun-13 12:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.