#️⃣ C# Pahelp sa C# connect to Microsoft SQL Server Management

seawas12

Journeyman
mga master pano kaya to? baka naman po may idea kayo???

1737430002995.webp


eto po un pag lahat ng nasa details

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at payrollm.fLog.btnLog_Click(Object sender, EventArgs e) in C:\Users\porta\source\repos\payrollm\payrollm\fLog.cs:line 29
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9174 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
payrollm
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/porta/source/repos/payrollm/payrollm/bin/Debug/payrollm.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9176 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9176 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_64/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_64/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/assembly/GAC_64/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Thank you mga master
 
Ang error na nararanasan mo ay System.NullReferenceException na nangyayari sa loob ng btnLog_Click event handler sa fLog.cs file sa line 29. Ito ay nangangahulugang mayroon kang isang object reference na hindi naka-set sa isang instance ng isang object.

Para maayos ito, kailangan mong suriin ang code sa btnLog_Click event handler sa fLog.cs file at hanapin kung aling object reference ang hindi naka-set sa tamang instance ng object bago ito gamitin. Maaaring may variable ka doon na hindi naka-initialize o hindi naka-set ng value bago ito gamitin.

Kung gusto mong mag-debug ng code mo, maaari mong gamitin ang Just-In-Time (JIT) debugging. Upang ma-enable ang JIT debugging, kailangan mong i-update ang configuration ng iyong application o computer (machine.config) sa section ng system.windows.forms at i-set ang jitDebugging value sa true.

Narito ang halimbawa ng kung paano ma-enable ang JIT debugging sa iyong configuration:

XML:
<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Kapag ma-enable na ang JIT debugging, ang mga unhandled exception ay ipapadala sa JIT debugger na naka-register sa computer sa halip na ma-handle ng dialog box na lumalabas.

Sana makatulong ito sa iyo sa pagtukoy at pag-aayos ng issue sa iyong code. Kung may iba ka pang mga katanungan o detalye na nais mong i-share, feel free na magtanong ulit. Salamat!
 
yung object reference kasi null yung return ng method/function mo. try mo initialize yung dto or model mo para yung default value nya is 0 at hindi null.
 

About this Thread

  • 2
    Replies
  • 323
    Views
  • 2
    Participants
Last reply from:
iDen

Trending Topics

Online now

Members online
1,015
Guests online
1,546
Total visitors
2,561

Forum statistics

Threads
2,273,385
Posts
28,949,131
Members
1,235,724
Latest member
i-net
Back
Top