锄我在asp.net中为产品创建条形码 [英] hoe I create bar code in asp.net for products

查看:61
本文介绍了锄我在asp.net中为产品创建条形码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好亲爱的

我试图使用你网站上的代码。但是alwyes出错

错误的是web.mvc.dll是unhandeled

你可以帮我创建条形码加入探险家在mvc C#Database with more than 7桌和数据库首先

最好的问候

F Ibrahim

电子邮件:faayez@gmail.com



我想为我做条形码控制器的产品创建条形码:

  public  ActionResult Index(BProduct model)
{
barcodecs objbar = new barcodecs();
BProduct objprod = new BProduct()
{
ProductName = model.ProductName,
Description = model.Description,
ImageUrl = model.ImageUrl,
BarCodeID = model.BarCodeID,
Barcode = objbar.generateBarcode(),
BarcodeImage = objbar.getBarcodeImage(objbar.generateBarcode(),model。 ProductName)
};
BProduct.InsertOnSubmit(objprod);
SubmitChanges();
return RedirectToAction( Mixxim_ICT Home);
}

私有 void SubmitChanges()
{
throw new NotImplementedException();
}
静态 void Main( string [] args)
{
try
{
FutureFeature();
}
catch (NotImplementedException notImp)
{
Console.WriteLine(notImp.Message);
}
}

静态 void FutureFeature( )
{
// 尚未开发。
throw new NotImplementedException();
}
public ActionResult BarCode()

SqlConnection con = new SqlConnection( 数据源= ------- \\SQLEXPRESS;初始目录=存储;集成安全性= sspi);
string query = select * From Barcode ;
DataTable dt = new DataTable();
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(query,con);
sda.Fill(dt);
con.Close();
IList model = new List();
for int i = 0 ; i < dt.Rows.Count; i ++)
{

var p = dt.Rows [i] [ BarCodeImage];
model.Add( new BProduct()
{
ProductName = dt.Rows [i] [ ProductName]。ToString(),
描述= dt.Rows [i] [ 描述]。ToString(),
Barcode = dt.Rows [i] [ Barcode1]。ToString(),
ImageUrl = dt.Rows [i] [ BarCodeImage]!= null data:image / jpg; base64, + Convert.ToBase64String(( byte [])dt.Rows[i][ BarCodeImage]):

}
);


}
return 查看(型号);
}
}
}

解决方案

当我运行项目并点击时创建

i得到:ITCompany.dll中出现System.NotImplementedException类型的异常但未在用户代码中处理




查看您的代码:

 静态  void  Main( string  [] args)
{
try
{
FutureFeature();
}
catch (NotImplementedException notImp)
{
Console.WriteLine(notImp.Message);
}
}

静态 void FutureFeature( )
{
// 尚未开发。
throw new NotImplementedException();
}





它所做的只是抛出一个NotImplementedException - 因为这就是你告诉它要做的所有事情! / BLOCKQUOTE>

Hello Dear
I tried to used the code what it is in you website. but alwyes get wrong
the wrong is web.mvc.dll is unhandeled
can you please help me to create Bar code en add to explorer in mvc C# Database with more than 7 tables and database first
best regards
F Ibrahim
e-mail: faayez@gmail.com

I want to create Barcode for products that what i did barcode controller:

public ActionResult Index(BProduct model)
{
barcodecs objbar = new barcodecs();
BProduct objprod = new BProduct()
{
ProductName = model.ProductName,
Description = model.Description,
ImageUrl = model.ImageUrl,
BarCodeID = model.BarCodeID,
Barcode = objbar.generateBarcode(),
BarcodeImage = objbar.getBarcodeImage(objbar.generateBarcode(), model.ProductName)
};
BProduct.InsertOnSubmit(objprod);
SubmitChanges();
return RedirectToAction("Mixxim_ICT", "Home");
}
 
private void SubmitChanges()
{
throw new NotImplementedException();
}
static void Main(string[] args)
{
try
{
FutureFeature();
}
catch (NotImplementedException notImp)
{
Console.WriteLine(notImp.Message);
}
}
 
static void FutureFeature()
{
// Not developed yet. 
throw new NotImplementedException();
}
public ActionResult BarCode()

SqlConnection con = new SqlConnection("Data Source=-------\\SQLEXPRESS;Initial Catalog=storage;Integrated Security=sspi");
string query = "select * From Barcode";
DataTable dt = new DataTable();
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(query, con);
sda.Fill(dt);
con.Close();
IList model = new List();
for (int i = 0; i < dt.Rows.Count; i++)
{
 
var p = dt.Rows[i]["BarCodeImage"];
model.Add(new BProduct()
{
ProductName = dt.Rows[i]["ProductName"].ToString(),
Description = dt.Rows[i]["Description"].ToString(),
Barcode = dt.Rows[i]["Barcode1"].ToString(),
ImageUrl = dt.Rows[i]["BarCodeImage"] != null ? "data:image/jpg;base64," + Convert.ToBase64String((byte[])dt.Rows[i]["BarCodeImage"]) : ""
 
}
);
 

}
return View(model);
}
}
}

解决方案

"when i run the project and click create
i get this:An exception of type 'System.NotImplementedException' occurred in ITCompany.dll but was not handled in user code"


Look at your code:

static void Main(string[] args)
    {
    try
        {
        FutureFeature();
        }
    catch (NotImplementedException notImp)
        {
        Console.WriteLine(notImp.Message);
        }
    }

static void FutureFeature()
    {
    // Not developed yet.
    throw new NotImplementedException();
    }



All it will ever do is throw a NotImplementedException - because that is all you have told it to do!


这篇关于锄我在asp.net中为产品创建条形码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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