基于asp.net,c#,ado.net的小程序 [英] small programe based on asp.net,c#,ado.net

查看:56
本文介绍了基于asp.net,c#,ado.net的小程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

`hi this azadkumarreddy
我用了2个标签,用2个文本框输入了用户名和密码,用了1个按钮,所以当我单击按钮时,将用户名和密码存储到sqlserver中的表中,并导航到另一个页面.

您能帮我提供代码吗

`hi this azadkumarreddy
i took 2 lables,2 textboxs for username and password,1 button, so when i click button then store the username and password into table in sqlserver, and also navigate to another page.

could u please help me with code

推荐答案

public static bool Insert_File(string FileNo, string CUSTOMER_NAME, string ProjectName, string STATUS,string date,string ins)
    {
        try
        {
            string stinsert = "Insert into File (FileNo,CUSTOMER_NAME,ProjectName,STATUS,IDate,InsertedBy) values (@FileNo,@CUSTOMER_NAME,@ProjectName,@STATUS,@date,@ins)";
            //string stinsert1 = "Insert into FileCord (FileNo,CUSTOMER_NAME,ProjectName,STATUS,IDate) values (@FileNo,@CUSTOMER_NAME,@ProjectName,@STATUS,@date)";

            OleDbCommand cmdinsert = new OleDbCommand(stinsert, GetConnection());

            cmdinsert.Parameters.AddWithValue("FileNo", FileNo);
            cmdinsert.Parameters.AddWithValue("CUSTOMER_NAME", CUSTOMER_NAME);
            cmdinsert.Parameters.AddWithValue("ProjectName", ProjectName);
            cmdinsert.Parameters.AddWithValue("STATUS", STATUS);
            cmdinsert.Parameters.AddWithValue("date",date);
            cmdinsert.Parameters.AddWithValue("ins",ins);
            cmdinsert.ExecuteNonQuery();
            cmdinsert.Connection.Close();
            return true;

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
            return false;
        }
    }




对于更新




For Update

public static bool Update_Received(string FileNo, string ReqControlNo, string ReceiveDate, string Remarks, string received)
    {
        try
        {
            string s1 = "Update Issue set ReceivedDate='" + ReceiveDate + "',ReceivedRemarks= '" + Remarks + "',ReceiveTime='" + received + "' where FileNo='" + FileNo + "' AND ReqControlNo='" + ReqControlNo + "'";
            OleDbCommand cmd1 = new OleDbCommand(s1, GetConnection());
            cmd1.ExecuteNonQuery();
            cmd1.Connection.Close();
            string stts = "Available";
            string st3 = "Update File set STATUS='" + stts + "' where FileNo='" + FileNo + "' ";
            OleDbCommand cmd11 = new OleDbCommand(st3, GetConnection());
            cmd11.ExecuteNonQuery();
            cmd11.Connection.Close();
 
            return true;
 
        }
        catch (Exception ex)
        {
 
            System.Windows.Forms.MessageBox.Show(ex.ToString());
            return false;
        }


完全不行-做一些研究,停止发布作业,并使用google!
quite simply no - do some research, stop posting homework and use google!




您需要从这里开始学习很多东西.
http://www.w3schools.com/aspnet/default.asp [初学者ASP.NET简介 [ http://csharpasp.blogspot.com/ [ ^ ]
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx [ ^ ]
交互式.NET教程 [
Hi,

You need to learn lot of start from here.
http://www.w3schools.com/aspnet/default.asp[^]
Beginners Introduction to ASP.NET[^]
http://csharpasp.blogspot.com/[^]
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson01.aspx[^]
Interactive .NET Tutorial[^]


after reading and learning this start development.


这篇关于基于asp.net,c#,ado.net的小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆